Add tests for LDA with/without checksum on END block

This commit is contained in:
Neil Webber 2024-05-08 18:00:27 -05:00
parent 9428e4744a
commit 932fbd9ae2

View file

@ -1759,11 +1759,22 @@ class TestMethods(unittest.TestCase):
1, 0, 9, 0, 6, 8, # testing lack of zero skip 1, 0, 9, 0, 6, 8, # testing lack of zero skip
7, 8, 9, 7, 8, 9,
208, 208,
]
# the END block # test two variations of the END block, with and without checksum
# The docs say no checksum is present so it never really gets read
# if it is there (so the harder test is if it is not there)
endblk_with = [
1, 0, 6, 0, 1, 1, 247 1, 0, 6, 0, 1, 1, 247
] ]
with io.BytesIO(bytes(ldabytes)) as f:
endblk_without = [
1, 0, 6, 0, 1, 1
]
for tbytes in (ldabytes + endblk_with, ldabytes + endblk_without):
with io.BytesIO(bytes(tbytes)) as f:
addr = boot.load_lda_f(p, f) addr = boot.load_lda_f(p, f)
self.assertEqual(addr, 257) # just "known" from data above self.assertEqual(addr, 257) # just "known" from data above
# this range of addresses and the related data is just "known" # this range of addresses and the related data is just "known"