1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Avoid the repeated .fill; reduces debug-build executor test time to 1.5s.

i.e. eliminates about 95% of costs.
This commit is contained in:
Thomas Harte 2022-05-18 17:10:05 -04:00
parent 13a1809101
commit 44ae084794

View File

@ -135,6 +135,13 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler {
}
- (void)setUp {
// Definitively erase any prior memory contents;
// 0xce is arbitrary but hopefully easier to spot
// in potential errors than e.g. 0x00 or 0xff.
_ram.fill(0xce);
// TODO: possibly, worry about resetting RAM to 0xce after tests have completed.
#ifdef USE_EXECUTOR
_testExecutor = std::make_unique<TestExecutor>(_ram.data());
#endif
@ -217,7 +224,6 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler {
- (void)testOperationClassic:(NSDictionary *)test name:(NSString *)name {
auto uniqueTest68000 = std::make_unique<TestProcessor>(_ram.data());
auto test68000 = uniqueTest68000.get();
_ram.fill(0xce);
{
// Apply initial memory state.
@ -296,11 +302,6 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler {
}
- (void)setInitialState:(NSDictionary *)test {
// Definitively erase any prior memory contents;
// 0xce is arbitrary but hopefully easier to spot
// in potential errors than e.g. 0x00 or 0xff.
_ram.fill(0xce);
// Apply initial memory state.
NSArray<NSNumber *> *const initialMemory = test[@"initial memory"];
NSEnumerator<NSNumber *> *enumerator = [initialMemory objectEnumerator];