| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | // | |||
| 2 | // Created by kifir on 11/4/24. | |||
| 3 | // | |||
| 4 | ||||
| 5 | #include "pch.h" | |||
| 6 | ||||
| 7 | #include "flat_shift_condition_test_base.h" | |||
| 8 | ||||
| 9 | 2 | FlatShiftConditionTestBase::FlatShiftConditionTestBase( | ||
| 10 | const int8_t torqueReductionIgnitionCut, | |||
| 11 | const float torqueReductionIgnitionRetard | |||
| 12 | 4 | ) : m_torqueReductionIgnitionCut(torqueReductionIgnitionCut), | ||
| 13 | 2 | m_torqueReductionIgnitionRetard(torqueReductionIgnitionRetard) { | ||
| 14 | 2 | } | ||
| 15 | ||||
| 16 | 2 | void FlatShiftConditionTestBase::SetUp() { | ||
| 17 | 2 | TestBase::SetUp(); | ||
| 18 | ||||
| 19 |
1/1✓ Branch 2 taken 2 times.
|
6 | setUpEngineConfiguration(EngineConfig() | |
| 20 |
1/1✓ Branch 6 taken 2 times.
|
6 | .setTorqueReductionEnabled(true) | |
| 21 |
1/1✓ Branch 5 taken 2 times.
|
8 | .setTorqueReductionActivationMode(torqueReductionActivationMode_e::TORQUE_REDUCTION_BUTTON) | |
| 22 |
1/1✓ Branch 4 taken 2 times.
|
8 | .setTorqueReductionTriggerPin(TEST_TORQUE_REDUCTION_BUTTON_PIN) | |
| 23 |
1/1✓ Branch 5 taken 2 times.
|
8 | .setLimitTorqueReductionTime(false) | |
| 24 |
1/1✓ Branch 4 taken 2 times.
|
8 | .setTorqueReductionIgnitionCut(m_torqueReductionIgnitionCut) | |
| 25 |
1/1✓ Branch 4 taken 2 times.
|
8 | .setTorqueReductionIgnitionRetard(m_torqueReductionIgnitionRetard) | |
| 26 | ); | |||
| 27 | 2 | } | ||
| 28 | ||||
| 29 | 2 | void FlatShiftConditionTestBase::satisfyFlatShiftCondition() { | ||
| 30 | 2 | setMockState(TEST_TORQUE_REDUCTION_BUTTON_PIN, true); | ||
| 31 |
1/1✓ Branch 3 taken 2 times.
|
2 | updateApp(TEST_TORQUE_REDUCTION_ARMING_APP); | |
| 32 | ||||
| 33 | 2 | periodicFastCallback(); | ||
| 34 | ||||
| 35 |
1/6✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 18 not taken.
✗ Branch 21 not taken.
|
2 | EXPECT_TRUE(engine->shiftTorqueReductionController.isFlatShiftConditionSatisfied); | |
| 36 | 2 | } | ||
| 37 | ||||
| 38 | 2 | void FlatShiftConditionTestBase::unsatisfyFlatShiftCondition() { | ||
| 39 | 2 | setMockState(TEST_TORQUE_REDUCTION_BUTTON_PIN, false); | ||
| 40 | ||||
| 41 | 2 | periodicFastCallback(); | ||
| 42 | ||||
| 43 |
1/6✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 14 not taken.
✗ Branch 18 not taken.
✗ Branch 21 not taken.
|
2 | EXPECT_FALSE(engine->shiftTorqueReductionController.isFlatShiftConditionSatisfied); | |
| 44 | 2 | } | ||
| 45 |