better state validation
This commit is contained in:
parent
f7f54483c1
commit
115bc084bf
|
@ -598,6 +598,10 @@ bool checkIfTriggerConfigChanged(void) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool readIfTriggerConfigChangedForUnitTest(void) {
|
||||||
|
return isTriggerConfigChanged;
|
||||||
|
}
|
||||||
|
|
||||||
void initTriggerCentral(Logging *sharedLogger) {
|
void initTriggerCentral(Logging *sharedLogger) {
|
||||||
logger = sharedLogger;
|
logger = sharedLogger;
|
||||||
strcpy((char*) shaft_signal_msg_index, "x_");
|
strcpy((char*) shaft_signal_msg_index, "x_");
|
||||||
|
|
|
@ -65,5 +65,6 @@ void resetMaxValues();
|
||||||
|
|
||||||
void onConfigurationChangeTriggerCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void onConfigurationChangeTriggerCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
bool checkIfTriggerConfigChanged(void);
|
bool checkIfTriggerConfigChanged(void);
|
||||||
|
bool readIfTriggerConfigChangedForUnitTest(void);
|
||||||
|
|
||||||
#endif /* TRIGGER_CENTRAL_H_ */
|
#endif /* TRIGGER_CENTRAL_H_ */
|
||||||
|
|
|
@ -632,9 +632,11 @@ void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth) {
|
||||||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
assertEqualsM("CLT", 70, engine->sensors.clt);
|
assertEqualsM("CLT", 70, engine->sensors.clt);
|
||||||
|
assertEqualsM("trigger #1", 0, readIfTriggerConfigChangedForUnitTest());
|
||||||
|
|
||||||
engineConfiguration->trigger.type = TT_ONE;
|
engineConfiguration->trigger.type = TT_ONE;
|
||||||
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
assertEqualsM("trigger #2", 1, readIfTriggerConfigChangedForUnitTest());
|
||||||
|
|
||||||
eth->applyTriggerShape();
|
eth->applyTriggerShape();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue