1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Add a sanity test count, temporarily.

This commit is contained in:
Thomas Harte 2022-05-11 16:34:28 -04:00
parent a9902fc817
commit 5b80844d81

View File

@ -15,12 +15,14 @@ using namespace InstructionSet::M68k;
@interface M68000flamewingTests : XCTestCase
@end
@implementation M68000flamewingTests
@implementation M68000flamewingTests {
int _testsPerformed;
}
- (Status)statusWithflamewingFlags:(int)flags {
Status status;
status.carry_flag_ = status.extend_flag_ = flags & 2;
status.zero_result_ = ~(flags & 1);
status.zero_result_ = ~flags & 1;
status.negative_flag_ = 0;
status.overflow_flag_ = 0;
return status;
@ -30,6 +32,7 @@ using namespace InstructionSet::M68k;
const uint8_t result_flags = test[0];
const uint8_t result_value = test[1];
++_testsPerformed;
NSString *const testName =
[NSString stringWithFormat:@"%@ %02x, %02x [%c%c]", operation, source, dest, (flags & 2) ? 'X' : '-', (flags & 1) ? 'Z' : '-'];
XCTAssertEqual(result, uint32_t(result_value), @"Wrong value received for %@", testName);
@ -99,6 +102,8 @@ using namespace InstructionSet::M68k;
bytes += 2;
}
}
NSLog(@"%d tests performed", _testsPerformed);
}
@end