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: 95.0% 38 0 40
Functions: 100.0% 4 0 4
Branches: 76.7% 23 0 30
Conditions: 76.7% 23 0 30
Decisions: 50.0% 3 - 6

Overall list of functions

File Lines Functions Branches Conditions Decisions
main.cpp 95.0 95.0% 38 / 0 / 40 100.0% 4 / 0 / 4 76.7% 23 / 0 / 30 76.7% 23 / 0 / 30 50.0% 3 / - / 6

Directory: .
File: main.cpp
Date: 2025-09-27 21:24:05+00:00
Coverage Exec Excl Total
Lines: 95.0% 38 0 40
Functions: 100.0% 4 0 4
Branches: 76.7% 23 0 30
Conditions: 76.7% 23 0 30
Decisions: 50.0% 3 - 6
Line Branch Condition 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
2/4
void foo<double>(double):
✓ Branch 2 → 3 taken 4 times.
✗ Branch 2 → 7 not taken.
void foo<int>(int):
✓ Branch 2 → 3 taken 6 times.
✗ Branch 2 → 7 not taken.
2/4
void foo<double>(double):
✗ False not covered.
void foo<int>(int):
✗ False not covered.
10 if (i >= 0) {
10 10 std::cout << i << " is greater or equal 0: " << s << std::endl;
11 }
12
11/12
void foo<double>(double):
✓ Branch 7 → 8 taken 3 times.
✓ Branch 7 → 14 taken 1 time.
✓ Branch 8 → 9 taken 2 times.
✓ Branch 8 → 10 taken 1 time.
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 14 taken 2 times.
void foo<int>(int):
✓ Branch 7 → 8 taken 5 times.
✓ Branch 7 → 14 taken 1 time.
✓ Branch 8 → 9 taken 4 times.
✓ Branch 8 → 10 taken 1 time.
✓ Branch 9 → 10 taken 1 time.
✓ Branch 9 → 14 taken 3 times.
11/12
void foo<double>(double):
✓ Condition 0: Fully covered.
✓ Condition 1.0: Fully covered.
✗ Condition 1.1: True not covered.
void foo<int>(int):
✓ Condition 0: Fully covered.
✓ Condition 1.0: Fully covered.
✓ Condition 1.1: Fully covered.
10 if (i > 0) if ( i < 2 || i > 4 ) std::cout << i << " is between 0 and 2 or greater 4: " << s << std::endl;
13
3/4
void foo<double>(double):
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 19 taken 4 times.
void foo<int>(int):
✓ Branch 14 → 15 taken 1 time.
✓ Branch 14 → 19 taken 5 times.
3/4
void foo<double>(double):
✗ True not covered.
void foo<int>(int):
✓ Fully covered.
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 2 → 3 taken 4 times.
✗ Branch 2 → 6 not taken.
1/2
✗ False not covered.
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 6 → 7 taken 3 times.
✓ Branch 6 → 12 taken 1 time.
✓ Branch 7 → 8 taken 2 times.
✓ Branch 7 → 9 taken 1 time.
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 12 taken 2 times.
5/6
✓ Condition 0: Fully covered.
✓ Condition 1.0: Fully covered.
✗ Condition 1.1: True not covered.
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 12 → 13 not taken.
✓ Branch 12 → 16 taken 4 times.
1/2
✗ True not covered.
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