foo.cpp
80.0% Lines (8 / 10, 5 excl)
75.0% Branches (6 / 8, 8 excl)
100.0% Functions (1 / 1)
Functions (1)
Function
Calls
Lines
Branches
Blocks
_Z3fooi
:2
5x
80.0%
75.0%
85.0%
| Line | Branch | TLA | Hits | Source Code |
|---|---|---|---|---|
| 1 | ||||
| 2 | 5x | int foo(int param) { | ||
| 3 |
4/4✓ Branch 0 taken 1 time.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 3 times.
|
5x | if (param == 0 || param == 1) { // 4/4 branches | |
| 4 | 2x | return 1; | ||
| 5 | − | } else if (param == 2 || param == 5) { // 3/4 branches, excluded, GCOV_EXCL_LINE | ||
| 6 | 1x | return 0; | ||
| 7 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2x | } else if (param == 10) { // 1/2 branches | |
| 8 | ✗ | return 2; | ||
| 9 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2x | } else if (param == 11) { // 1/2 branches | |
| 10 | ✗ | return 3; | ||
| 11 | } | |||
| 12 | ||||
| 13 | // GCOV_EXCL_START | |||
| 14 | − | if (param == 4) { // 2/2 branches, excluded | ||
| 15 | − | return 1; | ||
| 16 | − | } else if (param == 5) { // 1/2 branches, excluded | ||
| 17 | − | return 0; | ||
| 18 | } | |||
| 19 | // GCOV_EXCL_STOP | |||
| 20 | ||||
| 21 | 1x | return 0; | ||
| 22 | 5x | } | ||
| 23 |