mirror of https://github.com/rusefi/rusefi.git
unit test compile more of ETB code
This commit is contained in:
parent
e6146d6ee5
commit
4dd9217327
|
@ -1008,11 +1008,9 @@ void initElectronicThrottle() {
|
|||
return;
|
||||
}
|
||||
|
||||
#if !EFI_UNIT_TEST
|
||||
for (int i = 0; i < ETB_COUNT; i++) {
|
||||
engine->etbControllers[i] = etbControllers[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
addConsoleAction("etbinfo", showEtbInfo);
|
||||
|
|
|
@ -31,7 +31,7 @@ TEST(etb, initializationNoPedal) {
|
|||
EXPECT_CALL(mocks[1], init(ETB_Throttle2, _, _, _, false)).WillOnce(Return(false));
|
||||
|
||||
// This shouldn't throw, since no throttles are configured, but no pedal is configured either
|
||||
EXPECT_NO_FATAL_ERROR(initElectronicThrottle());
|
||||
EXPECT_NO_FATAL_ERROR(doInitElectronicThrottle());
|
||||
}
|
||||
|
||||
TEST(etb, initializationMissingThrottle) {
|
||||
|
@ -54,7 +54,7 @@ TEST(etb, initializationMissingThrottle) {
|
|||
Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 0);
|
||||
|
||||
// This should throw: a pedal is configured but no throttles
|
||||
EXPECT_FATAL_ERROR(initElectronicThrottle());
|
||||
EXPECT_FATAL_ERROR(doInitElectronicThrottle());
|
||||
}
|
||||
|
||||
TEST(etb, initializationSingleThrottle) {
|
||||
|
@ -79,7 +79,7 @@ TEST(etb, initializationSingleThrottle) {
|
|||
// Expect mock1 to be init as none
|
||||
EXPECT_CALL(mocks[1], init(ETB_None, _, _, _, true)).Times(0);
|
||||
|
||||
initElectronicThrottle();
|
||||
doInitElectronicThrottle();
|
||||
}
|
||||
|
||||
TEST(etb, initializationSingleThrottleInSecondSlot) {
|
||||
|
@ -104,7 +104,7 @@ TEST(etb, initializationSingleThrottleInSecondSlot) {
|
|||
// Expect mock1 to be init as throttle 1, and PID params
|
||||
EXPECT_CALL(mocks[1], init(ETB_Throttle1, _, &engineConfiguration->etb, Ne(nullptr), true)).WillOnce(Return(true));
|
||||
|
||||
initElectronicThrottle();
|
||||
doInitElectronicThrottle();
|
||||
}
|
||||
|
||||
TEST(etb, initializationDualThrottle) {
|
||||
|
@ -132,7 +132,7 @@ TEST(etb, initializationDualThrottle) {
|
|||
// Expect mock1 to be init as throttle 2, and PID params
|
||||
EXPECT_CALL(mocks[1], init(ETB_Throttle2, _, &engineConfiguration->etb, Ne(nullptr), true)).WillOnce(Return(true));
|
||||
|
||||
initElectronicThrottle();
|
||||
doInitElectronicThrottle();
|
||||
}
|
||||
|
||||
TEST(etb, initializationWastegate) {
|
||||
|
@ -153,7 +153,7 @@ TEST(etb, initializationWastegate) {
|
|||
// Expect mock1 to be init as none
|
||||
EXPECT_CALL(mocks[1], init(ETB_None, _, _, _, false)).Times(0);
|
||||
|
||||
initElectronicThrottle();
|
||||
doInitElectronicThrottle();
|
||||
}
|
||||
|
||||
TEST(etb, initializationNoFunction) {
|
||||
|
|
Loading…
Reference in New Issue