From f58f7102f7aff77366c6cd177f28693a56952c9c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 8 Aug 2022 15:18:03 -0400 Subject: [PATCH] Provide more context when JSON decoding fails. --- OSBindings/Mac/Clock SignalTests/AmigaBlitterTests.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/AmigaBlitterTests.mm b/OSBindings/Mac/Clock SignalTests/AmigaBlitterTests.mm index 0b2ca9453..bb744507b 100644 --- a/OSBindings/Mac/Clock SignalTests/AmigaBlitterTests.mm +++ b/OSBindings/Mac/Clock SignalTests/AmigaBlitterTests.mm @@ -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::Transaction::Type;