1
0

emualtor working

This commit is contained in:
Aiden
2026-05-25 21:00:25 +10:00
parent 3ab79648ff
commit 752148c585
22 changed files with 588 additions and 22 deletions

36
tests/test_consistency.py Normal file
View File

@@ -0,0 +1,36 @@
import unittest
from h8536.consistency import analyze_decompiler_consistency, format_consistency_report
class ConsistencyTest(unittest.TestCase):
def test_flags_byte_immediate_word_destination_cases(self):
payload = {
"instructions": [
{
"address": 0x4067,
"text": "MOV:G.W #H'00, @(-H'0790,R2)",
"mnemonic": "MOV:G.W",
"operands": "#H'00, @(-H'0790,R2)",
},
{
"address": 0x5000,
"text": "MOV:I.W #H'1234, R0",
"mnemonic": "MOV:I.W",
"operands": "#H'1234, R0",
},
],
}
analysis = analyze_decompiler_consistency(payload)
self.assertEqual(len(analysis["checks"]), 1)
check = analysis["checks"][0]
self.assertEqual(check["address"], 0x4067)
self.assertEqual(check["zero_extended_value_hex"], "0x0000")
self.assertIn("zero-extended word", check["summary"])
self.assertIn("H'4067", format_consistency_report(analysis))
if __name__ == "__main__":
unittest.main()