From b73b0809833adfb20250b1250953fda1253a3b75 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Tue, 7 Apr 2009 22:14:19 -0700 Subject: [PATCH] Assert that decorated addressing modes are valid. --- src/py65/tests/devices/test_mpu6502.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/py65/tests/devices/test_mpu6502.py b/src/py65/tests/devices/test_mpu6502.py index b0fe794..62e8a2d 100644 --- a/src/py65/tests/devices/test_mpu6502.py +++ b/src/py65/tests/devices/test_mpu6502.py @@ -1,5 +1,6 @@ import unittest import sys +import py65.assembler import py65.devices.mpu6502 class Common6502Tests: @@ -4579,6 +4580,14 @@ class Common6502Tests: self.assertEquals(mpu.ZERO, mpu.flags & mpu.ZERO) self.assertEquals(0x0001, mpu.pc) + def test_decorated_addressing_modes_are_valid(self): + valid_modes = map(lambda x: x[0], + py65.assembler.Assembler.Addressing) + mpu = self._make_mpu() + for name, mode in mpu.disassemble: + self.assert_(mode in valid_modes) + + # Test Helpers def _write(self, memory, start_address, bytes):