summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/format/flat.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/format/flat.py b/tests/format/flat.py
new file mode 100644
index 0000000..4ab5aa2
--- /dev/null
+++ b/tests/format/flat.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python3-dbg
+# -*- coding: utf-8 -*-
+
+
+# Tests minimalistes pour valider la gestion des erreurs relevées.
+
+
+from chrysacase import ChrysalideTestCase
+from pychrysalide.analysis import LoadedBinary
+from pychrysalide.analysis.contents import MemoryContent
+from pychrysalide.format import FlatFormat
+
+
+class TestFlatFormat(ChrysalideTestCase):
+ """TestCase for format.FlatFormat."""
+
+
+ def testSimpleFlatFormatContent(self):
+ """Load a simple content for a flat format."""
+
+ data = b'\x00\x00\x00\xef'
+
+ cnt = MemoryContent(data)
+
+ fmt = FlatFormat(cnt)
+ fmt.set_machine('armv7')
+
+ binary = LoadedBinary(fmt)
+
+ binary.analyze_and_wait()
+
+ self.assertTrue(list(binary.processor.instrs)[0].keyword == 'svc')