Line | Branch | Decision | Exec | Source |
---|---|---|---|---|
1 | /* | |||
2 | * @file test_change_engine_type.cpp | |||
3 | * | |||
4 | * @date Jul 14, 2021 | |||
5 | * @author Andrey Belomutskiy, (c) 2012-2021 | |||
6 | */ | |||
7 | ||||
8 | #include "pch.h" | |||
9 | ||||
10 | extern engine_configuration_s & activeConfiguration; | |||
11 | ||||
12 | 4 | TEST(misc, changeEngineType) { | ||
13 | /** | |||
14 | * this configuration has hpfpValvePin defined | |||
15 | */ | |||
16 |
1/1✓ Branch 2 taken 1 time.
|
1 | EngineTestHelper eth(engine_type_e::HYUNDAI_PB); | |
17 | ||||
18 | 1 | brain_pin_e brainPin = engineConfiguration->hpfpValvePin; | ||
19 |
2/8✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 18 not taken.
✗ Branch 21 not taken.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
|
1 | ASSERT_TRUE(brainPin != Gpio::Unassigned); | |
20 |
2/8✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 18 not taken.
✗ Branch 21 not taken.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
|
1 | ASSERT_TRUE(activeConfiguration.hpfpValvePin != Gpio::Unassigned); | |
21 | ||||
22 |
3/9✓ Branch 3 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 time.
✗ Branch 12 not taken.
✗ Branch 17 not taken.
✗ Branch 21 not taken.
✗ Branch 24 not taken.
✓ Branch 33 taken 1 time.
✗ Branch 34 not taken.
|
1 | ASSERT_TRUE(isBrainPinValid(brainPin)); | |
23 | ||||
24 | // above we have asserted that triggerInputDebugPins is in fact used | |||
25 | // now let's change into engine type without hpfpValvePin and assert shut down | |||
26 | ||||
27 |
1/1✓ Branch 1 taken 1 time.
|
1 | setEngineType((int)engine_type_e::DODGE_NEON_1995); | |
28 |
2/8✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 18 not taken.
✗ Branch 21 not taken.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
|
1 | ASSERT_TRUE(activeConfiguration.hpfpValvePin == Gpio::Unassigned); | |
29 | ||||
30 |
2/8✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 18 not taken.
✗ Branch 21 not taken.
✓ Branch 30 taken 1 time.
✗ Branch 31 not taken.
|
1 | ASSERT_TRUE(engineConfiguration->hpfpValvePin == Gpio::Unassigned); | |
31 | ||||
32 |
3/9✓ Branch 3 taken 1 time.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 time.
✗ Branch 12 not taken.
✗ Branch 17 not taken.
✗ Branch 21 not taken.
✗ Branch 24 not taken.
✓ Branch 33 taken 1 time.
✗ Branch 34 not taken.
|
1 | ASSERT_FALSE(isBrainPinValid(engineConfiguration->hpfpValvePin)); | |
33 | 1 | } | ||
34 | ||||
35 |