mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2024-12-30 15:29:26 +00:00
Fix tests
This commit is contained in:
parent
13fb9c3125
commit
dd422d1156
@ -11,16 +11,35 @@ class TestOpcodes(unittest.TestCase):
|
||||
op2 = opcodes.Terminate()
|
||||
self.assertEqual(op1, op2)
|
||||
|
||||
op1 = opcodes.SetPage(0x20)
|
||||
op2 = opcodes.SetPage(0x20)
|
||||
op1 = opcodes.Nop()
|
||||
op2 = opcodes.Nop()
|
||||
self.assertEqual(op1, op2)
|
||||
|
||||
op1 = opcodes.SetPage(0x20)
|
||||
op2 = opcodes.SetPage(0x21)
|
||||
op1 = opcodes.Ack()
|
||||
op2 = opcodes.Ack()
|
||||
self.assertEqual(op1, op2)
|
||||
|
||||
op1 = opcodes.Ack()
|
||||
op2 = opcodes.Nop()
|
||||
self.assertNotEqual(op1, op2)
|
||||
|
||||
op1 = opcodes.SetPage(0x20)
|
||||
op2 = opcodes.Terminate()
|
||||
op1 = opcodes.TICK_OPCODES[(4, 32)](0xff, [0x01, 0x02, 0x03, 0x04])
|
||||
op2 = opcodes.TICK_OPCODES[(4, 32)](0xff, [0x01, 0x02, 0x03, 0x04])
|
||||
self.assertEqual(op1, op2)
|
||||
|
||||
# op2 has same payload but different opcode
|
||||
op1 = opcodes.TICK_OPCODES[(4, 32)](0xff, [0x01, 0x02, 0x03, 0x04])
|
||||
op2 = opcodes.TICK_OPCODES[(6, 32)](0xff, [0x01, 0x02, 0x03, 0x04])
|
||||
self.assertNotEqual(op1, op2)
|
||||
|
||||
# op2 has different content byte
|
||||
op1 = opcodes.TICK_OPCODES[(4, 32)](0xff, [0x01, 0x02, 0x03, 0x04])
|
||||
op2 = opcodes.TICK_OPCODES[(4, 32)](0xfe, [0x01, 0x02, 0x03, 0x04])
|
||||
self.assertNotEqual(op1, op2)
|
||||
|
||||
# op2 has different offsets
|
||||
op1 = opcodes.TICK_OPCODES[(4, 32)](0xff, [0x01, 0x02, 0x03, 0x04])
|
||||
op2 = opcodes.TICK_OPCODES[(4, 32)](0xff, [0x01, 0x02, 0x03, 0x05])
|
||||
self.assertNotEqual(op1, op2)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user