From 926e2c55b142df23589822eea0ad327a0bdab39e Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Mon, 10 Aug 2009 16:30:25 -0700 Subject: [PATCH] Fill memory with $AA to prevent false positives with tests expecting $00. --- src/py65/tests/devices/test_mpu6502.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/py65/tests/devices/test_mpu6502.py b/src/py65/tests/devices/test_mpu6502.py index 60e0437..2d7dcc1 100644 --- a/src/py65/tests/devices/test_mpu6502.py +++ b/src/py65/tests/devices/test_mpu6502.py @@ -2096,7 +2096,7 @@ class Common6502Tests: mpu.a = 0xFF mpu.x = 0x03 self._write(mpu.memory, 0x0000, (0xBD, 0xCD, 0xAB)) #=> LDA $ABCD,X - mpu.memory[0xABCD + mpu.y] = 0x00 + mpu.memory[0xABCD + mpu.x] = 0x00 mpu.step() self.assertEquals(0x0003, mpu.pc) self.assertEquals(0x00, mpu.a) @@ -3865,7 +3865,7 @@ class Common6502Tests: mpu.a = 0x00 mpu.y = 0x03 self._write(mpu.memory, 0x0000, (0xF1, 0x10)) #=> SBC ($10),Y - self._write(mpu.memory, 0x0013, (0xED, 0xFE)) #=> Vector to $FEED + self._write(mpu.memory, 0x0010, (0xED, 0xFE)) #=> Vector to $FEED mpu.memory[0xFEED + mpu.y] = 0x00 mpu.step() self.assertEquals(0x00, mpu.a) @@ -4617,7 +4617,10 @@ class Common6502Tests: def _make_mpu(self, *args, **kargs): klass = self._get_target_class() - return klass(*args, **kargs) + mpu = klass(*args, **kargs) + if not kargs.has_key('memory'): + mpu.memory = 0x10000 * [0xAA] + return mpu def _get_target_class(self): raise NotImplementedError, "Target class not specified"