22 lines
711 B
Python
22 lines
711 B
Python
from pathlib import Path
|
|
import sys
|
|
import unittest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT/'tools/binary'))
|
|
from body_step_evidence import collect
|
|
|
|
|
|
class BodyStepEvidenceTests(unittest.TestCase):
|
|
def test_guarded_source_bodies_and_explicit_relocations(self):
|
|
report = collect(ROOT.parent/'Original')
|
|
self.assertEqual(len(report['bodies']), 15)
|
|
operands = report['probe_operands']
|
|
self.assertEqual(len({item['va'] for item in operands}), len(operands))
|
|
targets = {item['target'] for item in operands}
|
|
self.assertTrue({0x4f69e5, 0x5cfc7c, 0x695d54, 0x695d58}.issubset(targets))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|