1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 01:31:42 +00:00

Add first pass at testing shadowing.

This commit is contained in:
Thomas Harte 2022-06-28 17:12:25 -04:00
parent 4e52572b03
commit f5d56cc473

View File

@ -371,6 +371,26 @@ namespace {
return;
}
});
// Test shadowed regions.
bool shadowed = false;
int logical = 0;
for(NSNumber *next in test[@"shadowed"]) {
while(logical < [next intValue]) {
const auto &region =
self->_memoryMap.regions[self->_memoryMap.region_map[logical]];
const bool isShadowed =
IsShadowed(_memoryMap, region, (logical << 8));
XCTAssertEqual(
isShadowed,
shadowed,
@"Logical page %04x %@ subject to shadowing", logical, shadowed ? @"should be" : @"should not be");
++logical;
}
shadowed ^= true;
}
}];
}