Chrysalis - Pattern Test Coverage


pattern/
File: pattern/src/Option.cpp
Date: 2026-08-27 18:35:18
Lines:
5/10
50.0%
Functions:
2/4
50.0%
Branches:
1/8
12.5%
Decisions:
0/0
-%
Calls:
22/44
50.0%

Line Branch Decision Call Exec Source
1 #include "Option.h"
2
3 using namespace Chrysalis;
4
5 ✗ OptionValue::operator bool() const {
6
0/1
✗ Call 0 not invoked.
✗ return value;
7 }
8
9
12/12
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
✓ Call 9 invoked.
✓ Call 10 invoked.
✓ Call 11 invoked.
2 Option::Option(const std::string& name): BaseNamedElement(name), Argument({false}) {}
10
11 2 Option* Option::createDefault(const std::string& name, const bool isEnabled) {
12
1/4
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
3/4
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✗ Call 7 not invoked.
2 const auto option = new Option(name);
13
7/7
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
2 option->set({isEnabled});
14 2 return option;
15 }
16
17 ✗ void Option::toggle() {
18
0/20
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ Call 14 not invoked.
✗ Call 15 not invoked.
✗ Call 16 not invoked.
✗ Call 17 not invoked.
✗ Call 18 not invoked.
✗ Call 19 not invoked.
✗ Call 20 not invoked.
✗ Call 21 not invoked.
✗ set({!get()});
19 ✗ }
20