GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 41.9% 44 / 0 / 105
Functions: 42.4% 14 / 0 / 33
Branches: 31.4% 22 / 0 / 70

src/model/AirflowNetworkReferenceCrackConditions.cpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #include "AirflowNetworkReferenceCrackConditions.hpp"
7 #include "AirflowNetworkReferenceCrackConditions_Impl.hpp"
8
9 #include <utilities/idd/IddEnums.hxx>
10 #include <utilities/idd/OS_AirflowNetworkReferenceCrackConditions_FieldEnums.hxx>
11
12 #include "../utilities/units/Unit.hpp"
13
14 #include "../utilities/core/Assert.hpp"
15
16 namespace openstudio {
17 namespace model {
18
19 namespace detail {
20
21 1 AirflowNetworkReferenceCrackConditions_Impl::AirflowNetworkReferenceCrackConditions_Impl(const IdfObject& idfObject, Model_Impl* model,
22 1 bool keepHandle)
23 1 : ModelObject_Impl(idfObject, model, keepHandle) {
24
4/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
1 OS_ASSERT(idfObject.iddObject().type() == AirflowNetworkReferenceCrackConditions::iddObjectType());
25 1 }
26
27 ✗ AirflowNetworkReferenceCrackConditions_Impl::AirflowNetworkReferenceCrackConditions_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
28 ✗ Model_Impl* model, bool keepHandle)
29 ✗ : ModelObject_Impl(other, model, keepHandle) {
30 ✗ OS_ASSERT(other.iddObject().type() == AirflowNetworkReferenceCrackConditions::iddObjectType());
31 ✗ }
32
33 ✗ AirflowNetworkReferenceCrackConditions_Impl::AirflowNetworkReferenceCrackConditions_Impl(const AirflowNetworkReferenceCrackConditions_Impl& other,
34 ✗ Model_Impl* model, bool keepHandle)
35 ✗ : ModelObject_Impl(other, model, keepHandle) {}
36
37 ✗ const std::vector<std::string>& AirflowNetworkReferenceCrackConditions_Impl::outputVariableNames() const {
38 ✗ static const std::vector<std::string> result;
39 ✗ return result;
40 }
41
42 ✗ IddObjectType AirflowNetworkReferenceCrackConditions_Impl::iddObjectType() const {
43 ✗ return AirflowNetworkReferenceCrackConditions::iddObjectType();
44 }
45
46 4 double AirflowNetworkReferenceCrackConditions_Impl::referenceTemperature() const {
47
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<double> value = getDouble(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceTemperature, true);
48
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(value);
49
1/1
✓ Branch 1 taken 4 times.
8 return value.get();
50 }
51
52 ✗ bool AirflowNetworkReferenceCrackConditions_Impl::isReferenceTemperatureDefaulted() const {
53 ✗ return isEmpty(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceTemperature);
54 }
55
56 2 double AirflowNetworkReferenceCrackConditions_Impl::referenceBarometricPressure() const {
57
1/1
✓ Branch 1 taken 2 times.
2 boost::optional<double> value = getDouble(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceBarometricPressure, true);
58
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
59
1/1
✓ Branch 1 taken 2 times.
4 return value.get();
60 }
61
62 ✗ bool AirflowNetworkReferenceCrackConditions_Impl::isReferenceBarometricPressureDefaulted() const {
63 ✗ return isEmpty(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceBarometricPressure);
64 }
65
66 1 double AirflowNetworkReferenceCrackConditions_Impl::referenceHumidityRatio() const {
67
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<double> value = getDouble(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceHumidityRatio, true);
68
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
1 OS_ASSERT(value);
69
1/1
✓ Branch 1 taken 1 time.
2 return value.get();
70 }
71
72 ✗ bool AirflowNetworkReferenceCrackConditions_Impl::isReferenceHumidityRatioDefaulted() const {
73 ✗ return isEmpty(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceHumidityRatio);
74 }
75
76 1 void AirflowNetworkReferenceCrackConditions_Impl::setReferenceTemperature(double referenceTemperature) {
77 1 bool result = setDouble(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceTemperature, referenceTemperature);
78
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
79 1 }
80
81 ✗ void AirflowNetworkReferenceCrackConditions_Impl::resetReferenceTemperature() {
82 ✗ bool result = setString(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceTemperature, "");
83 ✗ OS_ASSERT(result);
84 ✗ }
85
86 1 bool AirflowNetworkReferenceCrackConditions_Impl::setReferenceBarometricPressure(double referenceBarometricPressure) {
87 1 bool result = setDouble(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceBarometricPressure, referenceBarometricPressure);
88 1 return result;
89 }
90
91 ✗ void AirflowNetworkReferenceCrackConditions_Impl::resetReferenceBarometricPressure() {
92 ✗ bool result = setString(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceBarometricPressure, "");
93 ✗ OS_ASSERT(result);
94 ✗ }
95
96 ✗ void AirflowNetworkReferenceCrackConditions_Impl::setReferenceHumidityRatio(double referenceHumidityRatio) {
97 ✗ bool result = setDouble(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceHumidityRatio, referenceHumidityRatio);
98 ✗ OS_ASSERT(result);
99 ✗ }
100
101 ✗ void AirflowNetworkReferenceCrackConditions_Impl::resetReferenceHumidityRatio() {
102 ✗ bool result = setString(OS_AirflowNetworkReferenceCrackConditionsFields::ReferenceHumidityRatio, "");
103 ✗ OS_ASSERT(result);
104 ✗ }
105
106 } // namespace detail
107
108 1 AirflowNetworkReferenceCrackConditions::AirflowNetworkReferenceCrackConditions(const Model& model)
109 1 : ModelObject(AirflowNetworkReferenceCrackConditions::iddObjectType(), model) {
110
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
1 OS_ASSERT(getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>());
111
112 // TODO: Appropriately handle the following required object-list fields.
113 1 }
114
115 ✗ AirflowNetworkReferenceCrackConditions::AirflowNetworkReferenceCrackConditions(const Model& model, double temperature, double barometricPressure,
116 ✗ double humidityRatio)
117 ✗ : ModelObject(AirflowNetworkReferenceCrackConditions::iddObjectType(), model) {
118 ✗ OS_ASSERT(getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>());
119
120 ✗ setTemperature(temperature);
121 ✗ setBarometricPressure(barometricPressure);
122 ✗ setHumidityRatio(humidityRatio);
123 ✗ }
124
125 8489 IddObjectType AirflowNetworkReferenceCrackConditions::iddObjectType() {
126
1/1
✓ Branch 1 taken 8489 times.
8489 return {IddObjectType::OS_AirflowNetworkReferenceCrackConditions};
127 }
128
129 4 double AirflowNetworkReferenceCrackConditions::temperature() const {
130
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->referenceTemperature();
131 }
132
133 ✗ bool AirflowNetworkReferenceCrackConditions::isTemperatureDefaulted() const {
134 ✗ return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->isReferenceTemperatureDefaulted();
135 }
136
137 2 double AirflowNetworkReferenceCrackConditions::barometricPressure() const {
138
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->referenceBarometricPressure();
139 }
140
141 ✗ bool AirflowNetworkReferenceCrackConditions::isBarometricPressureDefaulted() const {
142 ✗ return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->isReferenceBarometricPressureDefaulted();
143 }
144
145 1 double AirflowNetworkReferenceCrackConditions::humidityRatio() const {
146
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->referenceHumidityRatio();
147 }
148
149 ✗ bool AirflowNetworkReferenceCrackConditions::isHumidityRatioDefaulted() const {
150 ✗ return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->isReferenceHumidityRatioDefaulted();
151 }
152
153 1 void AirflowNetworkReferenceCrackConditions::setTemperature(double referenceTemperature) {
154
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->setReferenceTemperature(referenceTemperature);
155 1 }
156
157 ✗ void AirflowNetworkReferenceCrackConditions::resetTemperature() {
158 ✗ getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->resetReferenceTemperature();
159 ✗ }
160
161 1 bool AirflowNetworkReferenceCrackConditions::setBarometricPressure(double referenceBarometricPressure) {
162
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->setReferenceBarometricPressure(referenceBarometricPressure);
163 }
164
165 ✗ void AirflowNetworkReferenceCrackConditions::resetBarometricPressure() {
166 ✗ getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->resetReferenceBarometricPressure();
167 ✗ }
168
169 ✗ void AirflowNetworkReferenceCrackConditions::setHumidityRatio(double referenceHumidityRatio) {
170 ✗ getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->setReferenceHumidityRatio(referenceHumidityRatio);
171 ✗ }
172
173 ✗ void AirflowNetworkReferenceCrackConditions::resetHumidityRatio() {
174 ✗ getImpl<detail::AirflowNetworkReferenceCrackConditions_Impl>()->resetReferenceHumidityRatio();
175 ✗ }
176
177 /// @cond
178 3 AirflowNetworkReferenceCrackConditions::AirflowNetworkReferenceCrackConditions(
179 3 std::shared_ptr<detail::AirflowNetworkReferenceCrackConditions_Impl> impl)
180
1/1
✓ Branch 2 taken 3 times.
3 : ModelObject(impl) {}
181 /// @endcond
182
183 } // namespace model
184 } // namespace openstudio
185