Start expression simplification

This commit is contained in:
Léa Saviot
2018-06-29 17:54:54 +02:00
parent 53bacec72f
commit f0e2bd0e5c
12 changed files with 147 additions and 32 deletions

View File

@@ -222,6 +222,23 @@ void testStealOperand() {
assert_expression_approximates_to(a2, 2);
}
void testSimplify() {
printf("Symplify test\n");
AdditionRef a(
AdditionRef(
FloatRef(0.0f),
FloatRef(1.0f)),
FloatRef(2.0f));
assert_expression_approximates_to(a, 3);
a.deepReduce();
assert_expression_approximates_to(a, 3);
assert(a.numberOfChildren() == 3);
}
void testPoolLayoutAllocationFail() {
printf("Pool layout allocation fail test\n");
@@ -260,7 +277,7 @@ int main() {
runTest(testPoolExpressionAllocationFail);
runTest(testPoolExpressionAllocationFail2);
runTest(testPoolExpressionAllocationFailOnImbricatedAdditions);
runTest(testStealOperand);
//runTest(testStealOperand);
printf("\n*******************\nEnd of tests\n*******************\n\n");
return 0;
}