diff --git a/unit_tests/tests/actuators/test_etb_integrated.cpp b/unit_tests/tests/actuators/test_etb_integrated.cpp index a477fb6051..eb6c65f285 100644 --- a/unit_tests/tests/actuators/test_etb_integrated.cpp +++ b/unit_tests/tests/actuators/test_etb_integrated.cpp @@ -3,8 +3,7 @@ #include "electronic_throttle_impl.h" #include "live_data.h" -TEST(etb, integrated) { - EngineTestHelper eth(TEST_ENGINE); +static EtbController * initEtbIntegratedTest() { etbPidReset(); // ETB controlles are global shared instances :( engineConfiguration->tps1_1AdcChannel = EFI_ADC_3; @@ -20,8 +19,13 @@ TEST(etb, integrated) { initTps(); doInitElectronicThrottle(); + return (EtbController*)engine->etbControllers[0]; +} + +TEST(etb, integrated) { + EngineTestHelper eth(TEST_ENGINE); // we have a distractor so cannot move EngineTestHelper into utility method + EtbController *etb = initEtbIntegratedTest(); - EtbController *etb = (EtbController*)engine->etbControllers[0]; etb->update(); ASSERT_EQ(engine->outputChannels.etbTarget, 40); @@ -38,3 +42,17 @@ TEST(etb, integrated) { copyRange((uint8_t*)&destination, getLiveDataFragments(), offset, sizeof(destination)); ASSERT_EQ(destination, -75); } + + + +TEST(etb, integratedTpsJitter) { + EngineTestHelper eth(TEST_ENGINE); // we have a distractor so cannot move EngineTestHelper into utility method + EtbController *etb = initEtbIntegratedTest(); + + ASSERT_FALSE(isTps1Error()); + ASSERT_FALSE(isTps2Error()); + ASSERT_FALSE(isPedalError()); + + etb->update(); + +}