From 8ddf20b36a170e8b968a1a08704b38fb65f21fef Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 25 Oct 2022 22:33:25 -0400 Subject: [PATCH] Provide cleaner output. --- OSBindings/Mac/Clock SignalTests/68000DecoderTests.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock SignalTests/68000DecoderTests.mm b/OSBindings/Mac/Clock SignalTests/68000DecoderTests.mm index f67567f27..e747cfdb8 100644 --- a/OSBindings/Mac/Clock SignalTests/68000DecoderTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000DecoderTests.mm @@ -28,6 +28,8 @@ template void test(NSString *filename, Class cls) { NSDictionary *const decodings = [NSJSONSerialization JSONObjectWithData:testData options:0 error:nil]; XCTAssertNotNil(decodings); + NSMutableArray *failures = [[NSMutableArray alloc] init]; + Predecoder decoder; for(int instr = 0; instr < 65536; instr++) { NSString *const instrName = [NSString stringWithFormat:@"%04x", instr]; @@ -37,7 +39,14 @@ template void test(NSString *filename, Class cls) { const auto found = decoder.decode(uint16_t(instr)); NSString *const instruction = [NSString stringWithUTF8String:found.to_string(instr).c_str()]; - XCTAssertEqualObjects(instruction, expected, "%@ should decode as %@; got %@", instrName, expected, instruction); + if(![instruction isEqualToString:expected]) { + [failures addObject:[NSString stringWithFormat:@"%@ should decode as %@; got %@", instrName, expected, instruction]]; + } + } + + XCTAssertEqual([failures count], 0); + if([failures count]) { + NSLog(@"%@", failures); } }