refactoring
This commit is contained in:
parent
3b8ea5311b
commit
010099aa0d
|
@ -23,7 +23,6 @@ extern float testMafValue;
|
|||
extern engine_configuration_s activeConfiguration;
|
||||
|
||||
EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persistentConfig) {
|
||||
ec = &persistentConfig.engineConfiguration;
|
||||
unitTestWarningCounter = 0;
|
||||
|
||||
testMafValue = 0;
|
||||
|
@ -32,8 +31,9 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste
|
|||
schedulingQueue.clear();
|
||||
enginePins.reset();
|
||||
|
||||
engineConfiguration = ec;
|
||||
board_configuration_s * boardConfiguration = &engineConfiguration->bc;
|
||||
Engine *engine = &this->engine;
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
board_configuration_s * boardConfiguration = &persistentConfig.engineConfiguration.bc;
|
||||
persistent_config_s *config = &persistentConfig;
|
||||
|
||||
setCurveValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
|
||||
|
@ -49,7 +49,6 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste
|
|||
setCurveValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 60, 1.03);
|
||||
setCurveValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 70, 1.01);
|
||||
|
||||
Engine *engine = &this->engine;
|
||||
prepareFuelMap(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
initAccelEnrichment(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
@ -65,8 +64,6 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste
|
|||
engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
prepareTimingMap(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
|
||||
engine->triggerCentral.triggerShape.initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
engine->triggerCentral.addEventListener(rpmShaftPositionCallback, "rpm reporter", engine);
|
||||
engine->triggerCentral.addEventListener(mainTriggerCallback, "main loop", engine);
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
#include "main_trigger_callback.h"
|
||||
#include "unit_test_framework.h"
|
||||
|
||||
/**
|
||||
* Mock engine with trigger signal simulation infrastructure
|
||||
*/
|
||||
class EngineTestHelper {
|
||||
public:
|
||||
EngineTestHelper(engine_type_e engineType);
|
||||
|
@ -23,11 +26,8 @@ public:
|
|||
void fireTriggerEvents2(int count, int durationUs);
|
||||
void clearQueue();
|
||||
|
||||
persistent_config_s persistentConfig;
|
||||
Engine engine;
|
||||
|
||||
engine_configuration_s *ec;
|
||||
engine_configuration_s *engineConfiguration;
|
||||
persistent_config_s persistentConfig;
|
||||
};
|
||||
|
||||
#endif /* ENGINE_TEST_HELPER_H_ */
|
||||
|
|
|
@ -26,7 +26,7 @@ void testSpeedDensity(void) {
|
|||
assertEqualsM("RPM", 1500, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
// 427 cubic inches, that's a LOT of engine
|
||||
engineConfigurationc->specs.displacement = 6.99728;
|
||||
engineConfiguration->specs.displacement = 6.99728;
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
|
||||
engineConfiguration->injector.flow = gramm_second_to_cc_minute(5.303);
|
||||
|
|
Loading…
Reference in New Issue