GCC Code Coverage Report


Directory: ./
File: unit_tests/tests/trigger/test_real_ford_coyote.cpp
Date: 2025-11-16 14:52:24
Warnings: 2 unchecked decisions!
Coverage Exec Excl Total
Lines: 100.0% 46 0 46
Functions: 100.0% 11 0 11
Branches: 58.6% 34 0 58
Decisions: 0.0% 0 - 4

Line Branch Decision Exec Source
1 #include "pch.h"
2
3 #include "logicdata_csv_reader.h"
4
5 1 static void runCoyoteIntakeCam(bool invertPrimaryTriggerSignal, uint32_t warningCount, int rpm) {
6
1/1
✓ Branch 2 taken 1 time.
1 CsvReader reader(1, /* vvtCount */ 0);
7
8
1/1
✓ Branch 1 taken 1 time.
1 reader.open("tests/trigger/resources/ford-coyote-intake-cam.csv");
9
10
1/1
✓ Branch 2 taken 1 time.
1 EngineTestHelper eth(engine_type_e::TEST_ENGINE);
11
1/1
✓ Branch 1 taken 1 time.
1 eth.setTriggerType(trigger_type_e::TT_VVT_FORD_COYOTE);
12 extern bool unitTestTaskNoFastCallWhileAdvancingTimeHack;
13 1 unitTestTaskNoFastCallWhileAdvancingTimeHack = true;
14
15 1 engineConfiguration->isFasterEngineSpinUpEnabled = true;
16 1 engineConfiguration->alwaysInstantRpm = true;
17 1 reader.flipOnRead = invertPrimaryTriggerSignal;
18
19
20
1/1
✓ Branch 1 taken 1 time.
1 printf("Reading intake %d...\n", invertPrimaryTriggerSignal);
21
3/3
✓ Branch 1 taken 1980 times.
✓ Branch 3 taken 1979 times.
✓ Branch 4 taken 1 time.
0/1
? Decision couldn't be analyzed.
1980 while (reader.haveMore()) {
22
1/1
✓ Branch 1 taken 1979 times.
1979 reader.processLine(&eth);
23 }
24
25
4/10
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 15 not taken.
✗ Branch 18 not taken.
✗ Branch 23 not taken.
✗ Branch 26 not taken.
✓ Branch 33 taken 1 time.
✗ Branch 34 not taken.
1 ASSERT_EQ( warningCount, eth.recentWarnings()->getCount())<< "warningCounter#intakeCam";
26
4/10
✓ 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 24 not taken.
✗ Branch 27 not taken.
✓ Branch 35 taken 1 time.
✗ Branch 36 not taken.
1 ASSERT_EQ( rpm, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
27 1 }
28
29 4 TEST(fordCoyote, intakeCam) {
30 1 runCoyoteIntakeCam(false, 1, 1093);
31 1 }
32
33 2 static void runCoyoteExhaustCam(bool invertPrimaryTriggerSignal, uint32_t warningCount, int rpm) {
34
1/1
✓ Branch 2 taken 2 times.
2 CsvReader reader(1, /* vvtCount */ 0);
35
36
1/1
✓ Branch 1 taken 2 times.
2 reader.open("tests/trigger/resources/ford-coyote-exhaust-cam.csv");
37
38
1/1
✓ Branch 2 taken 2 times.
2 EngineTestHelper eth(engine_type_e::TEST_ENGINE);
39
1/1
✓ Branch 1 taken 2 times.
2 eth.setTriggerType(trigger_type_e::TT_VVT_FORD_COYOTE);
40 extern bool unitTestTaskNoFastCallWhileAdvancingTimeHack;
41 2 unitTestTaskNoFastCallWhileAdvancingTimeHack = true;
42
43 2 engineConfiguration->isFasterEngineSpinUpEnabled = true;
44 2 reader.flipOnRead = invertPrimaryTriggerSignal;
45 2 engineConfiguration->alwaysInstantRpm = true;
46
47
1/1
✓ Branch 1 taken 2 times.
2 printf("Reading exhaust...\n");
48
3/3
✓ Branch 1 taken 3962 times.
✓ Branch 3 taken 3960 times.
✓ Branch 4 taken 2 times.
0/1
? Decision couldn't be analyzed.
3962 while (reader.haveMore()) {
49
1/1
✓ Branch 1 taken 3960 times.
3960 reader.processLine(&eth);
50 }
51
52
4/10
✓ Branch 3 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 15 not taken.
✗ Branch 18 not taken.
✗ Branch 23 not taken.
✗ Branch 26 not taken.
✓ Branch 33 taken 2 times.
✗ Branch 34 not taken.
2 ASSERT_EQ(warningCount, eth.recentWarnings()->getCount())<< "warningCounter#exhaustCam";
53
4/10
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 14 not taken.
✗ Branch 19 not taken.
✗ Branch 24 not taken.
✗ Branch 27 not taken.
✓ Branch 35 taken 2 times.
✗ Branch 36 not taken.
2 ASSERT_EQ(rpm, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
54 2 }
55
56 4 TEST(fordCoyote, exhaustCam) {
57 1 runCoyoteExhaustCam(false, 1, 1093);
58 1 }
59
60 4 TEST(fordCoyote, exhaustCamInverted) {
61 extern bool unitTestTaskPrecisionHack;
62 1 unitTestTaskPrecisionHack = true;
63 // C9002, C9007, C9008
64 1 runCoyoteExhaustCam(true, 3, 1046);
65 1 }
66