about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2017-01-05 10:55:35 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2017-01-09 14:42:07 +0100
commit0aad6093e6f7250d1c9a3da8f1f3ebe171a752dd (patch)
tree4c3d1f013c155ba3f1be6ec03d30b6bf5bda5450
parentf2ab04c7a6ecd1eaaf3186565545d761b508ab97 (diff)
downloadmiasm-0aad6093e6f7250d1c9a3da8f1f3ebe171a752dd.tar.gz
miasm-0aad6093e6f7250d1c9a3da8f1f3ebe171a752dd.zip
DepGraph: Add emul regression tests
-rwxr-xr-xtest/analysis/dg_test_11_expected.json1
-rw-r--r--test/analysis/dg_test_11_implicit_expected.json1
-rw-r--r--test/samples/x86_32/dg_test_11.S10
-rwxr-xr-xtest/test_all.py1
4 files changed, 13 insertions, 0 deletions
diff --git a/test/analysis/dg_test_11_expected.json b/test/analysis/dg_test_11_expected.json
new file mode 100755
index 00000000..ced55daf
--- /dev/null
+++ b/test/analysis/dg_test_11_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EBX": "0x1"}, {"has_loop": false, "EBX": "0x3"}, {"has_loop": true, "EBX": "0x5"}]
diff --git a/test/analysis/dg_test_11_implicit_expected.json b/test/analysis/dg_test_11_implicit_expected.json
new file mode 100644
index 00000000..bd0fbf29
--- /dev/null
+++ b/test/analysis/dg_test_11_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EBX": "0x1", "satisfiability": true, "constraints": {}}, {"has_loop": false, "EBX": "0x3", "satisfiability": true, "constraints": {}}, {"has_loop": true, "EBX": "0x5", "satisfiability": true, "constraints": {}}]
diff --git a/test/samples/x86_32/dg_test_11.S b/test/samples/x86_32/dg_test_11.S
new file mode 100644
index 00000000..ac0edc56
--- /dev/null
+++ b/test/samples/x86_32/dg_test_11.S
@@ -0,0 +1,10 @@
+main:
+	MOV EBX, 0x1
+	JMP lbl1
+lbl1:
+	ADD EBX, 0x2
+	CMP EBX, 0x0
+	JNZ lbl1
+end:
+	MOV EAX, EBX
+	RET
diff --git a/test/test_all.py b/test/test_all.py
index 59624832..c710a8ab 100755
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -315,6 +315,7 @@ test_args = [(0x401000, 0x40100d, ["EAX"]),
              (0x401000, 0x401012, ["ECX"]),
              (0x401000, 0x40101f, ["EAX", "EBX"]),
              (0x401000, 0x401025, ["EAX", "EBX"]),
+             (0x401000, 0x401007, ["EBX"]),
 ]
 for i, test_args in enumerate(test_args):
     test_dg = SemanticTestAsm("x86_32", "PE", ["dg_test_%.2d" % i])