GCC Code Coverage Report


.
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
10 / 14
71.4%
Branches:
4 / 9
44.4%
Functions:
2 / 2
100.0%

main.cpp
Line Branch Exec Source
1 #include <iostream>
2
3 2 int foo(int param) {
4 // GCOVR_EXCL_BR_WITHOUT_HIT: 1/2: No information
5
2/5
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 switch (param) { // GCOVR_EXCL_BR_WITHOUT_HIT: 2/4
6 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 case 3:
13 1 return 4;
14 default:
15 ✗ return 0;
16 }
17 2 }
18
19 1 int main(int argc, char* argv[]) {
20
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
1 if (foo(0) && foo(3)) { // GCOVR_EXCL_BR_WITHOUT_HIT: 2/6
21 1 std::cout << "True" << std::endl;
22 1 }
23 else {
24 ✗ std::cout << "False" << std::endl;
25 }
26
27 1 return 0;
28 }
29