about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-02-15 16:08:13 +0100
committerAjax <commial@gmail.com>2016-02-16 08:24:25 +0100
commite776c817169873b36293d8f7679234a2c179f193 (patch)
treedb30c12efff4077797bb08b9670faeffbd7889f3 /test
parentc2a424eae3cea350abf9430231b243ed85b37e81 (diff)
downloadmiasm-e776c817169873b36293d8f7679234a2c179f193.tar.gz
miasm-e776c817169873b36293d8f7679234a2c179f193.zip
Symbexec: add apply_expr, taking in account side effects
Diffstat (limited to 'test')
-rw-r--r--test/ir/symbexec.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ir/symbexec.py b/test/ir/symbexec.py
index 1d87b470..9165fccb 100644
--- a/test/ir/symbexec.py
+++ b/test/ir/symbexec.py
@@ -7,7 +7,8 @@ import unittest
 class TestSymbExec(unittest.TestCase):
 
     def test_ClassDef(self):
-        from miasm2.expression.expression import ExprInt32, ExprId, ExprMem, ExprCompose
+        from miasm2.expression.expression import ExprInt32, ExprId, ExprMem, \
+            ExprCompose, ExprAff
         from miasm2.arch.x86.sem import ir_x86_32
         from miasm2.ir.symbexec import symbexec
 
@@ -52,6 +53,9 @@ class TestSymbExec(unittest.TestCase):
         self.assertEqual(set(e.modified()), set(e.symbols))
         self.assertRaises(
             KeyError, e.symbols.__getitem__, ExprMem(ExprInt32(100)))
+        self.assertEqual(e.apply_expr(id_eax), addr0)
+        self.assertEqual(e.apply_expr(ExprAff(id_eax, addr9)), addr9)
+        self.assertEqual(e.apply_expr(id_eax), addr9)
 
 if __name__ == '__main__':
     testsuite = unittest.TestLoader().loadTestsFromTestCase(TestSymbExec)