GCC Code Coverage Report


.
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
10 / 17
58.8%
Branches:
5 / 11
45.5%
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 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 1 taken 1 time.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
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