mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-28 22:29:36 +00:00
Stop after a first mismatch.
This commit is contained in:
parent
318cea4ccd
commit
cc9b6bbc61
@ -41,9 +41,11 @@ struct Chipset {
|
|||||||
NSData *const traceData = [NSData dataWithContentsOfURL:traceURL];
|
NSData *const traceData = [NSData dataWithContentsOfURL:traceURL];
|
||||||
NSArray *const trace = [NSJSONSerialization JSONObjectWithData:traceData options:0 error:nil];
|
NSArray *const trace = [NSJSONSerialization JSONObjectWithData:traceData options:0 error:nil];
|
||||||
|
|
||||||
|
NSUInteger index = -1;
|
||||||
for(NSArray *const event in trace) {
|
for(NSArray *const event in trace) {
|
||||||
NSString *const type = event[0];
|
NSString *const type = event[0];
|
||||||
const NSInteger param1 = [event[1] integerValue];
|
const NSInteger param1 = [event[1] integerValue];
|
||||||
|
++index;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Register writes. Pass straight along.
|
// Register writes. Pass straight along.
|
||||||
@ -179,9 +181,15 @@ struct Chipset {
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
XCTAssertEqual(transaction.type, expected_transaction.type);
|
XCTAssertEqual(transaction.type, expected_transaction.type, @"Type mismatch at index %lu", (unsigned long)index);
|
||||||
XCTAssertEqual(transaction.value, expected_transaction.value);
|
XCTAssertEqual(transaction.value, expected_transaction.value, @"Value mismatch at index %lu", (unsigned long)index);
|
||||||
XCTAssertEqual(transaction.address, expected_transaction.address);
|
XCTAssertEqual(transaction.address, expected_transaction.address, @"Address mismatch at index %lu", (unsigned long)index);
|
||||||
|
if(
|
||||||
|
transaction.type != expected_transaction.type ||
|
||||||
|
transaction.value != expected_transaction.value ||
|
||||||
|
transaction.address != expected_transaction.address) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
did_compare = true;
|
did_compare = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user