GCC Code Coverage Report


Directory: .
File: main.cpp
Date: 2025-09-27 21:24:05+00:00
Coverage Exec Excl Total
Lines: 71.4% 10 0 14
Functions: 100.0% 2 0 2
Branches: 44.4% 4 0 9

Line Branch Exec Source
1 #include <iostream>
2
3 2 int foo(int param) {
4 // GCOVR_EXCL_BR_SOURCE: 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) {
6 case 0:
7 1 return 1;
8 case 1:
9 return 2;
10 case 2:
11 return 3; // GCOVR_EXCL_BR_SOURCE
12 case 3:
13 1 return 4;
14 default:
15 return 0; // GCOVR_EXCL_BR_SOURCE
16 }
17 2 }
18
19 1 int main(int argc, char* argv[]) { // GCOVR_EXCL_BR_SOURCE: No blocks
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)) {
21 1 std::cout << "True" << std::endl;
22 1 }
23 else {
24 std::cout << "False" << std::endl; // GCOVR_EXCL_BR_SOURCE
25 }
26
27 1 return 0;
28 }
29