GCC Code Coverage Report


Directory: .
Date: 2025-09-27 21:24:05+00:00
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec Excl Total
Lines: 96.9% 31 0 32
Functions: 100.0% 4 0 4
Branches: 80.0% 16 0 20
Decisions: 50.0% 3 - 6

Overall list of functions

File Lines Functions Branches Decisions
main.cpp 96.9 96.9% 31 / 0 / 32 100.0% 4 / 0 / 4 80.0% 16 / 0 / 20 50.0% 3 / - / 6

Directory: .
File: main.cpp
Date: 2025-09-27 21:24:05+00:00
Coverage Exec Excl Total
Lines: 96.9% 31 0 32
Functions: 100.0% 4 0 4
Branches: 80.0% 16 0 20
Decisions: 50.0% 3 - 6
Line Branch Decision Exec Source
1
2 #include <iostream>
3
4 template<typename T>
5 10 void foo(T s)
6 {
7 static int i = 0;
8
9
1/2
✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
10 if (i >= 0) {
10 10 std::cout << i << " is greater or equal 0: " << s << std::endl;
11 }
12
6/6
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 6 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 5 times.
10 if (i > 0) if ( i < 2 || i > 4 ) std::cout << i << " is between 0 and 2 or greater 4: " << s << std::endl;
13
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 9 times.
10 if (i >= 5) {
14 1 std::cout << i << " is greater 5: " << s << std::endl;
15 }
16
17 10 ++i;
18 10 }
19
20 4 void bar()
21 {
22 static int i = 0;
23
24
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
1/2
✓ Decision 'true' taken 4 times.
✗ Decision 'false' not taken.
4 if (i >= 0) {
25 4 std::cout << i << " is greater or equal 0" << std::endl;
26 }
27
5/6
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1/2
✓ Decision 'true' taken 4 times.
✗ Decision 'false' not taken.
4 if (i > 0) if ( i < 2 || i > 4 ) std::cout << i << " is between 0 and 2 or greater 4" << std::endl;
28
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
1/2
✗ Decision 'true' not taken.
✓ Decision 'false' taken 4 times.
4 if (i >= 5) {
29 std::cout << i << " is greater 5"<< std::endl;
30 }
31
32 4 ++i;
33 4 }
34
35 1 int main() {
36 1 foo<>(0);
37 1 foo<>(0);
38 1 foo<>(0);
39 1 foo<>(0);
40 1 foo<>(0);
41 1 foo<>(0);
42
43 1 foo<>(0.0);
44 1 foo<>(0.0);
45 1 foo<>(0.0);
46 1 foo<>(0.0);
47
48 1 bar();
49 1 bar();
50 1 bar();
51 1 bar();
52
53 1 return 0;
54 }
55