diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 10:35:32 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 13:37:03 +0100 |
| commit | c4e4273c2d4e459eddc96c8ef0af0e5eff9c3f7e (patch) | |
| tree | eae7ae526c7e45d1e640c814ec3a03d5b999fac8 /test | |
| parent | e37d545e07a22b0ea9a5ce21b975c73927dd4d50 (diff) | |
| download | miasm-c4e4273c2d4e459eddc96c8ef0af0e5eff9c3f7e.tar.gz miasm-c4e4273c2d4e459eddc96c8ef0af0e5eff9c3f7e.zip | |
Expression: fix api
Diffstat (limited to 'test')
| -rw-r--r-- | test/arch/arm/sem.py | 4 | ||||
| -rw-r--r-- | test/arch/msp430/sem.py | 2 | ||||
| -rw-r--r-- | test/expression/simplifications.py | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/test/arch/arm/sem.py b/test/arch/arm/sem.py index 51c42fd1..feef7372 100644 --- a/test/arch/arm/sem.py +++ b/test/arch/arm/sem.py @@ -16,7 +16,7 @@ EXCLUDE_REGS = set([ir_arch().IRDst]) def M(addr): - return ExprMem(ExprInt_fromsize(16, addr), 16) + return ExprMem(ExprInt(addr, 16), 16) def compute(asm, inputstate={}, debug=False): @@ -285,7 +285,7 @@ class TestARMSemantic(unittest.TestCase): self.assertEqual(compute('AND R4, R4, R5 LSR 2 ', {R4: 0xFFFFFFFF, R5: 0x80000041, }), {R4: 0x20000010, R5: 0x80000041, }) self.assertEqual(compute('AND R4, R4, R5 ASR 3 ', {R4: 0xF00000FF, R5: 0x80000081, }), {R4: 0xF0000010, R5: 0x80000081, }) self.assertEqual(compute('AND R4, R4, R5 ROR 4 ', {R4: 0xFFFFFFFF, R5: 0x000000FF, }), {R4: 0xF000000F, R5: 0x000000FF, }) - self.assertEqual(compute('AND R4, R4, R5 RRX ', {R4: 0xFFFFFFFF, R5: 0x00000101, }), {R4: ExprCompose([(ExprInt_fromsize(31, 0x80),0,31), (cf_init,31,32)]), R5: 0x00000101, }) + self.assertEqual(compute('AND R4, R4, R5 RRX ', {R4: 0xFFFFFFFF, R5: 0x00000101, }), {R4: ExprCompose([(ExprInt(0x80, 31),0,31), (cf_init,31,32)]), R5: 0x00000101, }) # §A8.8.15: AND{S}{<c>}{<q>} {<Rd>,} <Rn>, <Rm>, <type> <Rs> self.assertEqual(compute('AND R4, R6, R4 LSL R5', {R4: 0x00000001, R5: 0x00000004, R6: -1, }), {R4: 0x00000010, R5: 0x00000004, R6: 0xFFFFFFFF, }) diff --git a/test/arch/msp430/sem.py b/test/arch/msp430/sem.py index 5340a4d2..2488d633 100644 --- a/test/arch/msp430/sem.py +++ b/test/arch/msp430/sem.py @@ -14,7 +14,7 @@ logging.getLogger('cpuhelper').setLevel(logging.ERROR) EXCLUDE_REGS = set([res, ir_arch().IRDst]) def M(addr): - return ExprMem(ExprInt_fromsize(16, addr), 16) + return ExprMem(ExprInt(addr, 16), 16) def compute(asm, inputstate={}, debug=False): diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py index 6290a807..12d8f958 100644 --- a/test/expression/simplifications.py +++ b/test/expression/simplifications.py @@ -154,9 +154,9 @@ to_test = [(ExprInt32(1) - ExprInt32(1), ExprInt32(0)), (ExprCond(a, b, c) >> ExprCond(a, d, e), ExprCond(a, b >> d, c >> e)), - (a & b & ExprInt_fromsize(a.size, -1), a & b), - (a | b | ExprInt_fromsize(a.size, -1), - ExprInt_fromsize(a.size, -1)), + (a & b & ExprInt(-1, a.size), a & b), + (a | b | ExprInt(-1, a.size), + ExprInt(-1, a.size)), (ExprOp('-', ExprInt8(1), ExprInt8(0)), ExprInt8(1)), @@ -165,9 +165,9 @@ to_test = [(ExprInt32(1) - ExprInt32(1), ExprInt32(0)), (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) << ExprInt64(0x10), ExprCompose([(ExprInt16(0), 0, 16), (a, 16, 48), (ExprInt16(0), 48, 64)])), (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) << ExprInt64(0x30), - ExprCompose([(ExprInt_fromsize(48, 0), 0, 48), (a[:0x10], 48, 64)])), + ExprCompose([(ExprInt(0, 48), 0, 48), (a[:0x10], 48, 64)])), (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) << ExprInt64(0x11), - ExprCompose([(ExprInt_fromsize(0x11, 0), 0, 0x11), (a, 0x11, 0x31), (ExprInt_fromsize(0xF, 0), 0x31, 0x40)])), + ExprCompose([(ExprInt(0, 0x11), 0, 0x11), (a, 0x11, 0x31), (ExprInt(0, 0xF), 0x31, 0x40)])), (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) << ExprInt64(0x40), ExprInt64(0)), (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) << ExprInt64(0x50), @@ -178,9 +178,9 @@ to_test = [(ExprInt32(1) - ExprInt32(1), ExprInt32(0)), (ExprCompose([(ExprInt32(0), 0, 32), (a, 32, 64)]) >> ExprInt64(0x10), ExprCompose([(ExprInt16(0), 0, 16), (a, 16, 48), (ExprInt16(0), 48, 64)])), (ExprCompose([(ExprInt32(0), 0, 32), (a, 32, 64)]) >> ExprInt64(0x30), - ExprCompose([(a[0x10:], 0, 16), (ExprInt_fromsize(48, 0), 16, 64)])), + ExprCompose([(a[0x10:], 0, 16), (ExprInt(0, 48), 16, 64)])), (ExprCompose([(ExprInt32(0), 0, 32), (a, 32, 64)]) >> ExprInt64(0x11), - ExprCompose([(ExprInt_fromsize(0xf, 0), 0, 0xf), (a, 0xf, 0x2f), (ExprInt_fromsize(0x11, 0), 0x2f, 0x40)])), + ExprCompose([(ExprInt(0, 0xf), 0, 0xf), (a, 0xf, 0x2f), (ExprInt(0, 0x11), 0x2f, 0x40)])), (ExprCompose([(ExprInt32(0), 0, 32), (a, 32, 64)]) >> ExprInt64(0x40), ExprInt64(0)), (ExprCompose([(ExprInt32(0), 0, 32), (a, 32, 64)]) >> ExprInt64(0x50), |