main.cpp
81.8% Lines (9 / 11, 5 excl)
100.0% Branches (2 / 2, 12 excl)
75.0% Functions (3 / 4)
Functions (4)
Function
Calls
Lines
Branches
Blocks
_ZN3BarC2Ev
:10
1x
100.0%
–
100.0%
_ZN3BarD0Ev
:12
0
100.0%
–
0.0%
_ZN3BarD2Ev
:12
1x
100.0%
–
100.0%
main
:19
1x
71.4%
100.0%
42.0%
| Line | Branch | TLA | Hits | Source Code |
|---|---|---|---|---|
| 1 | #include <iostream> | |||
| 2 | #include <cstring> | |||
| 3 | ||||
| 4 | extern int foo(int param); | |||
| 5 | extern int bar(int param); | |||
| 6 | ||||
| 7 | class Bar | |||
| 8 | { | |||
| 9 | public: | |||
| 10 | 1x | Bar() : m_param(1) | ||
| 11 | 2x | {} | ||
| 12 | 1x | virtual ~Bar() | ||
| 13 | 1x | {} // possible compiler-generated destruction code - auto-detected and excluded | ||
| 14 | ||||
| 15 | private: | |||
| 16 | int m_param; | |||
| 17 | }; | |||
| 18 | ||||
| 19 | 1x | int main(int argc, char* argv[]) { | ||
| 20 |
2/2✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 time.
|
6x | for (int i = 0; i < 5; i++) { // 2/2 branches | |
| 21 | 5x | foo(i); | ||
| 22 | 5x | } | ||
| 23 | ||||
| 24 | try { | |||
| 25 | − | Bar bar; // LCOV_EXCL_LINE | ||
| 26 | − | } catch (const std::exception &e) { // LCOV_EXCL_START | ||
| 27 | − | std::cout << "caught exception"; | ||
| 28 | − | std::cout << ": " << e.what(); | ||
| 29 | − | std::cout << std::endl; | ||
| 30 | ✗ | } // LCOV_EXCL_STOP | ||
| 31 | ||||
| 32 | 1x | return 0; | ||
| 33 | ✗ | } // compiler-generated destruction code - auto-detected and excluded | ||
| 34 | ||||
| 35 | // total: 8/10 branches reported | |||
| 36 | ||||
| 37 |