refactoring unit tests
This commit is contained in:
parent
217b5a3c2b
commit
d4f24f8da8
|
@ -91,8 +91,12 @@ void EngineTestHelper::fireTriggerEvents2(int count, int durationUs) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EngineTestHelper::clearQueue() {
|
||||||
|
engine.iHead = NULL; // let's drop whatever was scheduled just to start from a clean state
|
||||||
|
}
|
||||||
|
|
||||||
void EngineTestHelper::fireTriggerEvents(int count) {
|
void EngineTestHelper::fireTriggerEvents(int count) {
|
||||||
fireTriggerEvents2(count, 5000); // 5ms
|
fireTriggerEvents2(count, MS2US(5)); // 5ms
|
||||||
}
|
}
|
||||||
|
|
||||||
void EngineTestHelper::applyTriggerShape() {
|
void EngineTestHelper::applyTriggerShape() {
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
void firePrimaryTriggerFall();
|
void firePrimaryTriggerFall();
|
||||||
void fireTriggerEvents(int count);
|
void fireTriggerEvents(int count);
|
||||||
void fireTriggerEvents2(int count, int durationUs);
|
void fireTriggerEvents2(int count, int durationUs);
|
||||||
|
void clearQueue();
|
||||||
|
|
||||||
persistent_config_s persistentConfig;
|
persistent_config_s persistentConfig;
|
||||||
Engine engine;
|
Engine engine;
|
||||||
|
|
|
@ -331,7 +331,7 @@ void testRpmCalculator(void) {
|
||||||
|
|
||||||
schedulingQueue.executeAll(99999999); // this is needed to clear 'isScheduled' flag
|
schedulingQueue.executeAll(99999999); // this is needed to clear 'isScheduled' flag
|
||||||
assertEqualsM("queue size/0", 0, schedulingQueue.size());
|
assertEqualsM("queue size/0", 0, schedulingQueue.size());
|
||||||
engine->iHead = NULL; // let's drop whatever was scheduled just to start from a clean state
|
eth.clearQueue();
|
||||||
|
|
||||||
debugSignalExecutor = true;
|
debugSignalExecutor = true;
|
||||||
|
|
||||||
|
@ -618,7 +618,7 @@ void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth) {
|
||||||
Engine *engine = ð->engine;
|
Engine *engine = ð->engine;
|
||||||
EXPAND_Engine
|
EXPAND_Engine
|
||||||
|
|
||||||
engine->iHead = NULL; // let's drop whatever was scheduled just to start from a clean state
|
eth->clearQueue();
|
||||||
|
|
||||||
assertEquals(LM_PLAIN_MAF, engineConfiguration->fuelAlgorithm);
|
assertEquals(LM_PLAIN_MAF, engineConfiguration->fuelAlgorithm);
|
||||||
engineConfiguration->isIgnitionEnabled = false; // let's focus on injection
|
engineConfiguration->isIgnitionEnabled = false; // let's focus on injection
|
||||||
|
@ -656,7 +656,7 @@ static void setTestBug299(EngineTestHelper *eth) {
|
||||||
assertEqualsM("RPM#2", 3000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
assertEqualsM("RPM#2", 3000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||||
|
|
||||||
schedulingQueue.executeAll(99999999); // this is needed to clear 'isScheduled' flag
|
schedulingQueue.executeAll(99999999); // this is needed to clear 'isScheduled' flag
|
||||||
engine->iHead = NULL; // let's drop whatever was scheduled just to start from a clean state
|
eth->clearQueue();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger up - scheduling fuel for full engine cycle
|
* Trigger up - scheduling fuel for full engine cycle
|
||||||
|
|
Loading…
Reference in New Issue