diff options
| author | Ajax <commial@gmail.com> | 2018-02-14 12:27:35 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2018-02-14 14:20:28 +0100 |
| commit | 0f55f0779555c38cd907143527d4ddbf26c18157 (patch) | |
| tree | 65d6c4f1c613822d0441bd296cc4c7e7f1136522 | |
| parent | 63a67ae9731392afdc47ff36a57eaefc49d2f727 (diff) | |
| download | miasm-0f55f0779555c38cd907143527d4ddbf26c18157.tar.gz miasm-0f55f0779555c38cd907143527d4ddbf26c18157.zip | |
Lower the size of too long test to let z3 run in a human time
| -rw-r--r-- | test/expression/simplifications.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py index 871ff0f4..0c516a8e 100644 --- a/test/expression/simplifications.py +++ b/test/expression/simplifications.py @@ -13,8 +13,6 @@ parser = ArgumentParser("Expression simplification regression tests") parser.add_argument("--z3", action="store_true", help="Enable check against z3") parser.add_argument("-v", "--verbose", action="store_true", help="Verbose simplify") -parser.add_argument("--z3-timeout", type=int, help="z3 timeout (in seconds)", - default=20) args = parser.parse_args() if args.verbose: @@ -33,9 +31,6 @@ if args.z3: solver.add(trans.from_expr(expr_in) != trans.from_expr(expr_out)) result = solver.check() - if result == z3.unknown: - print "-> Timeout!" - return if result != z3.unsat: print "ERROR: a counter-example has been founded:" @@ -87,6 +82,12 @@ c31 = ExprId('c31', 31) b31_msb_null = ExprId('b31', 31)[:30].zeroExtend(31) c31_msb_null = ExprId('c31', 31)[:30].zeroExtend(31) +a8 = ExprId('a8', 8) +b8 = ExprId('b8', 8) +c8 = ExprId('c8', 8) +d8 = ExprId('d8', 8) +e8 = ExprId('e8', 8) + m = ExprMem(a) s = a[:8] @@ -241,8 +242,8 @@ to_test = [(ExprInt(1, 32) - ExprInt(1, 32), ExprInt(0, 32)), ExprCond(a, ExprInt(4, 32), ExprInt(8, 32))), (ExprCond(a, b, c) + ExprCond(a, d, e), ExprCond(a, b + d, c + e)), - (ExprCond(a, b, c) * ExprCond(a, d, e), - ExprCond(a, b * d, c * e)), + (ExprCond(a8, b8, c8) * ExprCond(a8, d8, e8), + ExprCond(a8, b8 * d8, c8 * e8)), (ExprCond(a, ExprInt(8, 32), ExprInt(4, 32)) >> ExprInt(1, 32), ExprCond(a, ExprInt(4, 32), ExprInt(2, 32))), @@ -401,7 +402,7 @@ to_test = [(ExprInt(1, 32) - ExprInt(1, 32), ExprInt(0, 32)), ExprInt(0x0321, 16))), (ExprCompose(ExprCond(a, i1, i0), ExprCond(a, i1, i2)), ExprCond(a, ExprInt(0x100000001, 64), ExprInt(0x200000000, 64))), - ((ExprMem(ExprCond(a, b, c)),ExprCond(a, ExprMem(b), ExprMem(c)))), + ((ExprMem(ExprCond(a, b, c), 4),ExprCond(a, ExprMem(b, 4), ExprMem(c, 4)))), (ExprCond(a, i0, i1) + ExprCond(a, i0, i1), ExprCond(a, i0, i2)), (a << b << c, a << b << c), # Left unmodified |