This commit is contained in:
andreika-git 2019-01-14 18:33:58 +02:00 committed by rusefi
parent 234677df36
commit 32bd383b59
3 changed files with 13 additions and 5 deletions

View File

@ -603,7 +603,6 @@ uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
#if EFI_PROD_CODE || defined(__DOXYGEN__)
efiAssert(CUSTOM_ERR_ASSERT, getRemainingStack(chThdGetSelfX()) > 128, "findPos", -1);
#endif
isInitializingTrigger = true;
errorDetection.clear();
efiAssert(CUSTOM_ERR_ASSERT, state != NULL, "NULL state", -1);
@ -613,6 +612,8 @@ uint32_t findTriggerZeroEventIndex(TriggerState *state, TriggerShape * shape,
return 0;
}
isInitializingTrigger = true;
// todo: should this variable be declared 'static' to reduce stack usage?
TriggerStimulatorHelper helper;

View File

@ -23,12 +23,14 @@ extern float testCltValue;
extern float testIatValue;
extern engine_configuration_s activeConfiguration;
EngineTestHelperBase::EngineTestHelperBase() {
// todo: make this not a global variable, we need currentTimeProvider interface on engine
timeNowUs = 0;
}
EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persistentConfig) {
unitTestWarningCodeState.clear();
// todo: make this not a global variable, we need currentTimeProvider interface on engine
timeNowUs = 0;
testMafValue = 0;
memset(&activeConfiguration, 0, sizeof(activeConfiguration));

View File

@ -13,11 +13,16 @@
#include "main_trigger_callback.h"
#include "unit_test_framework.h"
class EngineTestHelperBase
{
public:
EngineTestHelperBase();
};
/**
* Mock engine with trigger signal simulation infrastructure
*/
class EngineTestHelper {
class EngineTestHelper : public EngineTestHelperBase {
public:
EngineTestHelper(engine_type_e engineType);
void applyTriggerShape();