From 6cfc0e80d95abfe4e68b74bd2ab56a0fa185ef32 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 19 May 2022 19:45:38 -0400 Subject: [PATCH] Don't test the unrecognised instruction exception. --- .../Clock SignalTests/68000ComparativeTests.mm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 4f5538c7d..e7417d0ce 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -156,13 +156,12 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { // To limit tests run to a subset of files and/or of tests, uncomment and fill in below. _fileSet = [NSSet setWithArray:@[ - @"eor_and_or.json", - // Below this line are passing tests. + @"eor_and_or.json", @"abcd_sbcd.json", @"nbcd.json", @"ext.json"]]; -// _testSet = [NSSet setWithArray:@[@"CHK 41a8"]]; +// _testSet = [NSSet setWithArray:@[@"EOR b1a1"]]; } - (void)testAll { @@ -251,10 +250,18 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { test68000->processor.set_state(state); } + // Check that this is a defined opcode; capture of the unrecognised instruction + // exception doesn't work correctly with the way that this test class tries + // to detect the gaps between operations. + const uint16_t opcode = (test68000->ram[0x101] << 8) | test68000->ram[0x100]; + if(_decoder.decode(opcode).operation == InstructionSet::M68k::Operation::Undefined) { + return; + } + // Run the thing. const auto comparitor = [=] { const auto state = test68000->processor.get_state(); - const uint16_t opcode = (test68000->ram[0x101] << 8) | test68000->ram[0x100]; + [self test:test name:name compareFinalRegisters:state.registers opcode:opcode]; // Test final memory state.