Overall list of functions
File
Lines
Branches
Decisions
Functions
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
31 / 32
96.9%
Branches:
16 / 20
80.0%
Decisions:
3 / 6
50.0%
Functions:
4 / 4
100.0%
main.cpp
| 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 | 10 | if (i >= 0) { | ||
| 10 | 10 | std::cout << i << " is greater or equal 0: " << s << std::endl; | ||
| 11 | } | |||
| 12 | 10 | if (i > 0) if ( i < 2 || i > 4 ) std::cout << i << " is between 0 and 2 or greater 4: " << s << std::endl; | ||
| 13 | 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 | 4 | if (i >= 0) { | ||
| 25 | 4 | std::cout << i << " is greater or equal 0" << std::endl; | ||
| 26 | } | |||
| 27 | 4 | if (i > 0) if ( i < 2 || i > 4 ) std::cout << i << " is between 0 and 2 or greater 4" << std::endl; | ||
| 28 | 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 |