main.cpp
| Line | Branch | Condition | Exec | Source |
|---|---|---|---|---|
| 1 | #include <iostream> | |||
| 2 | ||||
| 3 | 2 | int foo(int param) { | ||
| 4 | // GCOVR_EXCL_BR_SOURCE: No information | |||
| 5 |
2/5✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 4 not taken.
✓ Branch 2 → 6 taken 1 time.
✗ Branch 2 → 7 not taken.
|
2 | switch (param) { | |
| 6 | 1 | case 0: | ||
| 7 | 1 | return 1; | ||
| 8 | ✗ | case 1: | ||
| 9 | ✗ | return 2; | ||
| 10 | ✗ | case 2: | ||
| 11 | ✗ | return 3; // GCOVR_EXCL_BR_SOURCE | ||
| 12 | 1 | case 3: | ||
| 13 | 1 | return 4; | ||
| 14 | ✗ | default: | ||
| 15 | ✗ | return 0; | ||
| 16 | } | |||
| 17 | } | |||
| 18 | ||||
| 19 | 1 | int main(int argc, char* argv[]) { // GCOVR_EXCL_BR_SOURCE: No blocks | ||
| 20 |
3/6✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 7 not taken.
✓ Branch 5 → 6 taken 1 time.
✗ Branch 5 → 7 not taken.
✓ Branch 8 → 9 taken 1 time.
|
3/6✗ Condition 0.0: False not covered.
✗ Condition 0.1: False not covered.
✗ Condition 1: False not covered.
|
1 | if (foo(0) && foo(3)) { |
| 21 | 1 | std::cout << "True" << std::endl; | ||
| 22 | } | |||
| 23 | else { | |||
| 24 | ✗ | std::cout << "False" << std::endl; // GCOVR_EXCL_BR_SOURCE | ||
| 25 | } | |||
| 26 | ||||
| 27 | 1 | return 0; | ||
| 28 | } | |||
| 29 |