GCC Code Coverage Report


Directory: ./
File: unit_tests/tests/controllers/modules/test_configuration_wizard.cpp
Date: 2025-12-30 16:19:43
Coverage Exec Excl Total
Lines: 100.0% 14 0 14
Functions: 100.0% 6 0 6
Branches: 41.2% 7 0 17
Decisions: -% 0 - 0

Line Branch Decision Exec Source
1 /*
2 * @file test_configuration_wizard.cpp
3 *
4 * @date: nov 11, 2025
5 * @author FDSoftware
6 */
7
8 #include "pch.h"
9 #include "tests/util/test_base.h"
10
11 class ConfigurationWizardTest : public TestBase<> {
12 };
13
14 4 TEST_F(ConfigurationWizardTest, VinEmptyMismatch_ShouldOpenVehicleInfoPanel) {
15 // given: VIN string is empty,and we aren't running another wizard
16 1 strcpy(engineConfiguration->vinNumber, "");
17 1 engineConfiguration->wizardPanelToShow = -1;
18
19 // when
20 1 ConfigurationWizard::onConfigOnStartUpOrBurn(false);
21
22 // then: VIN becomes empty and wizard panel set to Vehicle Information
23
4/9
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 14 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 29 taken 1 time.
✗ Branch 30 not taken.
1 ASSERT_EQ(djb2lowerCase(DIALOG_NAME_VEHICLE_INFORMATION), engineConfiguration->wizardPanelToShow);
24 }
25
26 4 TEST_F(ConfigurationWizardTest, IsRunningOnBurn_ShouldNotChangeStateOrPanel) {
27 // given: mismatch, but running on burn should suppress changes
28 1 strcpy(engineConfiguration->vinNumber, "");
29 1 engineConfiguration->wizardPanelToShow = -1;
30
31 // when
32 1 ConfigurationWizard::onConfigOnStartUpOrBurn(true);
33
34 // then: no changes applied
35
3/8
✓ Branch 3 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 time.
✗ Branch 11 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 26 taken 1 time.
✗ Branch 27 not taken.
1 ASSERT_EQ(-1, engineConfiguration->wizardPanelToShow);
36 }
37
38 TEST_F(ConfigurationWizardTest, NoStateChange_ShouldNotTouchPanel) {
39 // given: already empty VIN state
40 strcpy(engineConfiguration->vinNumber, "");
41 engineConfiguration->wizardPanelToShow = 99;
42
43 // when
44 ConfigurationWizard::onConfigOnStartUpOrBurn(false);
45
46 // then: panel remains unchanged
47 ASSERT_EQ(99, engineConfiguration->wizardPanelToShow);
48 }
49