diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-01-22 18:28:36 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-01-22 18:34:46 (GMT) |
commit | c1bcf3e7bd0a256005bd15832117b78cee5fdfab (patch) | |
tree | 54188ab3933526ca79ae3e8f86dd99adad49e681 /tests/arch | |
parent | 3a8bc79d69acae3735cc0203b54d93b4137caa09 (diff) |
Allowed to initialize instances of created dynamic types if needed.
Diffstat (limited to 'tests/arch')
-rw-r--r-- | tests/arch/errors.py | 13 | ||||
-rw-r--r-- | tests/arch/processor.py | 13 |
2 files changed, 24 insertions, 2 deletions
diff --git a/tests/arch/errors.py b/tests/arch/errors.py index 8affb77..e57b94b 100644 --- a/tests/arch/errors.py +++ b/tests/arch/errors.py @@ -6,6 +6,7 @@ from chrysacase import ChrysalideTestCase +from pychrysalide import arch from pychrysalide.arch import vmpa from pychrysalide.arch import ArchProcessor @@ -28,7 +29,17 @@ class TestArchErrors(ChrysalideTestCase): class NewProc(ArchProcessor): - pass + + def __init__(self): + + props = { + 'endianness': arch.SRE_LITTLE, + 'mem_size': arch.MDS_32_BITS_UNSIGNED, + 'ins_min_size': arch.MDS_32_BITS_UNSIGNED, + 'vspace': False + } + + super(NewProc, self).__init__(**props) proc = NewProc() diff --git a/tests/arch/processor.py b/tests/arch/processor.py index 97a713d..bf17b98 100644 --- a/tests/arch/processor.py +++ b/tests/arch/processor.py @@ -5,13 +5,13 @@ import pychrysalide from chrysacase import ChrysalideTestCase from pychrysalide.analysis.contents import MemoryContent +from pychrysalide import arch from pychrysalide.arch import ArchProcessor from pychrysalide.arch import ProcContext from pychrysalide.arch import vmpa from pychrysalide.format import FlatFormat - class TestProcessor(ChrysalideTestCase): """TestCase for arch.ArchProcessor.""" @@ -28,6 +28,17 @@ class TestProcessor(ChrysalideTestCase): class NewProcWithCtx(ArchProcessor): + def __init__(self): + + props = { + 'endianness': arch.SRE_LITTLE, + 'mem_size': arch.MDS_32_BITS_UNSIGNED, + 'ins_min_size': arch.MDS_32_BITS_UNSIGNED, + 'vspace': False + } + + super(NewProcWithCtx, self).__init__(**props) + def _get_context(self): return NewContext() |