| Line | Branch | Condition | Exec | Source |
|---|---|---|---|---|
| 1 | ||||
| 2 | 5 | int foo(int param) { | ||
| 3 |
4/4✓ Branch 0 (2→3) taken 4 times.
✓ Branch 1 (2→4) taken 1 times.
✓ Branch 2 (3→4) taken 1 times.
✓ Branch 3 (3→5) taken 3 times.
|
4/4✓ Condition 0: Fully covered.
✓ Condition 1: Fully covered.
|
5 | if (param == 0 || param == 1) { // 4/4 branches |
| 4 | 2 | return 1; | ||
| 5 | − | } else if (param == 2 || param == 5) { // 3/4 branches, excluded, GCOV_EXCL_LINE | ||
| 6 | 1 | return 0; | ||
| 7 |
1/2✗ Branch 0 (8→9) not taken.
✓ Branch 1 (8→10) taken 2 times.
|
1/2✗ True not covered.
|
2 | } else if (param == 10) { // 1/2 branches |
| 8 | ✗ | return 2; | ||
| 9 |
1/2✗ Branch 0 (10→11) not taken.
✓ Branch 1 (10→12) taken 2 times.
|
1/2✗ True not covered.
|
2 | } 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 | 1 | return 0; | ||
| 22 | } | |||
| 23 |