1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Provide more context when JSON decoding fails.

This commit is contained in:
Thomas Harte 2022-08-08 15:18:03 -04:00
parent adf3405e6b
commit f58f7102f7

View File

@ -41,8 +41,9 @@ struct Chipset {
NSString *const tracePath = [[NSBundle bundleForClass:[self class]]
pathForResource:name ofType:@"json.gz" inDirectory:@"Amiga Blitter Tests"];
NSData *const traceData = [NSData dataWithContentsOfGZippedFile:tracePath];
NSArray *const trace = [NSJSONSerialization JSONObjectWithData:traceData options:0 error:nil];
XCTAssertNotNil(trace);
NSError *error;
NSArray *const trace = [NSJSONSerialization JSONObjectWithData:traceData options:0 error:&error];
XCTAssertNotNil(trace, @"JSON decoding failed with error %@", error);
using TransactionType = Amiga::Blitter<true>::Transaction::Type;