Add tests for LDA with/without checksum on END block
This commit is contained in:
parent
9428e4744a
commit
932fbd9ae2
1 changed files with 20 additions and 9 deletions
29
pdptests.py
29
pdptests.py
|
@ -1759,18 +1759,29 @@ 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:
|
|
||||||
addr = boot.load_lda_f(p, f)
|
endblk_without = [
|
||||||
self.assertEqual(addr, 257) # just "known" from data above
|
1, 0, 6, 0, 1, 1
|
||||||
# this range of addresses and the related data is just "known"
|
]
|
||||||
# from the data bytes above
|
|
||||||
baseaddr = 0x800
|
for tbytes in (ldabytes + endblk_with, ldabytes + endblk_without):
|
||||||
for offset in range(9):
|
with io.BytesIO(bytes(tbytes)) as f:
|
||||||
self.assertEqual(p.mmu.byteRW(baseaddr+offset), offset+1)
|
|
||||||
|
addr = boot.load_lda_f(p, f)
|
||||||
|
self.assertEqual(addr, 257) # just "known" from data above
|
||||||
|
# this range of addresses and the related data is just "known"
|
||||||
|
# from the data bytes above
|
||||||
|
baseaddr = 0x800
|
||||||
|
for offset in range(9):
|
||||||
|
self.assertEqual(p.mmu.byteRW(baseaddr+offset), offset+1)
|
||||||
|
|
||||||
def test_physrw_n(self):
|
def test_physrw_n(self):
|
||||||
p = self.make_pdp()
|
p = self.make_pdp()
|
||||||
|
|
Loading…
Add table
Reference in a new issue