diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-01-04 18:50:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-01-04 18:50:07 (GMT) |
commit | b9fe3a839e9212b809d64c11bf92b703adb18fb2 (patch) | |
tree | 86a1c42f305265372bb4d697dad9c99f2ea3715a /tests/format/elf/strings.py | |
parent | 0b2cada60941d109bde2f54a198f4c3a799e0606 (diff) |
Updated the test suite for the current API.
Diffstat (limited to 'tests/format/elf/strings.py')
-rw-r--r-- | tests/format/elf/strings.py | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/format/elf/strings.py b/tests/format/elf/strings.py index 0e09d75..71d365e 100644 --- a/tests/format/elf/strings.py +++ b/tests/format/elf/strings.py @@ -9,6 +9,7 @@ from chrysacase import ChrysalideTestCase from pychrysalide.analysis.contents import FileContent from pychrysalide.analysis import LoadedBinary from pychrysalide.arch import RawInstruction +from pychrysalide.format.elf import ElfFormat from threading import Event import os import sys @@ -27,7 +28,20 @@ class TestElfString(ChrysalideTestCase): fullname = sys.modules[cls.__module__].__file__ dirpath = os.path.dirname(fullname) - os.system('make -C %s strings 2>&1 > /dev/null' % dirpath) + os.system('make -C %s strings > /dev/null 2>&1' % dirpath) + + + @classmethod + def tearDownClass(cls): + + super(TestElfString, cls).tearDownClass() + + cls.log('Delete built binaries...') + + fullname = sys.modules[cls.__module__].__file__ + dirpath = os.path.dirname(fullname) + + os.system('make -C %s clean > /dev/null 2>&1' % dirpath) def testElfStrings(self): @@ -41,19 +55,13 @@ class TestElfString(ChrysalideTestCase): cnt = FileContent(fullname[:baselen] + 'strings') self.assertIsNotNone(cnt) - binary = LoadedBinary(cnt) - self.assertIsNotNone(binary) - - def disass_done(binary): - worker.set() + fmt = ElfFormat(cnt) + self.assertIsInstance(fmt, ElfFormat) - binary.connect('disassembly-done', disass_done) - - worker = Event() - - binary.analyse() + binary = LoadedBinary(fmt) + self.assertIsNotNone(binary) - worker.wait() + binary.analyze_and_wait() expected = { 'hello_arm_str' : False, |