reducing global variables in tests
This commit is contained in:
parent
3921d36540
commit
8a2494a646
|
@ -111,6 +111,14 @@ void EngineTestHelper::clearQueue() {
|
|||
engine.iHead = NULL; // let's drop whatever was scheduled just to start from a clean state
|
||||
}
|
||||
|
||||
void EngineTestHelper::executeActions() {
|
||||
engine.executor.executeAll(timeNowUs);
|
||||
}
|
||||
|
||||
void EngineTestHelper::moveTimeForwardUs(int deltaTimeUs) {
|
||||
timeNowUs += deltaTimeUs;
|
||||
}
|
||||
|
||||
void EngineTestHelper::fireTriggerEvents(int count) {
|
||||
fireTriggerEvents2(count, 5); // 5ms
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ public:
|
|||
void fireTriggerEvents2(int count, int delayMs);
|
||||
void clearQueue();
|
||||
|
||||
void executeActions();
|
||||
void moveTimeForwardUs(int deltaTimeUs);
|
||||
|
||||
Engine engine;
|
||||
persistent_config_s persistentConfig;
|
||||
};
|
||||
|
|
|
@ -1171,8 +1171,8 @@ void testFuelSchedulerBug299smallAndLarge(void) {
|
|||
assertInjectorUpEvent("L05@2", 2, MS2US(18), 1 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
assertInjectorDownEvent("L05@3", 3, MS2US(20), 1 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
timeNowUs += MS2US(20);
|
||||
engine->executor.executeAll(timeNowUs);
|
||||
eth.moveTimeForwardUs(MS2US(20));
|
||||
eth.executeActions();
|
||||
}
|
||||
|
||||
void testSparkReverseOrderBug319(void) {
|
||||
|
|
Loading…
Reference in New Issue