GCC Code Coverage Report


Directory: .
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 17 / 0 / 17
Functions: 100.0% 7 / 0 / 7
Branches: 50.0% 1 / 0 / 2

main.cpp
Line Branch Exec Source
1 #include <iostream>
2
3 namespace
4 {
5 class Bar
6 {
7 public:
8 1 Bar() : m_bar(1)
9 1 {}
10 1 ~Bar()
11 1 {}
12
13 1 int foo(void) const
14 {
15 1 std::cout << "Const m_bar: " << this->m_bar << std::endl;
16 1 return 0;
17 }
18
19 int m_bar;
20 };
21 1 int foo(void)
22 {
23 1 const Bar bar;
24
1/2
✓ Branch 3 → 4 taken 1 time.
✗ Branch 3 → 8 not taken.
2 return bar.foo();
25 1 }
26 }
27
28 // The extern "C" results in missing braces in function
29 1 extern "C" int bar()
30 {
31 1 return foo();
32 }
33
34 1 int bar_cpp()
35 {
36 1 return bar();
37 }
38
39 1 int main(int argc, char* argv[]) {
40 1 return bar_cpp();
41 }
42