Chrysalis - Pattern Test Coverage


pattern/
File: pattern/src/Parameter.cpp
Date: 2026-08-27 18:35:18
Lines:
14/26
53.8%
Functions:
6/10
60.0%
Branches:
1/12
8.3%
Decisions:
0/0
-%
Calls:
48/85
56.5%

Line Branch Decision Call Exec Source
1 #include "Parameter.h"
2
3
4 using namespace Chrysalis;
5
6
18/18
✓ 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.
✓ Call 12 invoked.
✓ Call 13 invoked.
✓ Call 14 invoked.
✓ Call 15 invoked.
✓ Call 16 invoked.
✓ Call 17 invoked.
12 Parameter::Parameter(const std::string& name): BaseNamedElement(name) {}
7
8 ✗ Parameter* Parameter::create(const std::string& name, const double value) {
9
0/4
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 7 not invoked.
✗ const auto parameter = new Parameter(name);
10
0/4
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ parameter->setValue(value);
11 ✗ return parameter;
12 }
13
14 12 Parameter* Parameter::createDefault(const std::string& name, const double defaultValue) {
15
1/4
✓ Branch 3 taken 12 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.
12 const auto parameter = new Parameter(name);
16
4/4
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
12 parameter->setDefaultValue(defaultValue);
17 12 return parameter;
18 }
19
20 ✗ bool Parameter::isValid() const {
21
0/12
✗ 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 8 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ Call 12 not invoked.
✗ Call 13 not invoked.
✗ return value_.has_value() || defaultValue_.has_value();
22 }
23
24 24 bool Parameter::hasValue() const {
25
6/6
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
24 return value_.has_value();
26 }
27
28 24 bool Parameter::hasDefaultValue() const {
29
6/6
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
24 return defaultValue_.has_value();
30 }
31
32 ✗ double Parameter::getValue() const {
33
0/7
✗ 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.
✗ return value_.value();
34 }
35
36 24 double Parameter::getDefaultValue() const {
37
7/7
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
24 return defaultValue_.value();
38 }
39
40 ✗ void Parameter::setValue(double value) {
41
0/4
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ value_ = value;
42
0/5
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ notify(&ParameterObserver::valueChanged, value);
43 ✗ }
44
45 12 void Parameter::setDefaultValue(double defaultValue) {
46
4/4
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
12 defaultValue_ = defaultValue;
47 12 }
48