| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | // file test_hd_cranking.cpp | |||
| 2 | ||||
| 3 | #include "pch.h" | |||
| 4 | #include "engine_csv_reader.h" | |||
| 5 | ||||
| 6 | class HdCranking { | |||
| 7 | public: | |||
| 8 | 6 | HdCranking(const char *fileName) : | ||
| 9 |
1/1✓ Branch 2 taken 6 times.
|
6 | reader(1, /* vvtCount */1), eth(engine_type_e::HARLEY) { | |
| 10 | 6 | engineConfiguration->vvtMode[0] = VVT_BOSCH_QUICK_START; | ||
| 11 |
1/1✓ Branch 1 taken 6 times.
|
6 | eth.applyTriggerWaveform(); | |
| 12 |
1/1✓ Branch 1 taken 6 times.
|
6 | reader.open(fileName); | |
| 13 | 6 | } | ||
| 14 | ||||
| 15 | EngineCsvReader reader; | |||
| 16 | EngineTestHelper eth; | |||
| 17 | }; | |||
| 18 | ||||
| 19 | 5 | static void runTest(const char *fileName) { | ||
| 20 |
1/1✓ Branch 2 taken 5 times.
|
5 | HdCranking test(fileName); | |
| 21 | ||||
| 22 | 5 | EngineCsvReader &reader = test.reader; | ||
| 23 | ||||
| 24 |
3/3✓ Branch 1 taken 4895 times.
✓ Branch 3 taken 4890 times.
✓ Branch 4 taken 5 times.
|
0/1? Decision couldn't be analyzed.
|
4895 | while (reader.haveMore()) { |
| 25 |
1/1✓ Branch 1 taken 4890 times.
|
4890 | reader.processLine(&test.eth); | |
| 26 | } | |||
| 27 | 10 | } | ||
| 28 | ||||
| 29 | 4 | TEST(harley, hdCrankingWithCam1) { | ||
| 30 | 1 | runTest("tests/ignition_injection/resources/hd-req-sync_1.csv"); | ||
| 31 | 1 | } | ||
| 32 | ||||
| 33 | 4 | TEST(harley, hdCrankingWithCam3) { | ||
| 34 |
1/1✓ Branch 2 taken 1 time.
|
1 | HdCranking test("tests/ignition_injection/resources/hd-req-sync_3.csv"); | |
| 35 | extern bool unitTestTaskNoFastCallWhileAdvancingTimeHack; | |||
| 36 | 1 | unitTestTaskNoFastCallWhileAdvancingTimeHack = true; | ||
| 37 | ||||
| 38 | 1 | EngineCsvReader &reader = test.reader; | ||
| 39 | ||||
| 40 |
3/3✓ Branch 1 taken 977 times.
✓ Branch 3 taken 976 times.
✓ Branch 4 taken 1 time.
|
0/1? Decision couldn't be analyzed.
|
977 | while (reader.haveMore()) { |
| 41 |
1/1✓ Branch 1 taken 976 times.
|
976 | reader.processLine(&test.eth); | |
| 42 | ||||
| 43 |
1/1✓ Branch 1 taken 976 times.
|
976 | reader.assertFirstRpm(184, 60); | |
| 44 |
1/1✓ Branch 1 taken 976 times.
|
976 | auto rpm = Sensor::getOrZero(SensorType::Rpm); | |
| 45 | ||||
| 46 |
6/6✓ Branch 0 taken 269 times.
✓ Branch 1 taken 707 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 268 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 975 times.
|
2/2✓ Decision 'true' taken 1 time.
✓ Decision 'false' taken 975 times.
|
976 | if (!reader.gotSync && engine->triggerCentral.triggerState.hasSynchronizedPhase()) { |
| 47 |
2/6✓ Branch 5 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 14 not taken.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
|
1 | EXPECT_EQ(reader.lineIndex(), 269); | |
| 48 | 1 | reader.gotSync = true; | ||
| 49 | } | |||
| 50 | ||||
| 51 | 976 | if (reader.gotSync) { | ||
| 52 | // we have loss of sync, interesting! | |||
| 53 | // EXPECT_TRUE(engine->triggerCentral.triggerState.hasSynchronizedPhase()) << "Loss " << reader.lineIndex(); | |||
| 54 | } | |||
| 55 | } | |||
| 56 | ||||
| 57 |
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(2, engine->triggerCentral.triggerState.camResyncCounter); // interesting! | |
| 58 | 1 | } | ||
| 59 | ||||
| 60 | 4 | TEST(harley, hdCrankingWithCam4) { | ||
| 61 | 1 | runTest("tests/ignition_injection/resources/hd-req-sync_4.csv"); | ||
| 62 | 1 | } | ||
| 63 | ||||
| 64 | 4 | TEST(harley, hdCrankingWithCamAnother) { | ||
| 65 | 1 | runTest("tests/ignition_injection/resources/hd-req-sync-another-one_1.csv"); | ||
| 66 | 1 | } | ||
| 67 | ||||
| 68 | 4 | TEST(harley, hdCrankingWithCamAnother2) { | ||
| 69 | 1 | runTest("tests/ignition_injection/resources/hd-req-sync-another-one_2.csv"); | ||
| 70 | 1 | } | ||
| 71 | ||||
| 72 | 4 | TEST(harley, hdCrankingWithCamAnother3) { | ||
| 73 | 1 | runTest("tests/ignition_injection/resources/hd-req-sync-another-one_3.csv"); | ||
| 74 | 1 | } | ||
| 75 |