GCC Code Coverage Report


.
File: main.cpp
Date: 2025-09-27 21:24:05+00:00
Lines:
5 of 10, 4 excluded
83.3%
Functions:
2 of 3, 1 excluded
100.0%
Branches:
1 of 2, 0 excluded
50.0%
Conditions:
1 of 2, 0 excluded
50.0%
Calls:
1 of 2, 1 excluded
100.0%

Line Branch Condition Call Exec Source
1 #include <iostream>
2
3
4 1 int foo(int param) {
5
1/2
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 1 time.
1/2
✗ True not covered.
1 if (param) {
6 return 1; //std::cout << "param not null." << std::endl;
7 } else {
8 return 0; //std::cout << "param is null." << std::endl; GCOVR_EXCL_LINE
9 }
10 // LCOV_EXCL_START
11 if (param) {
12 return 1; //std::cout << "param not null." << std::endl;
13 } else {
14 return 0; //std::cout << "param is null." << std::endl;
15 }
16 // LCOV_EXCL_STOP
17 }
18
19 // LCOV_EXCL_START
20 int bar(void) {
21 return 1;
22 }
23 // LCOV_EXCL_STOP
24
25 1 int main(int argc, char* argv[]) {
26
1/1
✓ Call 0 invoked.
1 foo(0);
27 bar(); // GCOVR_EXCL_LINE
28
29 1 return 0;
30 }
31