From 415b3d55df15220119f54c76d3f2511f789d207c Mon Sep 17 00:00:00 2001 From: rusefi Date: Thu, 1 Jun 2023 01:31:28 -0400 Subject: [PATCH] Technical debt: ENUM_32_BITS #3874 poking the bear --- unit_tests/native/native_impl.cpp | 2 +- unit_tests/tests/actuators/test_antilag.cpp | 2 +- .../tests/actuators/test_aux_valves.cpp | 2 +- unit_tests/tests/actuators/test_boost.cpp | 10 +-- unit_tests/tests/actuators/test_etb.cpp | 46 ++++++------- .../tests/actuators/test_etb_integrated.cpp | 10 +-- .../tests/actuators/test_fan_control.cpp | 2 +- unit_tests/tests/actuators/test_fuel_pump.cpp | 2 +- unit_tests/tests/actuators/test_gppwm.cpp | 2 +- .../tests/actuators/test_main_relay.cpp | 2 +- unit_tests/tests/actuators/test_tacho.cpp | 2 +- unit_tests/tests/actuators/test_vvt.cpp | 8 +-- .../injection_mode_transition.cpp | 2 +- .../test_dwell_corner_case_issue_796.cpp | 2 +- .../tests/ignition_injection/test_fuelCut.cpp | 4 +- .../ignition_injection/test_fuel_computer.cpp | 4 +- .../ignition_injection/test_fuel_map.cpp | 4 +- .../ignition_injection/test_fuel_math.cpp | 20 +++--- .../test_fuel_wall_wetting.cpp | 4 +- .../test_ignition_scheduling.cpp | 6 +- .../test_injector_model.cpp | 22 +++--- .../ignition_injection/test_multispark.cpp | 6 +- .../test_one_cylinder_logic.cpp | 2 +- .../test_startOfCrankingPrimingPulse.cpp | 6 +- unit_tests/tests/lua/test_lookup.cpp | 2 +- unit_tests/tests/lua/test_lua_hooks.cpp | 6 +- unit_tests/tests/lua/test_lua_vin.cpp | 2 +- unit_tests/tests/lua/test_lua_with_engine.cpp | 2 +- .../tests/sensor/test_frequency_sensor.cpp | 2 +- unit_tests/tests/sensor/test_sensor_init.cpp | 18 ++--- .../test_turbocharger_speed_converter.cpp | 2 +- .../sensor/test_vehicle_speed_converter.cpp | 2 +- unit_tests/tests/test_accel_enrichment.cpp | 6 +- unit_tests/tests/test_can_serial.cpp | 2 +- unit_tests/tests/test_can_wideband.cpp | 4 +- unit_tests/tests/test_change_engine_type.cpp | 4 +- unit_tests/tests/test_dynoview.cpp | 8 +-- unit_tests/tests/test_engine_math.cpp | 4 +- unit_tests/tests/test_gear_detector.cpp | 14 ++-- unit_tests/tests/test_gpio.cpp | 4 +- unit_tests/tests/test_hardware_reinit.cpp | 6 +- unit_tests/tests/test_hpfp.cpp | 10 +-- unit_tests/tests/test_hpfp_integrated.cpp | 2 +- unit_tests/tests/test_idle_controller.cpp | 34 +++++----- unit_tests/tests/test_knock.cpp | 4 +- unit_tests/tests/test_launch.cpp | 12 ++-- unit_tests/tests/test_limp.cpp | 14 ++-- unit_tests/tests/test_start_stop.cpp | 2 +- unit_tests/tests/test_stft.cpp | 2 +- unit_tests/tests/test_tunerstudio.cpp | 2 +- unit_tests/tests/trigger/test_2jz_vvt.cpp | 2 +- .../tests/trigger/test_cam_vvt_input.cpp | 10 +-- .../trigger/test_fasterEngineSpinningUp.cpp | 4 +- .../trigger/test_injection_scheduling.cpp | 8 +-- unit_tests/tests/trigger/test_map_cam.cpp | 2 +- .../tests/trigger/test_miata_na_tdc.cpp | 2 +- .../tests/trigger/test_nissan_vq_vvt.cpp | 2 +- .../tests/trigger/test_override_gaps.cpp | 2 +- unit_tests/tests/trigger/test_quad_cam.cpp | 2 +- unit_tests/tests/trigger/test_real_4b11.cpp | 4 +- unit_tests/tests/trigger/test_real_4g93.cpp | 6 +- .../trigger/test_real_cranking_miata_NA.cpp | 2 +- .../trigger/test_real_cranking_miata_na6.cpp | 4 +- .../test_real_cranking_nissan_vq40.cpp | 2 +- unit_tests/tests/trigger/test_real_gm_24x.cpp | 2 +- unit_tests/tests/trigger/test_real_k20.cpp | 2 +- unit_tests/tests/trigger/test_real_k24a2.cpp | 2 +- .../tests/trigger/test_real_nb2_cranking.cpp | 4 +- .../tests/trigger/test_real_volkswagen.cpp | 4 +- .../tests/trigger/test_rpm_multiplier.cpp | 2 +- .../tests/trigger/test_symmetrical_crank.cpp | 4 +- .../tests/trigger/test_trigger_decoder.cpp | 68 +++++++++---------- .../tests/trigger/test_trigger_input_adc.cpp | 2 +- .../tests/trigger/test_trigger_noiseless.cpp | 2 +- .../trigger/test_trigger_skipped_wheel.cpp | 2 +- unit_tests/tests/util/test_timer.cpp | 2 +- 76 files changed, 245 insertions(+), 245 deletions(-) diff --git a/unit_tests/native/native_impl.cpp b/unit_tests/native/native_impl.cpp index cf9f23d0a3..4511ac9f1a 100644 --- a/unit_tests/native/native_impl.cpp +++ b/unit_tests/native/native_impl.cpp @@ -19,7 +19,7 @@ static std::unique_ptr ethPtr; static EngineTestHelper* getEth() { if (!ethPtr) { printf("make_unique(TEST_ENGINE)\n"); - ethPtr = std::make_unique(TEST_ENGINE); + ethPtr = std::make_unique(engine_type_e::TEST_ENGINE); } return ethPtr.get(); } diff --git a/unit_tests/tests/actuators/test_antilag.cpp b/unit_tests/tests/actuators/test_antilag.cpp index 7d53ed7bd7..88f8383d4e 100644 --- a/unit_tests/tests/actuators/test_antilag.cpp +++ b/unit_tests/tests/actuators/test_antilag.cpp @@ -2,7 +2,7 @@ #include "fuel_math.h" TEST(Actuators, AntiLag) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->antiLagEnabled = true; diff --git a/unit_tests/tests/actuators/test_aux_valves.cpp b/unit_tests/tests/actuators/test_aux_valves.cpp index a6d9b196ff..46413bd083 100644 --- a/unit_tests/tests/actuators/test_aux_valves.cpp +++ b/unit_tests/tests/actuators/test_aux_valves.cpp @@ -12,7 +12,7 @@ TEST(Actuators, AuxValves) { Sensor::setMockValue(SensorType::DriverThrottleIntent, 0); - EngineTestHelper eth(NISSAN_PRIMERA); + EngineTestHelper eth(engine_type_e::NISSAN_PRIMERA); // Engine must be "spinning" for scheduleByAngle to work engine->rpmCalculator.setRpmValue(1000); diff --git a/unit_tests/tests/actuators/test_boost.cpp b/unit_tests/tests/actuators/test_boost.cpp index 0fa34fbfc3..d48a6d2d18 100644 --- a/unit_tests/tests/actuators/test_boost.cpp +++ b/unit_tests/tests/actuators/test_boost.cpp @@ -12,7 +12,7 @@ TEST(BoostControl, Setpoint) { EXPECT_CALL(targetMap, getValue(_, _)) .WillRepeatedly([](float xRpm, float tps) { return tps; }); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->boostType = CLOSED_LOOP; BoostController bc; @@ -32,7 +32,7 @@ TEST(BoostControl, Setpoint) { } TEST(BoostControl, ObservePlant) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); BoostController bc; @@ -53,7 +53,7 @@ TEST(BoostControl, OpenLoop) { EXPECT_CALL(openMap, getValue(_, _)) .WillRepeatedly([](float xRpm, float tps) { return tps; }); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); BoostController bc; @@ -68,7 +68,7 @@ TEST(BoostControl, OpenLoop) { } TEST(BoostControl, TestClosedLoop) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); BoostController bc; @@ -107,7 +107,7 @@ TEST(BoostControl, TestClosedLoop) { } TEST(BoostControl, SetOutput) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isBoostControlEnabled = true; diff --git a/unit_tests/tests/actuators/test_etb.cpp b/unit_tests/tests/actuators/test_etb.cpp index 1df7a2ddea..0c530eda00 100644 --- a/unit_tests/tests/actuators/test_etb.cpp +++ b/unit_tests/tests/actuators/test_etb.cpp @@ -21,7 +21,7 @@ using ::testing::StrictMock; TEST(etb, initializationNoPedal) { StrictMock mocks[ETB_COUNT]; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); for (int i = 0; i < ETB_COUNT; i++) { engine->etbControllers[i] = &mocks[i]; @@ -37,7 +37,7 @@ TEST(etb, initializationNoPedal) { TEST(etb, initializationMissingThrottle) { StrictMock mocks[ETB_COUNT]; - EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { + EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { engineConfiguration->etbFunctions[0] = DC_None; engineConfiguration->etbFunctions[1] = DC_None; }); @@ -63,7 +63,7 @@ TEST(etb, initializationSingleThrottle) { EXPECT_CALL(mocks[0], isEtbMode()) .WillOnce(Return(TRUE)); - EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { + EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { engineConfiguration->etbFunctions[0] = DC_Throttle1; engineConfiguration->etbFunctions[1] = DC_None; }); @@ -91,7 +91,7 @@ TEST(etb, initializationSingleThrottleInSecondSlot) { EXPECT_CALL(mocks[1], isEtbMode()) .WillOnce(Return(TRUE)); - EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { + EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { engineConfiguration->etbFunctions[0] = DC_None; engineConfiguration->etbFunctions[1] = DC_Throttle1; }); @@ -121,7 +121,7 @@ TEST(etb, initializationDualThrottle) { EXPECT_CALL(mocks[1], isEtbMode()) .WillOnce(Return(TRUE)); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); for (int i = 0; i < ETB_COUNT; i++) { engine->etbControllers[i] = &mocks[i]; @@ -152,7 +152,7 @@ TEST(etb, initializationWastegate) { EXPECT_CALL(mocks[0], isEtbMode()) .WillOnce(Return(false)); - EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { + EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { engineConfiguration->etbFunctions[0] = DC_Wastegate; engineConfiguration->etbFunctions[1] = DC_None; }); @@ -231,7 +231,7 @@ TEST(etb, initializationNoThrottles) { // This tests the case where you don't want an ETB, and expect everything to go fine EtbController duts[2]; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); for (int i = 0; i < ETB_COUNT; i++) { engine->etbControllers[i] = &duts[i]; @@ -254,7 +254,7 @@ TEST(etb, initializationNoThrottles) { TEST(etb, idlePlumbing) { StrictMock mocks[ETB_COUNT]; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); Sensor::setMockValue(SensorType::AcceleratorPedal, 50.0f, true); @@ -268,7 +268,7 @@ TEST(etb, idlePlumbing) { } TEST(etb, testSetpointOnlyPedal) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); EtbController etb; @@ -327,7 +327,7 @@ TEST(etb, testSetpointOnlyPedal) { } TEST(etb, setpointSecondThrottleTrim) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Mock pedal map that's just passthru pedal -> target StrictMock pedalMap; @@ -354,7 +354,7 @@ TEST(etb, setpointSecondThrottleTrim) { } TEST(etb, setpointIdle) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Use ETB for idle, but don't give it any range (yet) engineConfiguration->etbIdleThrottleRange = 0; @@ -410,7 +410,7 @@ TEST(etb, setpointIdle) { } TEST(etb, setpointRevLimit) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Configure 5000 limit start, with 750 rpm taper engineConfiguration->etbRevLimitStart = 5000; @@ -504,7 +504,7 @@ TEST(etb, setpointWastegateController) { } TEST(etb, setpointLuaAdder) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Must have TPS & PPS initialized for ETB setup Sensor::setMockValue(SensorType::Tps1Primary, 0); @@ -594,7 +594,7 @@ TEST(etb, etbTpsSensor) { } TEST(etb, setOutputInvalid) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Redundant TPS & accelerator pedal required for init Sensor::setMockValue(SensorType::Tps1Primary, 0); @@ -613,7 +613,7 @@ TEST(etb, setOutputInvalid) { } TEST(etb, setOutputValid) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock motor; // Must have TPS & PPS initialized for ETB setup @@ -633,7 +633,7 @@ TEST(etb, setOutputValid) { } TEST(etb, setOutputValid2) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock motor; // Must have TPS & PPS initialized for ETB setup @@ -653,7 +653,7 @@ TEST(etb, setOutputValid2) { } TEST(etb, setOutputOutOfRangeHigh) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock motor; // Must have TPS & PPS initialized for ETB setup @@ -673,7 +673,7 @@ TEST(etb, setOutputOutOfRangeHigh) { } TEST(etb, setOutputOutOfRangeLow) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock motor; // Must have TPS & PPS initialized for ETB setup @@ -693,7 +693,7 @@ TEST(etb, setOutputOutOfRangeLow) { } TEST(etb, setOutputPauseControl) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock motor; // Must have TPS & PPS initialized for ETB setup @@ -714,7 +714,7 @@ TEST(etb, setOutputPauseControl) { } TEST(etb, setOutputLimpHome) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock motor; // Must have TPS & PPS initialized for ETB setup @@ -766,7 +766,7 @@ TEST(etb, closedLoopPid) { extern int timeNowUs; TEST(etb, jamDetection) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); pid_s pid = {}; @@ -817,7 +817,7 @@ TEST(etb, jamDetection) { } TEST(etb, openLoopThrottle) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Redundant TPS & accelerator pedal required for init Sensor::setMockValue(SensorType::Tps1Primary, 0); @@ -839,7 +839,7 @@ TEST(etb, openLoopThrottle) { } TEST(etb, openLoopNonThrottle) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Redundant TPS & accelerator pedal required for init Sensor::setMockValue(SensorType::Tps1Primary, 0); diff --git a/unit_tests/tests/actuators/test_etb_integrated.cpp b/unit_tests/tests/actuators/test_etb_integrated.cpp index 17dff98dce..05be7d6a46 100644 --- a/unit_tests/tests/actuators/test_etb_integrated.cpp +++ b/unit_tests/tests/actuators/test_etb_integrated.cpp @@ -24,7 +24,7 @@ static EtbController * initEtbIntegratedTest() { } TEST(etb, integrated) { - EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method EtbController *etb = initEtbIntegratedTest(); Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 40); @@ -51,7 +51,7 @@ extern int timeNowUs; extern WarningCodeState unitTestWarningCodeState; TEST(etb, intermittentTps) { - EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method EtbController *etb = initEtbIntegratedTest(); warningBuffer_t &recentWarnings = unitTestWarningCodeState.recentWarnings; recentWarnings.clear(); @@ -108,7 +108,7 @@ TEST(etb, intermittentTps) { } TEST(etb, intermittentPps) { - EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method Sensor::setMockValue(SensorType::AcceleratorPedal, 10, true); EtbController *etb = initEtbIntegratedTest(); @@ -153,7 +153,7 @@ TEST(etb, intermittentPps) { } TEST(etb, sentTpsIntegrated) { - EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method engineConfiguration->sentInputPins[0] = Gpio::B3; engineConfiguration->sentEtbType = SentEtbType::GM_TYPE_1; @@ -168,7 +168,7 @@ TEST(etb, sentTpsIntegrated) { } TEST(etb, sentTpsIntegratedDecode) { - EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method engineConfiguration->sentEtbType = SentEtbType::GM_TYPE_1; diff --git a/unit_tests/tests/actuators/test_fan_control.cpp b/unit_tests/tests/actuators/test_fan_control.cpp index cc3017f53d..0934003a44 100644 --- a/unit_tests/tests/actuators/test_fan_control.cpp +++ b/unit_tests/tests/actuators/test_fan_control.cpp @@ -3,7 +3,7 @@ #include "fan_control.h" TEST(Actuators, Fan) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->fanOnTemperature = 90; engineConfiguration->fanOffTemperature = 80; diff --git a/unit_tests/tests/actuators/test_fuel_pump.cpp b/unit_tests/tests/actuators/test_fuel_pump.cpp index 0562e21eb8..16a148218b 100644 --- a/unit_tests/tests/actuators/test_fuel_pump.cpp +++ b/unit_tests/tests/actuators/test_fuel_pump.cpp @@ -12,7 +12,7 @@ extern int timeNowUs; TEST(Actuators, FuelPump) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); FuelPumpController dut; diff --git a/unit_tests/tests/actuators/test_gppwm.cpp b/unit_tests/tests/actuators/test_gppwm.cpp index 9e33030a27..29a635f0be 100644 --- a/unit_tests/tests/actuators/test_gppwm.cpp +++ b/unit_tests/tests/actuators/test_gppwm.cpp @@ -74,7 +74,7 @@ TEST(GpPwm, OutputOnOff) { } TEST(GpPwm, TestGetOutput) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); GppwmChannel ch; gppwm_channel cfg; diff --git a/unit_tests/tests/actuators/test_main_relay.cpp b/unit_tests/tests/actuators/test_main_relay.cpp index eb8f60eb8e..71e098dd76 100644 --- a/unit_tests/tests/actuators/test_main_relay.cpp +++ b/unit_tests/tests/actuators/test_main_relay.cpp @@ -3,7 +3,7 @@ #include "main_relay.h" TEST(Actuators, MainRelay) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); MainRelayController dut; diff --git a/unit_tests/tests/actuators/test_tacho.cpp b/unit_tests/tests/actuators/test_tacho.cpp index 14470751ba..5d51126a8f 100644 --- a/unit_tests/tests/actuators/test_tacho.cpp +++ b/unit_tests/tests/actuators/test_tacho.cpp @@ -5,7 +5,7 @@ extern float getTachDuty(void); TEST(Actuators, Tachometer) { // This engine has a tach pin set - we need that - EngineTestHelper eth(FRANKENSO_MAZDA_MIATA_2003); + EngineTestHelper eth(engine_type_e::FRANKENSO_MAZDA_MIATA_2003); // We don't actually care about ign/inj at all, just tach engineConfiguration->isInjectionEnabled = false; diff --git a/unit_tests/tests/actuators/test_vvt.cpp b/unit_tests/tests/actuators/test_vvt.cpp index a4b1caf201..e88fc28efd 100644 --- a/unit_tests/tests/actuators/test_vvt.cpp +++ b/unit_tests/tests/actuators/test_vvt.cpp @@ -6,7 +6,7 @@ using ::testing::StrictMock; using ::testing::Return; TEST(Vvt, TestSetPoint) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Set up a mock target map StrictMock targetMap; @@ -25,7 +25,7 @@ TEST(Vvt, TestSetPoint) { } TEST(Vvt, observePlant) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engine->triggerCentral.vvtPosition[0][0] = 23; @@ -43,7 +43,7 @@ TEST(Vvt, openLoop) { } TEST(Vvt, ClosedLoopNotInverted) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); VvtController dut; dut.init(0, 0, 0, nullptr); @@ -58,7 +58,7 @@ TEST(Vvt, ClosedLoopNotInverted) { } TEST(Vvt, ClosedLoopInverted) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); VvtController dut; dut.init(0, 0, 0, nullptr); diff --git a/unit_tests/tests/ignition_injection/injection_mode_transition.cpp b/unit_tests/tests/ignition_injection/injection_mode_transition.cpp index 427f5a475e..30f8879d39 100644 --- a/unit_tests/tests/ignition_injection/injection_mode_transition.cpp +++ b/unit_tests/tests/ignition_injection/injection_mode_transition.cpp @@ -30,7 +30,7 @@ static void doRevolution(EngineTestHelper& eth, int periodMs) { // https://github.com/rusefi/rusefi/issues/1592 TEST(fuelControl, transitionIssue1592) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engine->tdcMarkEnabled = false; setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð, IM_SEQUENTIAL); diff --git a/unit_tests/tests/ignition_injection/test_dwell_corner_case_issue_796.cpp b/unit_tests/tests/ignition_injection/test_dwell_corner_case_issue_796.cpp index 33fcffcda4..c28dff9016 100644 --- a/unit_tests/tests/ignition_injection/test_dwell_corner_case_issue_796.cpp +++ b/unit_tests/tests/ignition_injection/test_dwell_corner_case_issue_796.cpp @@ -9,7 +9,7 @@ TEST(scheduler, dwellIssue796) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð, IM_SEQUENTIAL); eth.fireTriggerEvents2(4 /* count */ , 600 /* ms */); diff --git a/unit_tests/tests/ignition_injection/test_fuelCut.cpp b/unit_tests/tests/ignition_injection/test_fuelCut.cpp index abdeb06e85..3f8ad84b38 100644 --- a/unit_tests/tests/ignition_injection/test_fuelCut.cpp +++ b/unit_tests/tests/ignition_injection/test_fuelCut.cpp @@ -16,7 +16,7 @@ using ::testing::_; #define EXPECT_CUT() EXPECT_FLOAT_EQ(0, engine->engineState.injectionDuration) TEST(fuelCut, coasting) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) .WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f})); @@ -131,7 +131,7 @@ TEST(fuelCut, coasting) { } TEST(fuelCut, delay) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) .WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f})); diff --git a/unit_tests/tests/ignition_injection/test_fuel_computer.cpp b/unit_tests/tests/ignition_injection/test_fuel_computer.cpp index a22c971269..438ff3cd3b 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_computer.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_computer.cpp @@ -14,7 +14,7 @@ public: }; TEST(FuelComputer, getCycleFuel) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); MockFuelComputer dut; @@ -30,7 +30,7 @@ TEST(FuelComputer, getCycleFuel) { } TEST(FuelComputer, FlexFuel) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); FuelComputer dut; diff --git a/unit_tests/tests/ignition_injection/test_fuel_map.cpp b/unit_tests/tests/ignition_injection/test_fuel_map.cpp index afef6309ad..7205484a93 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_map.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_map.cpp @@ -16,7 +16,7 @@ using ::testing::FloatNear; TEST(misc, testFuelMap) { printf("Setting up FORD_ASPIRE_1996\r\n"); - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); for (int i = 0; i < VBAT_INJECTOR_CURVE_SIZE; i++) { engineConfiguration->injector.battLagCorrBins[i] = i; @@ -129,7 +129,7 @@ static void configureFordAspireTriggerWaveform(TriggerWaveform * s) { TEST(misc, testAngleResolver) { printf("*************************************************** testAngleResolver\r\n"); - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); engineConfiguration->globalTriggerAngleOffset = 175; diff --git a/unit_tests/tests/ignition_injection/test_fuel_math.cpp b/unit_tests/tests/ignition_injection/test_fuel_math.cpp index 90fda2c895..07117c9967 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_math.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_math.cpp @@ -10,7 +10,7 @@ using ::testing::InSequence; using ::testing::_; TEST(FuelMath, getStandardAirCharge) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Miata 1839cc 4cyl engineConfiguration->displacement = 1.839f; @@ -37,7 +37,7 @@ TEST(FuelMath, getStandardAirCharge) { } TEST(AirmassModes, AlphaNNormal) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // 4 cylinder 4 liter = easy math engineConfiguration->displacement = 4.0f; engineConfiguration->cylindersCount = 4; @@ -61,7 +61,7 @@ TEST(AirmassModes, AlphaNNormal) { } TEST(AirmassModes, AlphaNFailedTps) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Shouldn't get called StrictMock veTable; @@ -78,7 +78,7 @@ TEST(AirmassModes, AlphaNFailedTps) { } TEST(AirmassModes, MafNormal) { - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); engineConfiguration->fuelAlgorithm = LM_REAL_MAF; engineConfiguration->injector.flow = 200; @@ -119,7 +119,7 @@ TEST(AirmassModes, VeOverride) { } }; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); DummyAirmassModel dut(veTable); // Use default mode - will call with 10 @@ -148,7 +148,7 @@ TEST(AirmassModes, FallbackMap) { EXPECT_CALL(mapFallback, getValue(5678, 20)).WillOnce(Return(75)); } - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); SpeedDensityAirmass dut(veTable, mapFallback); @@ -167,7 +167,7 @@ TEST(AirmassModes, FallbackMap) { void setInjectionMode(int value); TEST(FuelMath, testDifferentInjectionModes) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð); EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) @@ -192,7 +192,7 @@ TEST(FuelMath, testDifferentInjectionModes) { } TEST(FuelMath, deadtime) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð); @@ -212,7 +212,7 @@ TEST(FuelMath, deadtime) { } TEST(FuelMath, CylinderFuelTrim) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) .WillRepeatedly(Return(AirmassResult{1, 50.0f})); @@ -242,7 +242,7 @@ struct MockIdle : public MockIdleController { }; TEST(FuelMath, IdleVeTable) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); MockAirmass dut; diff --git a/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp b/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp index d49b64492a..1e253c8898 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp @@ -16,7 +16,7 @@ struct MockWallController : public IWallFuelController { }; TEST(fuel, testWallWettingEnrichmentMath) { - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); MockWallController wallController; @@ -62,7 +62,7 @@ TEST(fuel, testWallWettingEnrichmentMath) { TEST(fuel, testWallWettingEnrichmentScheduling) { - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); engineConfiguration->isFasterEngineSpinUpEnabled = false; setCrankOperationMode(); diff --git a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp index 847364b024..d1cb38929b 100644 --- a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp +++ b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp @@ -11,7 +11,7 @@ using ::testing::_; TEST(ignition, twoCoils) { - EngineTestHelper eth(FRANKENSO_BMW_M73_F); + EngineTestHelper eth(engine_type_e::FRANKENSO_BMW_M73_F); // let's recalculate with zero timing so that we can focus on relation advance between cylinders setArrayValues(engine->engineState.timingAdvance, 0.0f); @@ -43,7 +43,7 @@ TEST(ignition, twoCoils) { } TEST(ignition, trailingSpark) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = false; /** @@ -127,7 +127,7 @@ TEST(ignition, trailingSpark) { } TEST(ignition, CylinderTimingTrim) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Base timing 15 degrees setTable(config->ignitionTable, 15); diff --git a/unit_tests/tests/ignition_injection/test_injector_model.cpp b/unit_tests/tests/ignition_injection/test_injector_model.cpp index 1ef3f43e00..67196f21b4 100644 --- a/unit_tests/tests/ignition_injection/test_injector_model.cpp +++ b/unit_tests/tests/ignition_injection/test_injector_model.cpp @@ -106,7 +106,7 @@ TEST(InjectorModel, nonLinearFordMode) { } TEST(InjectorModel, nonlinearPolynomial) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); InjectorModel dut; engineConfiguration->applyNonlinearBelowPulse = 10; @@ -130,7 +130,7 @@ TEST(InjectorModel, nonlinearPolynomial) { } TEST(InjectorModel, Deadtime) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Some test data in the injector correction table for (size_t i = 0; i < efi::size(engineConfiguration->injector.battLagCorr); i++) { @@ -172,7 +172,7 @@ TEST_P(FlowRateFixture, PressureRatio) { StrictMock dut; EXPECT_CALL(dut, getFuelDifferentialPressure()).WillOnce(Return(400 * pressureRatio)); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Use injector compensation engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -187,7 +187,7 @@ TEST_P(FlowRateFixture, PressureRatio) { TEST(InjectorModel, NegativePressureDelta) { StrictMock dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Use injector compensation engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -204,7 +204,7 @@ TEST(InjectorModel, NegativePressureDelta) { TEST(InjectorModel, VariableInjectorFlowModeNone) { StrictMock dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->injectorCompensationMode = ICM_None; @@ -215,7 +215,7 @@ TEST(InjectorModel, VariableInjectorFlowModeNone) { TEST(InjectorModel, RailPressureFixed) { InjectorModel dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Reference pressure is 350kpa engineConfiguration->fuelReferencePressure = 350; @@ -234,7 +234,7 @@ TEST(InjectorModel, RailPressureFixed) { TEST(InjectorModel, RailPressureSensedAbsolute) { InjectorModel dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -254,7 +254,7 @@ TEST(InjectorModel, RailPressureSensedAbsolute) { TEST(InjectorModel, RailPressureSensedGauge) { InjectorModel dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -275,7 +275,7 @@ TEST(InjectorModel, RailPressureSensedGauge) { TEST(InjectorModel, RailPressureSensedDifferential) { InjectorModel dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -293,7 +293,7 @@ TEST(InjectorModel, RailPressureSensedDifferential) { TEST(InjectorModel, FailedPressureSensor) { InjectorModel dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -311,7 +311,7 @@ TEST(InjectorModel, FailedPressureSensor) { TEST(InjectorModel, MissingPressureSensor) { InjectorModel dut; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; diff --git a/unit_tests/tests/ignition_injection/test_multispark.cpp b/unit_tests/tests/ignition_injection/test_multispark.cpp index ef84a8479f..7c86025797 100644 --- a/unit_tests/tests/ignition_injection/test_multispark.cpp +++ b/unit_tests/tests/ignition_injection/test_multispark.cpp @@ -9,7 +9,7 @@ #include "advance_map.h" TEST(Multispark, DefaultConfiguration) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); EXPECT_EQ(0, getMultiSparkCount(0 )); EXPECT_EQ(0, getMultiSparkCount(100 )); @@ -37,7 +37,7 @@ static void multisparkCfg() { } TEST(Multispark, EnabledNoMaxRpm) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); multisparkCfg(); @@ -62,7 +62,7 @@ TEST(Multispark, EnabledNoMaxRpm) { } TEST(Multispark, RpmLimit) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); multisparkCfg(); diff --git a/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp b/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp index 1e3f29f0ee..f8ecfce734 100644 --- a/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp +++ b/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp @@ -7,7 +7,7 @@ #include "spark_logic.h" TEST(issues, issueOneCylinderSpecialCase968) { - EngineTestHelper eth(GY6_139QMB); + EngineTestHelper eth(engine_type_e::GY6_139QMB); setTable(config->injectionPhase, -180.0f); engineConfiguration->isFasterEngineSpinUpEnabled = false; engine->tdcMarkEnabled = false; diff --git a/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp b/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp index 55219400da..931ca6c9db 100644 --- a/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp +++ b/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp @@ -8,7 +8,7 @@ #include "pch.h" TEST(engine, testPlainCrankingWithoutAdvancedFeatures) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->injectionPhase, -180.0f); engineConfiguration->isFasterEngineSpinUpEnabled = false; engine->tdcMarkEnabled = false; @@ -34,7 +34,7 @@ TEST(engine, testPlainCrankingWithoutAdvancedFeatures) { TEST(priming, startScheduling) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "RPM=0"; @@ -45,7 +45,7 @@ TEST(priming, startScheduling) { } TEST(priming, duration) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); MockInjectorModel2 injectorModel; engine->module().set(&injectorModel); diff --git a/unit_tests/tests/lua/test_lookup.cpp b/unit_tests/tests/lua/test_lookup.cpp index 32a5ee8fbc..2f27c0e48d 100644 --- a/unit_tests/tests/lua/test_lookup.cpp +++ b/unit_tests/tests/lua/test_lookup.cpp @@ -2,7 +2,7 @@ #include "value_lookup.h" TEST(LuaBasic, configLookup) { - EngineTestHelper eth(FORD_ESCORT_GT); + EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT); { const char * name = "ignitionDwellForCrankingMs"; setConfigValueByName(name, 1.6); diff --git a/unit_tests/tests/lua/test_lua_hooks.cpp b/unit_tests/tests/lua/test_lua_hooks.cpp index e18c2471c4..10388b960a 100644 --- a/unit_tests/tests/lua/test_lua_hooks.cpp +++ b/unit_tests/tests/lua/test_lua_hooks.cpp @@ -23,7 +23,7 @@ TEST(LuaHooks, TestCrc8) { } TEST(LuaHooks, TestGetCalibration) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); const char* sourceCode = R"( function testFunc() @@ -35,7 +35,7 @@ TEST(LuaHooks, TestGetCalibration) { } TEST(LuaHooks, TestSetCalibration) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); const char* sourceCode = R"( function testFunc() @@ -92,7 +92,7 @@ TEST(LuaHooks, Table3d) { end )"; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->scriptTable2, (uint8_t)33); EXPECT_EQ(testLuaReturnsNumber(tableTest), 33); diff --git a/unit_tests/tests/lua/test_lua_vin.cpp b/unit_tests/tests/lua/test_lua_vin.cpp index 14f862d403..79527e883e 100644 --- a/unit_tests/tests/lua/test_lua_vin.cpp +++ b/unit_tests/tests/lua/test_lua_vin.cpp @@ -9,7 +9,7 @@ TEST(LuaVin, Test) { - EngineTestHelper eth(TEST_CRANK_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_CRANK_ENGINE); strcpy(engineConfiguration->vinNumber, "GM123"); diff --git a/unit_tests/tests/lua/test_lua_with_engine.cpp b/unit_tests/tests/lua/test_lua_with_engine.cpp index 769e59a319..37b31919fe 100644 --- a/unit_tests/tests/lua/test_lua_with_engine.cpp +++ b/unit_tests/tests/lua/test_lua_with_engine.cpp @@ -19,7 +19,7 @@ end )"; TEST(LuaHooks, TestCurve) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); strcpy(engineConfiguration->scriptCurveName[3], "hello"); setLinearCurve(config->scriptCurve4, 500, 600, 1); diff --git a/unit_tests/tests/sensor/test_frequency_sensor.cpp b/unit_tests/tests/sensor/test_frequency_sensor.cpp index 66248ce5b6..83d3dfc17e 100644 --- a/unit_tests/tests/sensor/test_frequency_sensor.cpp +++ b/unit_tests/tests/sensor/test_frequency_sensor.cpp @@ -50,7 +50,7 @@ public: */ TEST_F(FrequencySensorTest, testValidWithPwm) { ASSERT_TRUE(dut.Register()); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Should be invalid - not set yet { diff --git a/unit_tests/tests/sensor/test_sensor_init.cpp b/unit_tests/tests/sensor/test_sensor_init.cpp index 328973f654..4585a54561 100644 --- a/unit_tests/tests/sensor/test_sensor_init.cpp +++ b/unit_tests/tests/sensor/test_sensor_init.cpp @@ -24,7 +24,7 @@ static void postToFuncSensor(Sensor* s, float value) { } TEST(SensorInit, Tps) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->tpsMin = 200; // 1 volt engineConfiguration->tpsMax = 800; // 4 volts @@ -50,7 +50,7 @@ TEST(SensorInit, Tps) { } TEST(SensorInit, TpsValuesTooClose) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Should fail, 0.49 volts apart engineConfiguration->tpsMin = 200; // 1.00 volt @@ -97,7 +97,7 @@ TEST(SensorInit, TpsValuesTooClose) { } TEST(SensorInit, Pedal) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_0; engineConfiguration->throttlePedalUpVoltage = 1; @@ -124,7 +124,7 @@ TEST(SensorInit, Pedal) { } TEST(SensorInit, DriverIntentNoPedal) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // We have no pedal - so we should get the TPS engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_NONE; @@ -145,7 +145,7 @@ TEST(SensorInit, DriverIntentNoPedal) { TEST(SensorInit, DriverIntentWithPedal) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // We have a pedal, so we should get it engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_0; @@ -164,7 +164,7 @@ TEST(SensorInit, DriverIntentWithPedal) { } TEST(SensorInit, OilPressure) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->oilPressure.hwChannel = EFI_ADC_0; engineConfiguration->oilPressure.v1 = 1; @@ -189,7 +189,7 @@ TEST(SensorInit, OilPressure) { } TEST(SensorInit, Clt) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // 2003 neon sensor engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700}; @@ -212,7 +212,7 @@ TEST(SensorInit, Clt) { } TEST(SensorInit, Lambda) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); initLambda(); @@ -221,7 +221,7 @@ TEST(SensorInit, Lambda) { } TEST(SensorInit, Map) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->map.sensor.hwChannel = EFI_ADC_4; initMap(); diff --git a/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp b/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp index 4c2fdbe2ff..695727301c 100644 --- a/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp +++ b/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp @@ -1,7 +1,7 @@ #include "pch.h" #include "turbocharger_speed_converter.h" -static constexpr engine_type_e ENGINE_TEST_HELPER = TEST_ENGINE; +static constexpr engine_type_e ENGINE_TEST_HELPER = engine_type_e::TEST_ENGINE; class TurbochargerSpeedConverterTest : public ::testing::Test { diff --git a/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp b/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp index 46cd8e86a5..be3e717784 100644 --- a/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp +++ b/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp @@ -3,7 +3,7 @@ float GetVssFor(float revPerKm, float axle, float teeth, float hz) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); VehicleSpeedConverter dut; diff --git a/unit_tests/tests/test_accel_enrichment.cpp b/unit_tests/tests/test_accel_enrichment.cpp index d4cca79a32..24923624f5 100644 --- a/unit_tests/tests/test_accel_enrichment.cpp +++ b/unit_tests/tests/test_accel_enrichment.cpp @@ -15,7 +15,7 @@ TEST(fuel, testTpsAccelEnrichmentMath) { printf("====================================================================================== testAccelEnrichment\r\n"); - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); engine->rpmCalculator.setRpmValue(600); engine->periodicFastCallback(); @@ -40,7 +40,7 @@ TEST(fuel, testTpsAccelEnrichmentMath) { } TEST(fuel, testTpsAccelEnrichmentScheduling) { - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); setCrankOperationMode(); @@ -97,7 +97,7 @@ static void doFractionalTpsIteration(int period, int divisor, int numCycles, std TEST(fuel, testAccelEnrichmentFractionalTps) { printf("====================================================================================== testAccelEnrichmentFractionalTps\r\n"); - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); // setup engineConfiguration->tpsAccelEnrichmentThreshold = 5; diff --git a/unit_tests/tests/test_can_serial.cpp b/unit_tests/tests/test_can_serial.cpp index 03f69ce281..53b434d0f0 100644 --- a/unit_tests/tests/test_can_serial.cpp +++ b/unit_tests/tests/test_can_serial.cpp @@ -55,7 +55,7 @@ public: TestCanStreamerState() : CanStreamerState(&streamer) {} void test(const std::vector & dataList, const std::vector & frames, int fifoLeftoverSize, const std::vector & receiveChunks) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); size_t totalSize = 0; std::string totalData; diff --git a/unit_tests/tests/test_can_wideband.cpp b/unit_tests/tests/test_can_wideband.cpp index d7a360f736..370dfe7b42 100644 --- a/unit_tests/tests/test_can_wideband.cpp +++ b/unit_tests/tests/test_can_wideband.cpp @@ -99,7 +99,7 @@ TEST(CanWideband, DecodeValidAemFormat) { TEST(CanWideband, DecodeRusefiStandard) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); AemXSeriesWideband dut(0, SensorType::Lambda1); dut.Register(); @@ -139,7 +139,7 @@ TEST(CanWideband, DecodeRusefiStandard) TEST(CanWideband, DecodeRusefiStandardWrongVersion) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); AemXSeriesWideband dut(0, SensorType::Lambda1); dut.Register(); diff --git a/unit_tests/tests/test_change_engine_type.cpp b/unit_tests/tests/test_change_engine_type.cpp index 65d6f40218..4f838f7a74 100644 --- a/unit_tests/tests/test_change_engine_type.cpp +++ b/unit_tests/tests/test_change_engine_type.cpp @@ -13,7 +13,7 @@ TEST(misc, changeEngineType) { /** * this configuration has triggerInputDebugPins defined */ - EngineTestHelper eth (FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); brain_pin_e brainPin = engineConfiguration->triggerInputDebugPins[0]; ASSERT_TRUE(brainPin != Gpio::Unassigned); @@ -25,7 +25,7 @@ TEST(misc, changeEngineType) { // above we have asserted that triggerInputDebugPins is in fact used // now let's change into engine type without triggerInputDebugPins and assert shut down - setEngineType((int)CITROEN_TU3JP); + setEngineType((int)engine_type_e::CITROEN_TU3JP); ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] == Gpio::Unassigned); ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == Gpio::Unassigned); diff --git a/unit_tests/tests/test_dynoview.cpp b/unit_tests/tests/test_dynoview.cpp index 7337a3f478..08b0aa01b7 100644 --- a/unit_tests/tests/test_dynoview.cpp +++ b/unit_tests/tests/test_dynoview.cpp @@ -17,7 +17,7 @@ void printResults(DynoView *dut) { TEST(DynoView, VSS_T1) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); DynoView dut; @@ -36,7 +36,7 @@ TEST(DynoView, VSS_T1) { } TEST(DynoView, algo) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); DynoView dut; @@ -60,7 +60,7 @@ TEST(DynoView, algo) { } TEST(DynoView, VSS_fast) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); DynoView dut; @@ -83,7 +83,7 @@ TEST(DynoView, VSS_fast) { TEST(DynoView, VSS_Torque) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); DynoView dut; diff --git a/unit_tests/tests/test_engine_math.cpp b/unit_tests/tests/test_engine_math.cpp index 313c3ca75b..f9d83adcc9 100644 --- a/unit_tests/tests/test_engine_math.cpp +++ b/unit_tests/tests/test_engine_math.cpp @@ -13,7 +13,7 @@ TEST(misc, testIgnitionPlanning) { printf("*************************************************** testIgnitionPlanning\r\n"); - EngineTestHelper eth(FORD_ESCORT_GT); + EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT); engine->periodicFastCallback(); assertEqualsM("testIgnitionPlanning_AFR", 13.5, engine->fuelComputer.targetAFR); @@ -25,7 +25,7 @@ TEST(misc, testEngineMath) { printf("*************************************************** testEngineMath\r\n"); // todo: let's see if we can make 'engine' unneeded in this test? - EngineTestHelper eth(FORD_ESCORT_GT); + EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT); setCamOperationMode(); engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY; diff --git a/unit_tests/tests/test_gear_detector.cpp b/unit_tests/tests/test_gear_detector.cpp index b028dd1ffc..c5ca7cf87f 100644 --- a/unit_tests/tests/test_gear_detector.cpp +++ b/unit_tests/tests/test_gear_detector.cpp @@ -1,7 +1,7 @@ #include "pch.h" float GetGearRatioFor(float revPerKm, float axle, float kph, float rpm) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->driveWheelRevPerKm = revPerKm; engineConfiguration->finalGearRatio = axle; @@ -29,7 +29,7 @@ TEST(GearDetector, ComputeGearRatio) { TEST(GearDetector, GetRpmInGear) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->driveWheelRevPerKm = 507; engineConfiguration->finalGearRatio = 4.10f; @@ -68,7 +68,7 @@ TEST(GearDetector, GetRpmInGear) { } TEST(GearDetector, DetermineGearSingleSpeed) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); auto& dut = engine->module().unmock(); engineConfiguration->totalGearsCount = 1; @@ -92,7 +92,7 @@ TEST(GearDetector, DetermineGearSingleSpeed) { } TEST(GearDetector, DetermineGear5Speed) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); auto& dut = engine->module().unmock(); engineConfiguration->totalGearsCount = 5; @@ -136,7 +136,7 @@ TEST(GearDetector, DetermineGear5Speed) { } TEST(GearDetector, MiataNb6Speed) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); auto& dut = engine->module().unmock(); engineConfiguration->totalGearsCount = 6; @@ -164,7 +164,7 @@ TEST(GearDetector, MiataNb6Speed) { } TEST(GearDetector, DetermineGear8Speed) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); auto& dut = engine->module().unmock(); // ZF 8HP 70 @@ -203,7 +203,7 @@ TEST(GearDetector, DetermineGear8Speed) { } TEST(GearDetector, ParameterValidation) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); auto& dut = engine->module().unmock(); // Defaults should work diff --git a/unit_tests/tests/test_gpio.cpp b/unit_tests/tests/test_gpio.cpp index 47c578c819..49c657bbbd 100644 --- a/unit_tests/tests/test_gpio.cpp +++ b/unit_tests/tests/test_gpio.cpp @@ -1,7 +1,7 @@ #include "pch.h" TEST(gpio, testPinInitNonInverted) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); OutputPin dut; @@ -17,7 +17,7 @@ TEST(gpio, testPinInitNonInverted) { } TEST(gpio, testPinInitInverted) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); OutputPin dut; diff --git a/unit_tests/tests/test_hardware_reinit.cpp b/unit_tests/tests/test_hardware_reinit.cpp index b658029e2d..f0f92591be 100644 --- a/unit_tests/tests/test_hardware_reinit.cpp +++ b/unit_tests/tests/test_hardware_reinit.cpp @@ -1,7 +1,7 @@ #include "pch.h" TEST(hardware, reinit) { - EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP); + EngineTestHelper eth(engine_type_e::FRANKENSO_MIATA_NA6_MAP); ButtonDebounce::stopConfigurationList(); ButtonDebounce::startConfigurationList(); @@ -10,6 +10,6 @@ TEST(hardware, reinit) { ButtonDebounce::startConfigurationList(); - resetConfigurationExt(nullptr, DODGE_NEON_1995); - resetConfigurationExt(nullptr, FRANKENSO_MIATA_NA6_MAP); + resetConfigurationExt(nullptr, engine_type_e::DODGE_NEON_1995); + resetConfigurationExt(nullptr, engine_type_e::FRANKENSO_MIATA_NA6_MAP); } diff --git a/unit_tests/tests/test_hpfp.cpp b/unit_tests/tests/test_hpfp.cpp index e1f5853c4b..bd3b6f92ca 100755 --- a/unit_tests/tests/test_hpfp.cpp +++ b/unit_tests/tests/test_hpfp.cpp @@ -7,7 +7,7 @@ using ::testing::_; using ::testing::StrictMock; TEST(HPFP, Lobe) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->hpfpCam = HPFP_CAM_NONE; engineConfiguration->hpfpPeakPos = 123; @@ -51,7 +51,7 @@ TEST(HPFP, Lobe) { } TEST(HPFP, InjectionReplacementFuel) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->cylindersCount = 4; engineConfiguration->hpfpCamLobes = 4; @@ -104,7 +104,7 @@ TEST(HPFP, InjectionReplacementFuel) { } TEST(HPFP, PI) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->cylindersCount = 4; engineConfiguration->hpfpCamLobes = 4; @@ -161,7 +161,7 @@ TEST(HPFP, PI) { } TEST(HPFP, Angle) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->cylindersCount = 4; engineConfiguration->hpfpCamLobes = 4; @@ -207,7 +207,7 @@ TEST(HPFP, Angle) { } TEST(HPFP, Schedule) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->cylindersCount = 4; engineConfiguration->hpfpCamLobes = 4; diff --git a/unit_tests/tests/test_hpfp_integrated.cpp b/unit_tests/tests/test_hpfp_integrated.cpp index b415d9b6a9..d5e38e740c 100644 --- a/unit_tests/tests/test_hpfp_integrated.cpp +++ b/unit_tests/tests/test_hpfp_integrated.cpp @@ -8,7 +8,7 @@ #include "pch.h" TEST(HPFP, IntegratedSchedule) { - EngineTestHelper eth(TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { + EngineTestHelper eth(engine_type_e::TEST_ENGINE, [](engine_configuration_s* engineConfiguration) { engineConfiguration->hpfpValvePin = Gpio::A2; // arbitrary }); diff --git a/unit_tests/tests/test_idle_controller.cpp b/unit_tests/tests/test_idle_controller.cpp index 42e1b79741..8968f7a77e 100644 --- a/unit_tests/tests/test_idle_controller.cpp +++ b/unit_tests/tests/test_idle_controller.cpp @@ -18,7 +18,7 @@ using ::testing::_; using ICP = IIdleController::Phase; TEST(idle_v2, timingPid) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; engineConfiguration->useIdleTimingPidControl = true; @@ -50,7 +50,7 @@ TEST(idle_v2, timingPid) { } TEST(idle_v2, testTargetRpm) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; for (size_t i = 0; i < efi::size(config->cltIdleRpmBins); i++) { @@ -63,7 +63,7 @@ TEST(idle_v2, testTargetRpm) { } TEST(idle_v2, testDeterminePhase) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; // TPS threshold 5% for easy test @@ -108,7 +108,7 @@ TEST(idle_v2, testDeterminePhase) { } TEST(idle_v2, crankingOpenLoop) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; engineConfiguration->crankingIACposition = 50; @@ -133,7 +133,7 @@ TEST(idle_v2, crankingOpenLoop) { } TEST(idle_v2, runningOpenLoopBasic) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; engineConfiguration->manIdlePosition = 50; @@ -148,7 +148,7 @@ TEST(idle_v2, runningOpenLoopBasic) { } TEST(idle_v2, runningFanAcBump) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; engineConfiguration->manIdlePosition = 50; @@ -186,7 +186,7 @@ TEST(idle_v2, runningFanAcBump) { } TEST(idle_v2, runningOpenLoopTpsTaper) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; // Zero out base tempco table @@ -208,7 +208,7 @@ TEST(idle_v2, runningOpenLoopTpsTaper) { } TEST(idle_v2, runningOpenLoopRpmTaper) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; // Zero out base tempco table @@ -236,7 +236,7 @@ struct MockOpenLoopIdler : public IdleController { }; TEST(idle_v2, testOpenLoopCranking) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; engineConfiguration->overrideCrankingIacSetting = true; @@ -248,7 +248,7 @@ TEST(idle_v2, testOpenLoopCranking) { } TEST(idle_v2, openLoopRunningTaper) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; EXPECT_CALL(dut, getRunningOpenLoop(0, 30, SensorResult(0))).WillRepeatedly(Return(25)); @@ -272,7 +272,7 @@ TEST(idle_v2, openLoopRunningTaper) { } TEST(idle_v2, getCrankingTaperFraction) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; engineConfiguration->afterCrankingIACtaperDuration = 500; @@ -300,7 +300,7 @@ TEST(idle_v2, getCrankingTaperFraction) { } TEST(idle_v2, openLoopCoastingTable) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; // enable & configure feature @@ -317,7 +317,7 @@ TEST(idle_v2, openLoopCoastingTable) { extern int timeNowUs; TEST(idle_v2, closedLoopBasic) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; dut.init(); @@ -344,7 +344,7 @@ TEST(idle_v2, closedLoopBasic) { } TEST(idle_v2, closedLoopDeadzone) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); IdleController dut; dut.init(); @@ -380,7 +380,7 @@ struct IntegrationIdleMock : public IdleController { }; TEST(idle_v2, IntegrationManual) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; SensorResult expectedTps = 1; @@ -411,7 +411,7 @@ TEST(idle_v2, IntegrationManual) { } TEST(idle_v2, IntegrationAutomatic) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; engineConfiguration->idleMode = IM_AUTO; @@ -447,7 +447,7 @@ TEST(idle_v2, IntegrationAutomatic) { } TEST(idle_v2, IntegrationClamping) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); StrictMock dut; engineConfiguration->idleMode = IM_AUTO; diff --git a/unit_tests/tests/test_knock.cpp b/unit_tests/tests/test_knock.cpp index 1292dfca30..2a5c36bc0a 100644 --- a/unit_tests/tests/test_knock.cpp +++ b/unit_tests/tests/test_knock.cpp @@ -15,7 +15,7 @@ struct MockKnockController : public KnockControllerBase { }; TEST(Knock, Retards) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Aggression of 10% engineConfiguration->knockRetardAggression = 10; @@ -48,7 +48,7 @@ TEST(Knock, Retards) { } TEST(Knock, Reapply) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); MockKnockController dut; dut.onFastCallback(); diff --git a/unit_tests/tests/test_launch.cpp b/unit_tests/tests/test_launch.cpp index 0624b0ae58..47c0f262cb 100644 --- a/unit_tests/tests/test_launch.cpp +++ b/unit_tests/tests/test_launch.cpp @@ -3,7 +3,7 @@ #include "launch_control.h" TEST(LaunchControl, TpsCondition) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); LaunchControlBase dut; @@ -24,7 +24,7 @@ TEST(LaunchControl, TpsCondition) { TEST(LaunchControl, VSSCondition) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); LaunchControlBase dut; @@ -41,7 +41,7 @@ TEST(LaunchControl, VSSCondition) { } TEST(LaunchControl, RPMCondition) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); LaunchControlBase dut; @@ -53,7 +53,7 @@ TEST(LaunchControl, RPMCondition) { } TEST(LaunchControl, SwitchInputCondition) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); LaunchControlBase dut; @@ -95,7 +95,7 @@ TEST(LaunchControl, SwitchInputCondition) { } TEST(LaunchControl, CombinedCondition) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); LaunchControlBase dut; @@ -138,7 +138,7 @@ static void setDefaultLaunchParameters() { } TEST(LaunchControl, CompleteRun) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); //load default config setDefaultLaunchParameters(); diff --git a/unit_tests/tests/test_limp.cpp b/unit_tests/tests/test_limp.cpp index 9d34e76722..0aaf9c96c2 100644 --- a/unit_tests/tests/test_limp.cpp +++ b/unit_tests/tests/test_limp.cpp @@ -22,7 +22,7 @@ TEST(limp, testFatalError) { } TEST(limp, revLimit) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->rpmHardLimit = 2500; @@ -45,7 +45,7 @@ TEST(limp, revLimit) { } TEST(limp, revLimitCltBased) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->rpmHardLimit = 2500; @@ -95,7 +95,7 @@ TEST(limp, revLimitCltBased) { } TEST(limp, revHardLimitHyst) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->rpmHardLimit = 2500; engineConfiguration->rpmHardLimitHyst = 200; @@ -124,7 +124,7 @@ TEST(limp, revHardLimitHyst) { } TEST(limp, revSoftLimit) { - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); engineConfiguration->rpmHardLimit = 2500; engineConfiguration->rpmHardLimitHyst = 200; @@ -168,7 +168,7 @@ TEST(limp, revSoftLimit) { } TEST(limp, boostCut) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // Cut above 100kPa engineConfiguration->boostCutPressure = 100; @@ -206,7 +206,7 @@ TEST(limp, boostCut) { extern int timeNowUs; TEST(limp, oilPressureFailureCase) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->minOilPressureAfterStart = 200; LimpManager dut; @@ -239,7 +239,7 @@ TEST(limp, oilPressureFailureCase) { } TEST(limp, oilPressureSuccessCase) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->minOilPressureAfterStart = 200; LimpManager dut; diff --git a/unit_tests/tests/test_start_stop.cpp b/unit_tests/tests/test_start_stop.cpp index 8e391a86ce..da3be3fe37 100644 --- a/unit_tests/tests/test_start_stop.cpp +++ b/unit_tests/tests/test_start_stop.cpp @@ -9,7 +9,7 @@ TEST(start, startStop) { std::unordered_map sensorVals = {{ SensorType::AcceleratorPedal, 0 }}; - EngineTestHelper eth(PROTEUS_BMW_M73, sensorVals); + EngineTestHelper eth(engine_type_e::PROTEUS_BMW_M73, sensorVals); eth.moveTimeForwardAndInvokeEventsSec(1); // '0' time has special meaning for implementation so let's move forward // this is a pull-up, so 'true' on start-up diff --git a/unit_tests/tests/test_stft.cpp b/unit_tests/tests/test_stft.cpp index af02ab2301..18190312dd 100644 --- a/unit_tests/tests/test_stft.cpp +++ b/unit_tests/tests/test_stft.cpp @@ -77,7 +77,7 @@ TEST(ClosedLoopFuel, CellSelection) { } TEST(ClosedLoopFuel, afrLimits) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->stft.minAfr = 10; // 10.0 AFR engineConfiguration->stft.maxAfr = 18; // 18.0 AFR diff --git a/unit_tests/tests/test_tunerstudio.cpp b/unit_tests/tests/test_tunerstudio.cpp index 75eb08413c..0f75b9cca9 100644 --- a/unit_tests/tests/test_tunerstudio.cpp +++ b/unit_tests/tests/test_tunerstudio.cpp @@ -68,7 +68,7 @@ TEST(binary, testWriteCrc) { } TEST(TunerstudioCommands, writeChunkEngineConfig) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); ::testing::NiceMock channel; uint8_t* configBytes = reinterpret_cast(config); diff --git a/unit_tests/tests/trigger/test_2jz_vvt.cpp b/unit_tests/tests/trigger/test_2jz_vvt.cpp index f8a10e2092..a7271cc7a9 100644 --- a/unit_tests/tests/trigger/test_2jz_vvt.cpp +++ b/unit_tests/tests/trigger/test_2jz_vvt.cpp @@ -8,7 +8,7 @@ #include "pch.h" TEST(sensors, test2jz) { - EngineTestHelper eth(TOYOTA_2JZ_GTE_VVTi); + EngineTestHelper eth(engine_type_e::TOYOTA_2JZ_GTE_VVTi); engineConfiguration->isFasterEngineSpinUpEnabled = false; eth.setTriggerType(TT_ONE); diff --git a/unit_tests/tests/trigger/test_cam_vvt_input.cpp b/unit_tests/tests/trigger/test_cam_vvt_input.cpp index 9eb41294d5..e6fa0c0269 100644 --- a/unit_tests/tests/trigger/test_cam_vvt_input.cpp +++ b/unit_tests/tests/trigger/test_cam_vvt_input.cpp @@ -13,7 +13,7 @@ extern WarningCodeState unitTestWarningCodeState; extern WaveChart waveChart; TEST(trigger, testNoStartUpWarningsNoSyncronizationTrigger) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // one tooth does not need synchronization it just counts tooth eth.setTriggerType(TT_ONE); ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testNoStartUpWarnings RPM"; @@ -24,7 +24,7 @@ TEST(trigger, testNoStartUpWarningsNoSyncronizationTrigger) { } TEST(trigger, testNoStartUpWarnings) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // for this test we need a trigger with isSynchronizationNeeded=true engineConfiguration->trigger.customTotalToothCount = 3; engineConfiguration->trigger.customSkippedToothCount = 1; @@ -58,7 +58,7 @@ TEST(trigger, testNoStartUpWarnings) { } TEST(trigger, testNoisyInput) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testNoisyInput RPM"; @@ -80,7 +80,7 @@ TEST(trigger, testNoisyInput) { TEST(trigger, testCamInput) { // setting some weird engine - EngineTestHelper eth(FORD_ESCORT_GT); + EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT); // changing to 'ONE TOOTH' trigger on CRANK with CAM/VVT setCrankOperationMode(); @@ -132,7 +132,7 @@ TEST(trigger, testCamInput) { } TEST(trigger, testNB2CamInput) { - EngineTestHelper eth(FRANKENSO_MAZDA_MIATA_2003); + EngineTestHelper eth(engine_type_e::FRANKENSO_MAZDA_MIATA_2003); engineConfiguration->isFasterEngineSpinUpEnabled = false; diff --git a/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp b/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp index 8ad4867d19..f8e66f1728 100644 --- a/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp +++ b/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp @@ -7,7 +7,7 @@ #include "pch.h" TEST(cranking, testFasterEngineSpinningUp) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->injectionPhase, -180.0f); engine->tdcMarkEnabled = false; // turn on FasterEngineSpinUp mode @@ -104,7 +104,7 @@ TEST(cranking, testFasterEngineSpinningUp) { } static void doTestFasterEngineSpinningUp60_2(int startUpDelayMs, int rpm1, int expectedRpm) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // turn on FasterEngineSpinUp mode engineConfiguration->isFasterEngineSpinUpEnabled = true; diff --git a/unit_tests/tests/trigger/test_injection_scheduling.cpp b/unit_tests/tests/trigger/test_injection_scheduling.cpp index 26228e9c51..1a48c16547 100644 --- a/unit_tests/tests/trigger/test_injection_scheduling.cpp +++ b/unit_tests/tests/trigger/test_injection_scheduling.cpp @@ -9,7 +9,7 @@ using ::testing::InSequence; TEST(injectionScheduling, InjectionIsScheduled) { StrictMock mockExec; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engine->executor.setMockExecutor(&mockExec); efitick_t nowNt = 1000000; @@ -49,7 +49,7 @@ TEST(injectionScheduling, InjectionIsScheduled) { TEST(injectionScheduling, InjectionIsScheduledBeforeWraparound) { StrictMock mockExec; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engine->executor.setMockExecutor(&mockExec); efitick_t nowNt = 1000000; @@ -88,7 +88,7 @@ TEST(injectionScheduling, InjectionIsScheduledBeforeWraparound) { TEST(injectionScheduling, InjectionIsScheduledAfterWraparound) { StrictMock mockExec; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engine->executor.setMockExecutor(&mockExec); efitick_t nowNt = 1000000; @@ -128,7 +128,7 @@ TEST(injectionScheduling, InjectionNotScheduled) { // StrictMock since we expect no scheduler calls! StrictMock mockExec; - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engine->executor.setMockExecutor(&mockExec); efitick_t nowNt = 1000000; diff --git a/unit_tests/tests/trigger/test_map_cam.cpp b/unit_tests/tests/trigger/test_map_cam.cpp index 549c1596a7..56d7020361 100644 --- a/unit_tests/tests/trigger/test_map_cam.cpp +++ b/unit_tests/tests/trigger/test_map_cam.cpp @@ -6,7 +6,7 @@ TEST(trigger, map_cam_by_magic_point) { - EngineTestHelper eth(TEST_CRANK_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_CRANK_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = false; engineConfiguration->camInputs[0] = Gpio::A0; diff --git a/unit_tests/tests/trigger/test_miata_na_tdc.cpp b/unit_tests/tests/trigger/test_miata_na_tdc.cpp index 19aeee28fa..64b3223ede 100644 --- a/unit_tests/tests/trigger/test_miata_na_tdc.cpp +++ b/unit_tests/tests/trigger/test_miata_na_tdc.cpp @@ -4,7 +4,7 @@ #include "trigger_emulator_algo.h" TEST(miata, miata_na_tdc) { - EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP); + EngineTestHelper eth(engine_type_e::FRANKENSO_MIATA_NA6_MAP); engineConfiguration->alwaysInstantRpm = true; #define TEST_REVOLUTIONS 6 diff --git a/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp b/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp index b7bbd4203b..9304c84c47 100644 --- a/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp +++ b/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp @@ -71,7 +71,7 @@ TEST(nissan, vq_vvt) { // hold a reference to the heap allocated scheduling events until the test is done std::vector> ptrs; - EngineTestHelper eth (HELLEN_121_NISSAN_6_CYL); + EngineTestHelper eth (engine_type_e::HELLEN_121_NISSAN_6_CYL); engineConfiguration->isFasterEngineSpinUpEnabled = false; engineConfiguration->isIgnitionEnabled = false; engineConfiguration->isInjectionEnabled = false; diff --git a/unit_tests/tests/trigger/test_override_gaps.cpp b/unit_tests/tests/trigger/test_override_gaps.cpp index e7fbad3f72..0b36df403c 100644 --- a/unit_tests/tests/trigger/test_override_gaps.cpp +++ b/unit_tests/tests/trigger/test_override_gaps.cpp @@ -8,7 +8,7 @@ #include "pch.h" TEST(subaru, overrideGap) { - EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP); + EngineTestHelper eth(engine_type_e::FRANKENSO_MIATA_NA6_MAP); engineConfiguration->overrideTriggerGaps = true; engineConfiguration->gapTrackingLengthOverride = 2; diff --git a/unit_tests/tests/trigger/test_quad_cam.cpp b/unit_tests/tests/trigger/test_quad_cam.cpp index 16ed3f1ea4..ff20938e3e 100644 --- a/unit_tests/tests/trigger/test_quad_cam.cpp +++ b/unit_tests/tests/trigger/test_quad_cam.cpp @@ -7,7 +7,7 @@ TEST(trigger, testQuadCam) { // setting some weird engine - EngineTestHelper eth(FORD_ESCORT_GT); + EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT); engineConfiguration->isFasterEngineSpinUpEnabled = false; engineConfiguration->alwaysInstantRpm = true; diff --git a/unit_tests/tests/trigger/test_real_4b11.cpp b/unit_tests/tests/trigger/test_real_4b11.cpp index fbac02eadb..34557347ac 100644 --- a/unit_tests/tests/trigger/test_real_4b11.cpp +++ b/unit_tests/tests/trigger/test_real_4b11.cpp @@ -10,7 +10,7 @@ TEST(real4b11, running) { CsvReader reader(1, /* vvtCount */ 0); reader.open("tests/trigger/resources/4b11-running.csv"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; @@ -46,7 +46,7 @@ TEST(real4b11, runningDoubledEdge) { // This log has an extra duplicate edge at 5.393782 seconds (hand added) reader.open("tests/trigger/resources/4b11-running-doubled-edge.csv"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; diff --git a/unit_tests/tests/trigger/test_real_4g93.cpp b/unit_tests/tests/trigger/test_real_4g93.cpp index d74d6c2ca7..7f97cb7d66 100644 --- a/unit_tests/tests/trigger/test_real_4g93.cpp +++ b/unit_tests/tests/trigger/test_real_4g93.cpp @@ -10,7 +10,7 @@ TEST(real4g93, cranking) { CsvReader reader(1, /* vvtCount */ 1); reader.open("tests/trigger/resources/4g93-cranking.csv"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; @@ -73,7 +73,7 @@ TEST(real4g93, crankingOn11) { CsvReader reader(2, /* vvtCount */ 0); reader.open("tests/trigger/resources/4g93-cranking.csv"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->isPhaseSyncRequiredForIgnition = true; @@ -102,7 +102,7 @@ TEST(real4g93, crankingCamOnly) { CsvReader reader(1, /* vvtCount */ 0); reader.open("tests/trigger/resources/4g93-cranking-cam-only.csv"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; diff --git a/unit_tests/tests/trigger/test_real_cranking_miata_NA.cpp b/unit_tests/tests/trigger/test_real_cranking_miata_NA.cpp index 0694f216d7..97de4d2dd9 100644 --- a/unit_tests/tests/trigger/test_real_cranking_miata_NA.cpp +++ b/unit_tests/tests/trigger/test_real_cranking_miata_NA.cpp @@ -15,7 +15,7 @@ TEST(cranking, realCrankingFromFile) { // this logic data file has first trigger channel in second column and second trigger channel in first column reader.open("tests/trigger/resources/cranking_na_3.csv", REVERSE_ORDER); - EngineTestHelper eth (FRANKENSO_MIATA_NA6_MAP); + EngineTestHelper eth (engine_type_e::FRANKENSO_MIATA_NA6_MAP); engineConfiguration->alwaysInstantRpm = true; ssize_t read; diff --git a/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp b/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp index e066bb3f24..28661cfecc 100644 --- a/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp +++ b/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp @@ -35,7 +35,7 @@ static void fireTriggerEvent(EngineTestHelper*eth, double timestampS, TriggerWhe } TEST(cranking, hardcodedRealCranking) { - EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP); + EngineTestHelper eth(engine_type_e::FRANKENSO_MIATA_NA6_MAP); engineConfiguration->alwaysInstantRpm = true; #define EVENT(timestamp, channel, value) { fireTriggerEvent(ð, timestamp, channel, value); } @@ -169,7 +169,7 @@ TEST(cranking, naCrankFromFile) { CsvReader reader(2, /* vvtCount */ 0); reader.open("tests/trigger/resources/cranking_na_4.csv", REVERSE_ORDER); - EngineTestHelper eth(FRANKENSO_MIATA_NA6_MAP); + EngineTestHelper eth(engine_type_e::FRANKENSO_MIATA_NA6_MAP); engineConfiguration->alwaysInstantRpm = true; while (reader.haveMore()) { diff --git a/unit_tests/tests/trigger/test_real_cranking_nissan_vq40.cpp b/unit_tests/tests/trigger/test_real_cranking_nissan_vq40.cpp index 26b6c2fccf..6dfc2e5763 100644 --- a/unit_tests/tests/trigger/test_real_cranking_nissan_vq40.cpp +++ b/unit_tests/tests/trigger/test_real_cranking_nissan_vq40.cpp @@ -12,7 +12,7 @@ static void test(int engineSyncCam, float camOffsetAdd) { CsvReader reader(1, /* vvtCount */ 2); reader.open("tests/trigger/resources/nissan_vq40_cranking-1.csv"); - EngineTestHelper eth (HELLEN_121_NISSAN_6_CYL); + EngineTestHelper eth (engine_type_e::HELLEN_121_NISSAN_6_CYL); engineConfiguration->isFasterEngineSpinUpEnabled = false; engineConfiguration->alwaysInstantRpm = true; diff --git a/unit_tests/tests/trigger/test_real_gm_24x.cpp b/unit_tests/tests/trigger/test_real_gm_24x.cpp index 47922e19a0..74961c2f56 100644 --- a/unit_tests/tests/trigger/test_real_gm_24x.cpp +++ b/unit_tests/tests/trigger/test_real_gm_24x.cpp @@ -6,7 +6,7 @@ TEST(crankingGm24x, gmRealCrankingFromFile) { CsvReader reader(1, /* vvtCount */ 0); reader.open("tests/trigger/resources/gm_24x_cranking.csv"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; diff --git a/unit_tests/tests/trigger/test_real_k20.cpp b/unit_tests/tests/trigger/test_real_k20.cpp index 12654b8dd9..a1b98e5f5d 100644 --- a/unit_tests/tests/trigger/test_real_k20.cpp +++ b/unit_tests/tests/trigger/test_real_k20.cpp @@ -12,7 +12,7 @@ TEST(realk20, cranking) { reader.open("tests/trigger/resources/civic-K20-cranking.csv", NORMAL_ORDER, REVERSE_ORDER); reader.twoBanksSingleCamMode = false; - EngineTestHelper eth (PROTEUS_HONDA_K); + EngineTestHelper eth (engine_type_e::PROTEUS_HONDA_K); while (reader.haveMore()) { reader.processLine(ð); diff --git a/unit_tests/tests/trigger/test_real_k24a2.cpp b/unit_tests/tests/trigger/test_real_k24a2.cpp index a18ac0c721..7dc0d07848 100644 --- a/unit_tests/tests/trigger/test_real_k24a2.cpp +++ b/unit_tests/tests/trigger/test_real_k24a2.cpp @@ -6,7 +6,7 @@ static void doTest(const char* testFile, int expectedRpm) { CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 0); reader.open(testFile); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = true; engineConfiguration->alwaysInstantRpm = true; diff --git a/unit_tests/tests/trigger/test_real_nb2_cranking.cpp b/unit_tests/tests/trigger/test_real_nb2_cranking.cpp index 12dbf7b5df..8cee0e214d 100644 --- a/unit_tests/tests/trigger/test_real_nb2_cranking.cpp +++ b/unit_tests/tests/trigger/test_real_nb2_cranking.cpp @@ -12,7 +12,7 @@ TEST(realCrankingNB2, normalCranking) { CsvReader reader(1, /* vvtCount */ 1); reader.open("tests/trigger/resources/nb2-cranking-good.csv"); - EngineTestHelper eth (HELLEN_NB2); + EngineTestHelper eth (engine_type_e::HELLEN_NB2); engineConfiguration->alwaysInstantRpm = true; while (reader.haveMore()) { @@ -37,7 +37,7 @@ TEST(realCrankingNB2, crankingMissingInjector) { CsvReader reader(1, /* vvtCount */ 1); reader.open("tests/trigger/resources/nb2-cranking-good-missing-injector-1.csv"); - EngineTestHelper eth (HELLEN_NB2); + EngineTestHelper eth (engine_type_e::HELLEN_NB2); engineConfiguration->alwaysInstantRpm = true; while (reader.haveMore()) { diff --git a/unit_tests/tests/trigger/test_real_volkswagen.cpp b/unit_tests/tests/trigger/test_real_volkswagen.cpp index 2d6160fe19..837c2a30d4 100644 --- a/unit_tests/tests/trigger/test_real_volkswagen.cpp +++ b/unit_tests/tests/trigger/test_real_volkswagen.cpp @@ -13,7 +13,7 @@ TEST(crankingVW, vwRealCrankingFromFile) { CsvReader reader(1, /* vvtCount */ 0); reader.open("tests/trigger/resources/nick_1.csv"); - EngineTestHelper eth (VW_ABA); + EngineTestHelper eth (engine_type_e::VW_ABA); engineConfiguration->alwaysInstantRpm = true; eth.setTriggerType(TT_60_2_VW); @@ -26,7 +26,7 @@ TEST(crankingVW, vwRealCrankingFromFile) { } TEST(crankingVW, crankingTwiceWithGap) { - EngineTestHelper eth (VW_ABA); + EngineTestHelper eth (engine_type_e::VW_ABA); engineConfiguration->alwaysInstantRpm = true; eth.setTriggerType(TT_60_2_VW); diff --git a/unit_tests/tests/trigger/test_rpm_multiplier.cpp b/unit_tests/tests/trigger/test_rpm_multiplier.cpp index 02c4d3b978..bfde6abe9b 100644 --- a/unit_tests/tests/trigger/test_rpm_multiplier.cpp +++ b/unit_tests/tests/trigger/test_rpm_multiplier.cpp @@ -10,7 +10,7 @@ #include "pch.h" static void runRpmTest(bool isTwoStroke, bool isCam, int expected) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->twoStroke = isTwoStroke; engineConfiguration->skippedWheelOnCam = isCam; eth.setTriggerType(TT_ONE); diff --git a/unit_tests/tests/trigger/test_symmetrical_crank.cpp b/unit_tests/tests/trigger/test_symmetrical_crank.cpp index f337b18f32..fb08a51ce7 100644 --- a/unit_tests/tests/trigger/test_symmetrical_crank.cpp +++ b/unit_tests/tests/trigger/test_symmetrical_crank.cpp @@ -15,7 +15,7 @@ static void postFourEvents(EngineTestHelper *eth, float mult) { } TEST(engine, testAngleLogicInSymmetricalCrankIssue2980) { - EngineTestHelper eth(FRANKENSO_MAZDA_MIATA_2003); + EngineTestHelper eth(engine_type_e::FRANKENSO_MAZDA_MIATA_2003); TriggerFormDetails *triggerForm = &engine->triggerCentral.triggerFormDetails; @@ -44,7 +44,7 @@ TEST(engine, testAngleLogicInSymmetricalCrankIssue2980) { TEST(engine, testSymmetricalCrank) { - EngineTestHelper eth(FRANKENSO_MAZDA_MIATA_2003); + EngineTestHelper eth(engine_type_e::FRANKENSO_MAZDA_MIATA_2003); // this test is not about isFasterEngineSpinUpEnabled so let's disable it to simplify things engineConfiguration->isFasterEngineSpinUpEnabled = false; diff --git a/unit_tests/tests/trigger/test_trigger_decoder.cpp b/unit_tests/tests/trigger/test_trigger_decoder.cpp index 35fef73696..cd7eb2502b 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -44,7 +44,7 @@ static int getTriggerZeroEventIndex(engine_type_e engineType) { } TEST(trigger, testSkipped2_0) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); // for this test we need a trigger with isSynchronizationNeeded=true engineConfiguration->trigger.customTotalToothCount = 2; engineConfiguration->trigger.customSkippedToothCount = 0; @@ -53,7 +53,7 @@ TEST(trigger, testSkipped2_0) { } TEST(trigger, testSomethingWeird) { - EngineTestHelper eth(FORD_INLINE_6_1995); + EngineTestHelper eth(engine_type_e::FORD_INLINE_6_1995); TriggerDecoderBase state_("test"); TriggerDecoderBase *sta = &state_; @@ -80,9 +80,9 @@ TEST(trigger, testSomethingWeird) { } TEST(trigger, test1995FordInline6TriggerDecoder) { - ASSERT_EQ( 0, getTriggerZeroEventIndex(FORD_INLINE_6_1995)) << "triggerIndex "; + ASSERT_EQ( 0, getTriggerZeroEventIndex(engine_type_e::FORD_INLINE_6_1995)) << "triggerIndex "; - EngineTestHelper eth(FORD_INLINE_6_1995); + EngineTestHelper eth(engine_type_e::FORD_INLINE_6_1995); engineConfiguration->isFasterEngineSpinUpEnabled = false; setWholeTimingTable(-13); @@ -110,7 +110,7 @@ TEST(trigger, test1995FordInline6TriggerDecoder) { } TEST(misc, testGetCoilDutyCycleIssue977) { - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); int rpm = 2000; engine->rpmCalculator.setRpmValue(rpm); @@ -122,9 +122,9 @@ TEST(misc, testGetCoilDutyCycleIssue977) { TEST(misc, testFordAspire) { printf("*************************************************** testFordAspire\r\n"); - ASSERT_EQ( 4, getTriggerZeroEventIndex(FORD_ASPIRE_1996)) << "getTriggerZeroEventIndex"; + ASSERT_EQ( 4, getTriggerZeroEventIndex(engine_type_e::FORD_ASPIRE_1996)) << "getTriggerZeroEventIndex"; - EngineTestHelper eth(FORD_ASPIRE_1996); + EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); ASSERT_EQ( 4, getTriggerCentral()->triggerShape.getTriggerWaveformSynchPointIndex()) << "getTriggerWaveformSynchPointIndex"; @@ -169,7 +169,7 @@ static void assertREqualsM(const char *msg, void *expected, void *actual) { extern bool_t debugSignalExecutor; TEST(misc, testRpmCalculator) { - EngineTestHelper eth(FORD_INLINE_6_1995); + EngineTestHelper eth(engine_type_e::FORD_INLINE_6_1995); setTable(config->injectionPhase, -180.0f); @@ -316,7 +316,7 @@ TEST(misc, testRpmCalculator) { } TEST(trigger, testAnotherTriggerDecoder) { - testTriggerDecoder2("Miata 2003", FRANKENSO_MAZDA_MIATA_2003, 3, 0.38888889, 0.0); + testTriggerDecoder2("Miata 2003", engine_type_e::FRANKENSO_MAZDA_MIATA_2003, 3, 0.38888889, 0.0); } TEST(trigger, testTriggerDecoder) { @@ -338,39 +338,39 @@ TEST(trigger, testTriggerDecoder) { } printf("====================================================================================== testTriggerDecoder part 2\r\n"); - testTriggerDecoder2("Dodge Neon 1995", DODGE_NEON_1995, 0, 0.4931, 0.2070); + testTriggerDecoder2("Dodge Neon 1995", engine_type_e::DODGE_NEON_1995, 0, 0.4931, 0.2070); - testTriggerDecoder2("ford aspire", FORD_ASPIRE_1996, 4, 0.0000, 0.5); + testTriggerDecoder2("ford aspire", engine_type_e::FORD_ASPIRE_1996, 4, 0.0000, 0.5); - testTriggerDecoder2("dodge ram", DODGE_RAM, 16, 0.5000, 0.06); + testTriggerDecoder2("dodge ram", engine_type_e::DODGE_RAM, 16, 0.5000, 0.06); - testTriggerDecoder2("Miata NB2", HELLEN_NB2, 3, 0.3888888955, 0); + testTriggerDecoder2("Miata NB2", engine_type_e::HELLEN_NB2, 3, 0.3888888955, 0); printf("====================================================================================== testTriggerDecoder part 3\r\n"); - testTriggerDecoder2("test 2/1 both", TEST_ISSUE_366_BOTH, 0, 0.2500, 0.0); - testTriggerDecoder2("test 2/1 rise", TEST_ISSUE_366_RISE, 0, 0.0000, 0.0); + testTriggerDecoder2("test 2/1 both", engine_type_e::TEST_ISSUE_366_BOTH, 0, 0.2500, 0.0); + testTriggerDecoder2("test 2/1 rise", engine_type_e::TEST_ISSUE_366_RISE, 0, 0.0000, 0.0); - testTriggerDecoder2("test engine", TEST_ENGINE, 0, 0.7500, 0.2500); - testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0); - testTriggerDecoder2("testSubary", SUBARU_2003_WRX, 0, 0.4000, 0.0); + testTriggerDecoder2("test engine", engine_type_e::TEST_ENGINE, 0, 0.7500, 0.2500); + testTriggerDecoder2("testGY6_139QMB", engine_type_e::GY6_139QMB, 0, 0.4375, 0.0); + testTriggerDecoder2("testSubary", engine_type_e::SUBARU_2003_WRX, 0, 0.4000, 0.0); - testTriggerDecoder2("testFordEscortGt", FORD_ESCORT_GT, 0, 0.8096, 0.3844); + testTriggerDecoder2("testFordEscortGt", engine_type_e::FORD_ESCORT_GT, 0, 0.8096, 0.3844); - testTriggerDecoder2("NISSAN_PRIMERA", NISSAN_PRIMERA, 2, 0.9611, 0.0); + testTriggerDecoder2("NISSAN_PRIMERA", engine_type_e::NISSAN_PRIMERA, 2, 0.9611, 0.0); - testTriggerDecoder2("test1+1", DEFAULT_FRANKENSO, 0, 0.7500, 0.2500); + testTriggerDecoder2("test1+1", engine_type_e::DEFAULT_FRANKENSO, 0, 0.7500, 0.2500); - testTriggerDecoder2("testCitroen", CITROEN_TU3JP, 0, 0.4833, 0); + testTriggerDecoder2("testCitroen", engine_type_e::CITROEN_TU3JP, 0, 0.4833, 0); - testTriggerDecoder2("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0, 2.9994); + testTriggerDecoder2("citroen", engine_type_e::CITROEN_TU3JP, 0, 0.4833, 0.0, 2.9994); - testTriggerDecoder2("CAMARO_4", CAMARO_4, 40, 0.5, 0); + testTriggerDecoder2("CAMARO_4", engine_type_e::CAMARO_4, 40, 0.5, 0); - testTriggerDecoder2("neon NGC4", DODGE_NEON_2003_CRANK, 6, 0.5000, 0.0, CHRYSLER_NGC4_GAP); + testTriggerDecoder2("neon NGC4", engine_type_e::DODGE_NEON_2003_CRANK, 6, 0.5000, 0.0, CHRYSLER_NGC4_GAP); { - EngineTestHelper eth(DODGE_NEON_2003_CRANK); + EngineTestHelper eth(engine_type_e::DODGE_NEON_2003_CRANK); printf("!!!!!!!!!!!!!!!!!! Now trying with only rising edges !!!!!!!!!!!!!!!!!\r\n"); @@ -379,9 +379,9 @@ TEST(trigger, testTriggerDecoder) { } - testTriggerDecoder2("sachs", SACHS, 0, 0.4800, 0.000); + testTriggerDecoder2("sachs", engine_type_e::SACHS, 0, 0.4800, 0.000); - testTriggerDecoder2("vw ABA", VW_ABA, 0, 0.51666, 0.0); + testTriggerDecoder2("vw ABA", engine_type_e::VW_ABA, 0, 0.51666, 0.0); } static void assertInjectionEventBase(const char *msg, InjectionEvent *ev, int injectorIndex, int eventIndex, angle_t angleOffset) { @@ -530,7 +530,7 @@ static void setArray(float* p, size_t count, float value) { void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) { printf("*************************************************** testFuelSchedulerBug299 small to medium\r\n"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->injectionPhase, -180.0f); engineConfiguration->isFasterEngineSpinUpEnabled = false; engine->tdcMarkEnabled = false; @@ -778,7 +778,7 @@ TEST(big, testFuelSchedulerBug299smallAndMedium) { } TEST(big, testTwoWireBatch) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->injectionPhase, -180.0f); setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð); EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) @@ -807,7 +807,7 @@ TEST(big, testTwoWireBatch) { TEST(big, testSequential) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->injectionPhase, -180.0f); EXPECT_CALL(*eth.mockAirmass, getAirmass(_, _)) .WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f})); @@ -835,7 +835,7 @@ TEST(big, testSequential) { } TEST(big, testFuelSchedulerBug299smallAndLarge) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); setTable(config->injectionPhase, -180.0f); engineConfiguration->isFasterEngineSpinUpEnabled = false; engine->tdcMarkEnabled = false; @@ -954,7 +954,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) { TEST(big, testSparkReverseOrderBug319) { printf("*************************************************** testSparkReverseOrderBug319 small to medium\r\n"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->isFasterEngineSpinUpEnabled = false; engine->tdcMarkEnabled = false; @@ -1059,7 +1059,7 @@ TEST(big, testSparkReverseOrderBug319) { TEST(big, testMissedSpark299) { printf("*************************************************** testMissedSpark299\r\n"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->ignitionMode = IM_WASTED_SPARK; setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð); engineConfiguration->isIgnitionEnabled = true; diff --git a/unit_tests/tests/trigger/test_trigger_input_adc.cpp b/unit_tests/tests/trigger/test_trigger_input_adc.cpp index 89ef0d77c3..2632c29aad 100644 --- a/unit_tests/tests/trigger/test_trigger_input_adc.cpp +++ b/unit_tests/tests/trigger/test_trigger_input_adc.cpp @@ -72,7 +72,7 @@ static void simulateTrigger(TriggerAdcDetector &trigAdcState, CsvReader &reader, TEST(big, testTriggerInputAdc) { printf("====================================================================================== testTriggerInputAdc\r\n"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->ignitionMode = IM_WASTED_SPARK; diff --git a/unit_tests/tests/trigger/test_trigger_noiseless.cpp b/unit_tests/tests/trigger/test_trigger_noiseless.cpp index bed81393a4..4b88115b44 100644 --- a/unit_tests/tests/trigger/test_trigger_noiseless.cpp +++ b/unit_tests/tests/trigger/test_trigger_noiseless.cpp @@ -161,7 +161,7 @@ static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorTolera TEST(trigger, noiselessDecoder) { printf("====================================================================================== testNoiselessDecoder\r\n"); - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->ignitionMode = IM_WASTED_SPARK; diff --git a/unit_tests/tests/trigger/test_trigger_skipped_wheel.cpp b/unit_tests/tests/trigger/test_trigger_skipped_wheel.cpp index 1db114e74a..0cad4f580a 100644 --- a/unit_tests/tests/trigger/test_trigger_skipped_wheel.cpp +++ b/unit_tests/tests/trigger/test_trigger_skipped_wheel.cpp @@ -3,7 +3,7 @@ #include "trigger_decoder.h" TEST(trigger, testCustomSkipped) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); engineConfiguration->trigger.customTotalToothCount = 24; engineConfiguration->trigger.customSkippedToothCount = 2; diff --git a/unit_tests/tests/util/test_timer.cpp b/unit_tests/tests/util/test_timer.cpp index bfbf24c838..cc7785b2d4 100644 --- a/unit_tests/tests/util/test_timer.cpp +++ b/unit_tests/tests/util/test_timer.cpp @@ -2,7 +2,7 @@ #include "timer.h" TEST(util, timer) { - EngineTestHelper eth(TEST_ENGINE); + EngineTestHelper eth(engine_type_e::TEST_ENGINE); Timer timer; ASSERT_TRUE(timer.hasElapsedSec(3)); timer.reset();