diff options
Diffstat (limited to 'tests/format')
-rw-r--r-- | tests/format/program.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/format/program.py b/tests/format/program.py index 7a649b8..7027cdf 100644 --- a/tests/format/program.py +++ b/tests/format/program.py @@ -1,6 +1,7 @@ from chrysacase import ChrysalideTestCase from pychrysalide import SourceEndian +from pychrysalide.analysis.contents import MemoryContent #from pychrysalide.arch import vmpa, mrange from pychrysalide.format import ProgramFormat #from pychrysalide.format import BinSymbol @@ -17,12 +18,16 @@ class TestProgramFormat(ChrysalideTestCase): def testCustomInstance(self): """Validate a full custom ProgramFormat implementation.""" + data = b'\x00\x00\x00\xef' + cnt = MemoryContent(data) + + class CustomFormat(ProgramFormat): def _get_endianness(self): return SourceEndian.BIG - cf = CustomFormat() + cf = CustomFormat(cnt) self.assertEqual(cf.endianness, SourceEndian.BIG) @@ -30,7 +35,7 @@ class TestProgramFormat(ChrysalideTestCase): class EmptyCustomFormat(ProgramFormat): pass - cf = EmptyCustomFormat() + cf = EmptyCustomFormat(cnt) self.assertEqual(cf.endianness, SourceEndian.LITTLE) |