mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-23 21:29:11 +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:
parent
13a1809101
commit
44ae084794
@ -135,6 +135,13 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)setUp {
|
- (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
|
#ifdef USE_EXECUTOR
|
||||||
_testExecutor = std::make_unique<TestExecutor>(_ram.data());
|
_testExecutor = std::make_unique<TestExecutor>(_ram.data());
|
||||||
#endif
|
#endif
|
||||||
@ -217,7 +224,6 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler {
|
|||||||
- (void)testOperationClassic:(NSDictionary *)test name:(NSString *)name {
|
- (void)testOperationClassic:(NSDictionary *)test name:(NSString *)name {
|
||||||
auto uniqueTest68000 = std::make_unique<TestProcessor>(_ram.data());
|
auto uniqueTest68000 = std::make_unique<TestProcessor>(_ram.data());
|
||||||
auto test68000 = uniqueTest68000.get();
|
auto test68000 = uniqueTest68000.get();
|
||||||
_ram.fill(0xce);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Apply initial memory state.
|
// Apply initial memory state.
|
||||||
@ -296,11 +302,6 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)setInitialState:(NSDictionary *)test {
|
- (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.
|
// Apply initial memory state.
|
||||||
NSArray<NSNumber *> *const initialMemory = test[@"initial memory"];
|
NSArray<NSNumber *> *const initialMemory = test[@"initial memory"];
|
||||||
NSEnumerator<NSNumber *> *enumerator = [initialMemory objectEnumerator];
|
NSEnumerator<NSNumber *> *enumerator = [initialMemory objectEnumerator];
|
||||||
|
Loading…
Reference in New Issue
Block a user