ii-vision/opcodes_test.py
kris 4178c191db Update cycle timing from working ethernet player.
Add _START and _END addresses that are used by the byte stream to
vector the program counter to the next opcode in the stream.

Support equality testing of opcodes and add tests.

Add an ACK opcode for instructing the client to ACK the TCP stream.

Tick opcode now accepts a cycle argument, for experimenting with
audio support.
2019-02-23 23:38:14 +00:00

27 lines
581 B
Python

import unittest
import opcodes
class TestOpcodes(unittest.TestCase):
def test_equality(self):
op1 = opcodes.Terminate()
op2 = opcodes.Terminate()
self.assertEqual(op1, op2)
op1 = opcodes.SetPage(0x20)
op2 = opcodes.SetPage(0x20)
self.assertEqual(op1, op2)
op1 = opcodes.SetPage(0x20)
op2 = opcodes.SetPage(0x21)
self.assertNotEqual(op1, op2)
op1 = opcodes.SetPage(0x20)
op2 = opcodes.Terminate()
self.assertNotEqual(op1, op2)
if __name__ == '__main__':
unittest.main()