GCC Code Coverage Report


Directory: ./
File: unit_tests/mocks.cpp
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 78.6% 22 0 28
Functions: 78.6% 22 0 28
Branches: 100.0% 35 0 35
Decisions: -% 0 - 0

Line Branch Decision Exec Source
1 #include "pch.h"
2
3 // Constructors/destructors for all mocks live here. If they only exist
4 // in the header (ie, implicitely defined), then that code has to be generated
5 // in every cpp file, instead of generating them only once, which we do here.
6
7 // See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#making-the-compilation-faster
8 /*
9 * Note: if you are mocking an EngineModule to test *another* EngineModule
10 * both have to be mocked and not have references to unmock().etc,
11 * otherwise they will end up pointing to different places and you will have unexpected results!
12 *
13 * ex:
14 * HpfpController hpfp;
15 * engine->engineModules.get<HpfpController>().set(&hpfp);
16 * LimpManager dut;
17 * engine->engineModules.get<LimpManager>().set(&dut);
18 */
19
20
14/14
✓ Branch 3 taken 16 times.
✓ Branch 6 taken 16 times.
✓ Branch 9 taken 16 times.
✓ Branch 12 taken 16 times.
✓ Branch 15 taken 16 times.
✓ Branch 18 taken 16 times.
✓ Branch 21 taken 16 times.
✓ Branch 24 taken 16 times.
✓ Branch 27 taken 16 times.
✓ Branch 30 taken 16 times.
✓ Branch 33 taken 16 times.
✓ Branch 36 taken 16 times.
✓ Branch 39 taken 16 times.
✓ Branch 42 taken 16 times.
16 MockEtb::MockEtb() { }
21 16 MockEtb::~MockEtb() { }
22
23
4/4
✓ Branch 3 taken 8 times.
✓ Branch 6 taken 8 times.
✓ Branch 9 taken 8 times.
✓ Branch 12 taken 8 times.
8 MockMotor::MockMotor() { }
24 8 MockMotor::~MockMotor() { }
25
26 605 MockVp3d::MockVp3d() { }
27 605 MockVp3d::~MockVp3d() { }
28
29 16 MockPwm::MockPwm() { }
30 16 MockPwm::~MockPwm() { }
31
32 9 MockOutputPin::MockOutputPin() { }
33 9 MockOutputPin::~MockOutputPin() { }
34
35
2/2
✓ Branch 2 taken 7 times.
✓ Branch 5 taken 7 times.
7 MockExecutor::MockExecutor() { }
36 7 MockExecutor::~MockExecutor() { }
37
38
1/1
✓ Branch 3 taken 584 times.
584 MockAirmass::MockAirmass() : AirmassVeModelBase(veTable) { }
39 584 MockAirmass::~MockAirmass() { }
40
41
3/3
✓ Branch 3 taken 12 times.
✓ Branch 6 taken 12 times.
✓ Branch 9 taken 12 times.
12 MockInjectorModel2::MockInjectorModel2() { }
42 12 MockInjectorModel2::~MockInjectorModel2() { }
43
44 MockStepperHardware::MockStepperHardware() { }
45 MockStepperHardware::~MockStepperHardware() { }
46
47
1/1
✓ Branch 3 taken 1 time.
1 MockTsChannel::MockTsChannel() : TsChannelBase("mock") { }
48 1 MockTsChannel::~MockTsChannel() { }
49
50
10/10
✓ Branch 3 taken 6 times.
✓ Branch 6 taken 6 times.
✓ Branch 9 taken 6 times.
✓ Branch 12 taken 6 times.
✓ Branch 15 taken 6 times.
✓ Branch 18 taken 6 times.
✓ Branch 21 taken 6 times.
✓ Branch 24 taken 6 times.
✓ Branch 27 taken 6 times.
✓ Branch 30 taken 6 times.
6 MockIdleController::MockIdleController() { }
51 6 MockIdleController::~MockIdleController() { }
52
53 1 MockIgnitionController::MockIgnitionController() { }
54 1 MockIgnitionController::~MockIgnitionController() { }
55
56 MockHpfpController::MockHpfpController() { }
57 MockHpfpController::~MockHpfpController() { }
58
59 MockLimpManager::MockLimpManager() { }
60 MockLimpManager::~MockLimpManager() { }
61