refactoring: extracting method
This commit is contained in:
parent
3e6003f0ca
commit
9a1c7b36ba
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue