diff options
Diffstat (limited to 'tests/arch')
-rw-r--r-- | tests/arch/errors.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/arch/errors.py b/tests/arch/errors.py new file mode 100644 index 0000000..9d5e273 --- /dev/null +++ b/tests/arch/errors.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3-dbg +# -*- coding: utf-8 -*- + + +# Tests minimalistes pour valider la gestion des erreurs relevées. + + +from chrysacase import ChrysalideTestCase +from pychrysalide.arch import vmpa +from pychrysalide.arch import ArchProcessor + + +class TestArchErrors(ChrysalideTestCase): + """TestCase for arch.ArchProcessor errors.""" + + def testBasic(self): + """Perform some sanity tests on architecture error handling.""" + + errlen = 3 + + pattern = [] + + for i in range(errlen): + + addr = vmpa(vmpa.VMPA_NO_PHYSICAL, 0x100 + i * 0x10) + + pattern.append([ArchProcessor.APE_LABEL, addr, 'random desc #%d' % i]) + + proc = ArchProcessor() + + for i in range(errlen): + + proc.add_error(pattern[i][0], pattern[i][1], pattern[i][2]) + + self.assertEqual(len(proc.errors), errlen) |