about summary refs log tree commit diff stats
path: root/test/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'test/analysis')
-rw-r--r--test/analysis/dg_check.py20
-rw-r--r--test/analysis/dg_test_00_expected.json1
-rw-r--r--test/analysis/dg_test_00_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_01_expected.json1
-rw-r--r--test/analysis/dg_test_01_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_02_expected.json1
-rw-r--r--test/analysis/dg_test_02_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_03_expected.json1
-rw-r--r--test/analysis/dg_test_03_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_04_expected.json1
-rw-r--r--test/analysis/dg_test_04_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_05_expected.json1
-rw-r--r--test/analysis/dg_test_05_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_06_expected.json1
-rw-r--r--test/analysis/dg_test_06_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_07_expected.json1
-rw-r--r--test/analysis/dg_test_07_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_08_expected.json1
-rw-r--r--test/analysis/dg_test_08_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_09_expected.json2
-rw-r--r--test/analysis/dg_test_09_implicit_expected.json1
-rw-r--r--test/analysis/dg_test_10_expected.json1
-rw-r--r--test/analysis/dg_test_10_implicit_expected.json1
23 files changed, 43 insertions, 0 deletions
diff --git a/test/analysis/dg_check.py b/test/analysis/dg_check.py
new file mode 100644
index 00000000..0d680b6f
--- /dev/null
+++ b/test/analysis/dg_check.py
@@ -0,0 +1,20 @@
+from pdb import pm
+import sys
+import subprocess
+import json
+
+
+expected_file = sys.argv[1]
+dg = subprocess.Popen(["python"] + sys.argv[2:], stdout=subprocess.PIPE)
+
+stdout, _ = dg.communicate()
+expected = json.load(open(expected_file))
+result = json.loads(stdout)
+
+
+expected.sort()
+result.sort()
+
+print expected
+print result
+assert expected == result
diff --git a/test/analysis/dg_test_00_expected.json b/test/analysis/dg_test_00_expected.json
new file mode 100644
index 00000000..cae8b582
--- /dev/null
+++ b/test/analysis/dg_test_00_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x1", "has_loop": false}]
diff --git a/test/analysis/dg_test_00_implicit_expected.json b/test/analysis/dg_test_00_implicit_expected.json
new file mode 100644
index 00000000..186704d0
--- /dev/null
+++ b/test/analysis/dg_test_00_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x1", "satisfiability": true, "constraints": {}}]
diff --git a/test/analysis/dg_test_01_expected.json b/test/analysis/dg_test_01_expected.json
new file mode 100644
index 00000000..724d74a3
--- /dev/null
+++ b/test/analysis/dg_test_01_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x3", "has_loop": false}]
diff --git a/test/analysis/dg_test_01_implicit_expected.json b/test/analysis/dg_test_01_implicit_expected.json
new file mode 100644
index 00000000..2edb5ede
--- /dev/null
+++ b/test/analysis/dg_test_01_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x3", "satisfiability": true, "constraints": {}}]
diff --git a/test/analysis/dg_test_02_expected.json b/test/analysis/dg_test_02_expected.json
new file mode 100644
index 00000000..16d409fb
--- /dev/null
+++ b/test/analysis/dg_test_02_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x3", "has_loop": false}, {"EAX": "0x4", "has_loop": false}]
diff --git a/test/analysis/dg_test_02_implicit_expected.json b/test/analysis/dg_test_02_implicit_expected.json
new file mode 100644
index 00000000..9394f01d
--- /dev/null
+++ b/test/analysis/dg_test_02_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x4", "satisfiability": true, "constraints": {"zf_init": "0x1"}}, {"has_loop": false, "EAX": "0x3", "satisfiability": true, "constraints": {"zf_init": "0x0"}}]
diff --git a/test/analysis/dg_test_03_expected.json b/test/analysis/dg_test_03_expected.json
new file mode 100644
index 00000000..9d0dfdbd
--- /dev/null
+++ b/test/analysis/dg_test_03_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x3", "has_loop": false}, {"EAX": "0x5", "has_loop": true}]
diff --git a/test/analysis/dg_test_03_implicit_expected.json b/test/analysis/dg_test_03_implicit_expected.json
new file mode 100644
index 00000000..9f7ddea0
--- /dev/null
+++ b/test/analysis/dg_test_03_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x3", "satisfiability": false, "constraints": {}}, {"has_loop": true, "EAX": "0x5", "satisfiability": false, "constraints": {}}]
diff --git a/test/analysis/dg_test_04_expected.json b/test/analysis/dg_test_04_expected.json
new file mode 100644
index 00000000..fb115835
--- /dev/null
+++ b/test/analysis/dg_test_04_expected.json
@@ -0,0 +1 @@
+[{"EAX": "EBX_init", "has_loop": false}]
diff --git a/test/analysis/dg_test_04_implicit_expected.json b/test/analysis/dg_test_04_implicit_expected.json
new file mode 100644
index 00000000..73e7209e
--- /dev/null
+++ b/test/analysis/dg_test_04_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "EBX_init", "satisfiability": true, "constraints": {}}, {"has_loop": true, "EAX": "EBX_init", "satisfiability": false, "constraints": {}}]
diff --git a/test/analysis/dg_test_05_expected.json b/test/analysis/dg_test_05_expected.json
new file mode 100644
index 00000000..724d74a3
--- /dev/null
+++ b/test/analysis/dg_test_05_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x3", "has_loop": false}]
diff --git a/test/analysis/dg_test_05_implicit_expected.json b/test/analysis/dg_test_05_implicit_expected.json
new file mode 100644
index 00000000..ef39008f
--- /dev/null
+++ b/test/analysis/dg_test_05_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x3", "satisfiability": true, "constraints": {}}, {"has_loop": true, "EAX": "0x3", "satisfiability": false, "constraints": {}}]
diff --git a/test/analysis/dg_test_06_expected.json b/test/analysis/dg_test_06_expected.json
new file mode 100644
index 00000000..7d823131
--- /dev/null
+++ b/test/analysis/dg_test_06_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x1", "has_loop": false}, {"EAX": "0x2", "has_loop": true}]
diff --git a/test/analysis/dg_test_06_implicit_expected.json b/test/analysis/dg_test_06_implicit_expected.json
new file mode 100644
index 00000000..050915c1
--- /dev/null
+++ b/test/analysis/dg_test_06_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x1", "satisfiability": true, "constraints": {"EAX_init": "0xffffffff"}}, {"has_loop": true, "EAX": "0x2", "satisfiability": false, "constraints": {}}]
diff --git a/test/analysis/dg_test_07_expected.json b/test/analysis/dg_test_07_expected.json
new file mode 100644
index 00000000..0ed0be95
--- /dev/null
+++ b/test/analysis/dg_test_07_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x1", "ECX": "0x2", "has_loop": false}]
diff --git a/test/analysis/dg_test_07_implicit_expected.json b/test/analysis/dg_test_07_implicit_expected.json
new file mode 100644
index 00000000..4f8c782a
--- /dev/null
+++ b/test/analysis/dg_test_07_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x1", "constraints": {}, "satisfiability": true, "ECX": "0x2"}]
diff --git a/test/analysis/dg_test_08_expected.json b/test/analysis/dg_test_08_expected.json
new file mode 100644
index 00000000..b4c379d1
--- /dev/null
+++ b/test/analysis/dg_test_08_expected.json
@@ -0,0 +1 @@
+[{"ECX": "0x2", "has_loop": false}]
diff --git a/test/analysis/dg_test_08_implicit_expected.json b/test/analysis/dg_test_08_implicit_expected.json
new file mode 100644
index 00000000..a0416a4e
--- /dev/null
+++ b/test/analysis/dg_test_08_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "constraints": {}, "satisfiability": true, "ECX": "0x2"}]
diff --git a/test/analysis/dg_test_09_expected.json b/test/analysis/dg_test_09_expected.json
new file mode 100644
index 00000000..ba0e4673
--- /dev/null
+++ b/test/analysis/dg_test_09_expected.json
@@ -0,0 +1,2 @@
+[{"EAX": "0x1", "EBX": "0x2", "has_loop": false},
+ {"EAX": "0x3", "EBX": "0x4", "has_loop": false}]
diff --git a/test/analysis/dg_test_09_implicit_expected.json b/test/analysis/dg_test_09_implicit_expected.json
new file mode 100644
index 00000000..1ea2976f
--- /dev/null
+++ b/test/analysis/dg_test_09_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x1", "EBX": "0x2", "satisfiability": true, "constraints": {}}, {"has_loop": false, "EAX": "0x3", "EBX": "0x4", "satisfiability": true, "constraints": {}}]
diff --git a/test/analysis/dg_test_10_expected.json b/test/analysis/dg_test_10_expected.json
new file mode 100644
index 00000000..720b85e2
--- /dev/null
+++ b/test/analysis/dg_test_10_expected.json
@@ -0,0 +1 @@
+[{"EAX": "0x1", "EBX": "0x3", "has_loop": false}, {"EAX": "0x1", "EBX": "0x4", "has_loop": false}, {"EAX": "0x2", "EBX": "0x4", "has_loop": false}, {"EAX": "0x2", "EBX": "0x3", "has_loop": false}]
diff --git a/test/analysis/dg_test_10_implicit_expected.json b/test/analysis/dg_test_10_implicit_expected.json
new file mode 100644
index 00000000..05b34918
--- /dev/null
+++ b/test/analysis/dg_test_10_implicit_expected.json
@@ -0,0 +1 @@
+[{"has_loop": false, "EAX": "0x1", "EBX": "0x3", "satisfiability": true, "constraints": {"zf_init": "0x0"}}, {"has_loop": false, "EAX": "0x2", "EBX": "0x3", "satisfiability": false, "constraints": {}}, {"has_loop": false, "EAX": "0x1", "EBX": "0x4", "satisfiability": false, "constraints": {}}, {"has_loop": false, "EAX": "0x2", "EBX": "0x4", "satisfiability": true, "constraints": {"zf_init": "0x1"}}]