GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 62.5% 5 / 0 / 8
Functions: 100.0% 2 / 0 / 2
Branches: 25.0% 1 / 0 / 4
Decisions: 33.3% 1 / - / 3

switch_test.h
Line Branch Decision Exec Source
1 #pragma once
2
3 #include <cstdint>
4 #include <string>
5
6 namespace EnumNamespace {
7 enum SomeEnum {
8 EnumValue_1,
9 EnumValue_2,
10 EnumValue_3,
11 };
12 }
13
14 1 struct SwitchTestIssue783 {
15 SwitchTestIssue783();
16
17 1 static double doSomething(EnumNamespace::SomeEnum value) {
18
1/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1 switch (value) {
19
1/1
✓ Decision 'true' taken 1 time.
1 case EnumNamespace::EnumValue_1: return 50.0;
20 case EnumNamespace::EnumValue_2: return 100.0;
21 case EnumNamespace::EnumValue_3: return 25.0;
22 }
23 return 0.0;
24 1 }
25
26 void checkSwitch();
27 private:
28 std::string _name;
29 };
30