mirror of
https://github.com/open-goal/jak-project
synced 2026-05-29 08:43:08 -04:00
[decompiler] Jak 2 modifications, new all-types code (#1553)
* temp * look at old game types * clean up
This commit is contained in:
@@ -28,7 +28,7 @@ TEST_F(FormRegressionTest, SimplestTest) {
|
||||
" daddu sp, sp, r0";
|
||||
std::string type = "(function object object)";
|
||||
std::string expected = "(begin (set! v0-0 a0-0) (ret-value v0-0))";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Op3) {
|
||||
@@ -40,7 +40,7 @@ TEST_F(FormRegressionTest, Op3) {
|
||||
" daddu sp, sp, r0";
|
||||
std::string type = "(function int int int)";
|
||||
std::string expected = "(begin (set! v0-0 (*.si a0-0 a1-0)) (ret-value v0-0))";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Division) {
|
||||
@@ -53,7 +53,7 @@ TEST_F(FormRegressionTest, Division) {
|
||||
" daddu sp, sp, r0";
|
||||
std::string type = "(function int int int)";
|
||||
std::string expected = "(begin (set! v0-0 (/.si a0-0 a1-0)) (ret-value v0-0))";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Ash) {
|
||||
@@ -73,7 +73,7 @@ TEST_F(FormRegressionTest, Ash) {
|
||||
" sll r0, r0, 0";
|
||||
std::string type = "(function int int int)";
|
||||
std::string expected = "(begin (set! v1-0 a0-0) (set! v0-0 (ash.si v1-0 a1-0)) (ret-value v0-0))";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Abs) {
|
||||
@@ -89,7 +89,7 @@ TEST_F(FormRegressionTest, Abs) {
|
||||
" daddu sp, sp, r0";
|
||||
std::string type = "(function int int)";
|
||||
std::string expected = "(begin (set! v0-0 a0-0) (set! v0-0 (abs v0-0)) (ret-value v0-0))";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Min) {
|
||||
@@ -109,7 +109,7 @@ TEST_F(FormRegressionTest, Min) {
|
||||
" (set! v0-1 (min.si v0-0 v1-0))\n"
|
||||
" (ret-value v0-1)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Max) {
|
||||
@@ -130,7 +130,7 @@ TEST_F(FormRegressionTest, Max) {
|
||||
" (set! v0-1 (max.si v0-0 v1-0))\n"
|
||||
" (ret-value v0-1)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, FormatString) {
|
||||
@@ -169,7 +169,7 @@ TEST_F(FormRegressionTest, FormatString) {
|
||||
" (set! v0-1 a0-0)\n"
|
||||
" (ret-value v0-1)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected, false, "", {{"L343", "~f"}});
|
||||
test_no_expr_jak1(func, type, expected, false, "", {{"L343", "~f"}});
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, WhileLoop) {
|
||||
@@ -212,7 +212,7 @@ TEST_F(FormRegressionTest, WhileLoop) {
|
||||
" (set! v0-0 #f)\n"
|
||||
" (ret-value v0-0)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
// Note - this test looks weird because or's aren't fully processed at this point.
|
||||
@@ -278,7 +278,7 @@ TEST_F(FormRegressionTest, Or) {
|
||||
" (set! v0-0 #f)\n"
|
||||
" (ret-value v0-0)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, DynamicMethodAccess) {
|
||||
@@ -355,7 +355,7 @@ TEST_F(FormRegressionTest, DynamicMethodAccess) {
|
||||
" )\n"
|
||||
" (ret-value v0-0)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected);
|
||||
test_no_expr_jak1(func, type, expected);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, SimpleLoopMergeCheck) {
|
||||
@@ -397,7 +397,7 @@ TEST_F(FormRegressionTest, SimpleLoopMergeCheck) {
|
||||
" (set! v0-0 (car a0-0))\n"
|
||||
" (ret-value v0-0)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected, true);
|
||||
test_no_expr_jak1(func, type, expected, true);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, And) {
|
||||
@@ -467,7 +467,7 @@ TEST_F(FormRegressionTest, And) {
|
||||
" )\n"
|
||||
" )"
|
||||
"(ret-value v0-0))\n";
|
||||
test_no_expr(func, type, expected, true);
|
||||
test_no_expr_jak1(func, type, expected, true);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, FunctionCall) {
|
||||
@@ -548,7 +548,7 @@ TEST_F(FormRegressionTest, FunctionCall) {
|
||||
" (set! v0-1 a1-0)\n" // not empty, so return the result
|
||||
" )" // the (set! v0 #f) from the if is added later.
|
||||
" (ret-value v0-1))\n";
|
||||
test_no_expr(func, type, expected, true);
|
||||
test_no_expr_jak1(func, type, expected, true);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, NestedAndOr) {
|
||||
@@ -715,7 +715,7 @@ TEST_F(FormRegressionTest, NestedAndOr) {
|
||||
" (set! v0-1 a0-0)\n"
|
||||
" (ret-value v0-1)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected, true);
|
||||
test_no_expr_jak1(func, type, expected, true);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, NewMethod) {
|
||||
@@ -770,7 +770,7 @@ TEST_F(FormRegressionTest, NewMethod) {
|
||||
" (set! (-> v0-0 allocated-length) a2-0)\n"
|
||||
" )"
|
||||
" (ret-value v0-0))\n";
|
||||
test_no_expr(func, type, expected, false, "inline-array-class");
|
||||
test_no_expr_jak1(func, type, expected, false, "inline-array-class");
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, Recursive) {
|
||||
@@ -815,7 +815,7 @@ TEST_F(FormRegressionTest, Recursive) {
|
||||
" )\n"
|
||||
" )"
|
||||
" (ret-value v0-0))\n";
|
||||
test_no_expr(func, type, expected, false);
|
||||
test_no_expr_jak1(func, type, expected, false);
|
||||
}
|
||||
|
||||
TEST_F(FormRegressionTest, TypeOf) {
|
||||
@@ -851,5 +851,5 @@ TEST_F(FormRegressionTest, TypeOf) {
|
||||
" (set! v0-0 (call! a0-0))\n"
|
||||
" (ret-value v0-0)\n"
|
||||
" )";
|
||||
test_no_expr(func, type, expected, false);
|
||||
test_no_expr_jak1(func, type, expected, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user