GCC Code Coverage Report


Directory: .
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 58.8% 10 / 0 / 17
Functions: 100.0% 2 / 0 / 2
Branches: 50.0% 3 / 5 / 11
Conditions: 50.0% 3 / 0 / 6

main.cpp
Line Branch Condition Exec Source
1 #include <iostream>
2
3 2 int foo(int param) {
4 // GCOVR_EXCL_BR_WITHOUT_HIT: 1/2: No information
5 2 switch (param) { // GCOVR_EXCL_BR_WITHOUT_HIT: 2/4
6 1 case 0:
7 1 return 1;
8 case 1:
9 return 2;
10 case 2:
11 return 3; // GCOVR_EXCL_BR_SOURCE: This marker must be processed first
12 1 case 3:
13 1 return 4;
14 default:
15 return 0;
16 }
17 }
18
19 1 int main(int argc, char* argv[]) {
20
3/6
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 7 not taken.
✓ Branch 5 → 6 taken 1 time.
✗ Branch 5 → 7 not taken.
✓ Branch 8 → 9 taken 1 time.
✗ Branch 8 → 11 not taken.
3/6
✗ Condition 0.0: False not covered.
✗ Condition 0.1: False not covered.
✗ Condition 1: False not covered.
1 if (foo(0) && foo(3)) { // GCOVR_EXCL_BR_WITHOUT_HIT: 2/6
21 1 std::cout << "True" << std::endl;
22 }
23 else {
24 std::cout << "False" << std::endl;
25 }
26
27 1 return 0;
28 }
29