Overall list of functions
| File | Lines | Functions | Branches | Decisions | |||||
|---|---|---|---|---|---|---|---|---|---|
| main.cpp |
|
96.9% | 31 / 0 / 32 | 100.0% | 4 / 0 / 4 | 76.7% | 23 / 0 / 30 | 58.3% | 7 / - / 12 |
| 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: | 76.7% | 23 | 0 | 30 |
| Decisions: | 58.3% | 7 | - | 12 |
| 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 |
2/4✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
1/2✓ Decision 'true' taken 10 times.
✗ Decision 'false' not taken.
|
10 | if (i >= 0) { |
| 10 | 10 | std::cout << i << " is greater or equal 0: " << s << std::endl; | ||
| 11 | } | |||
| 12 |
11/12✓ 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.
✓ Branch 10 taken 5 times.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 4 times.
✓ Branch 13 taken 1 time.
✓ Branch 14 taken 1 time.
✓ Branch 15 taken 3 times.
|
1/2✓ Decision 'true' taken 10 times.
✗ Decision 'false' not taken.
|
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✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 5 times.
|
2/2✓ Decision 'true' taken 1 time.
✓ Decision 'false' 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 |