GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 62.4% 58 / 0 / 93
Functions: 60.7% 17 / 0 / 28
Branches: 41.5% 34 / 0 / 82

src/model/AirflowNetworkCrack.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 "AirflowNetworkCrack.hpp"
7 #include "AirflowNetworkCrack_Impl.hpp"
8 #include "Model.hpp"
9
10 #include <utilities/idd/IddEnums.hxx>
11 #include <utilities/idd/OS_AirflowNetworkCrack_FieldEnums.hxx>
12
13 #include "AirflowNetworkReferenceCrackConditions.hpp"
14 #include "AirflowNetworkReferenceCrackConditions_Impl.hpp"
15
16 #include "../utilities/units/Unit.hpp"
17
18 #include "../utilities/core/Assert.hpp"
19
20 namespace openstudio {
21 namespace model {
22
23 namespace detail {
24
25 9 AirflowNetworkCrack_Impl::AirflowNetworkCrack_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
26 9 : AirflowNetworkComponent_Impl(idfObject, model, keepHandle) {
27
4/6
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 9 times.
✗ Branch 13 not taken.
9 OS_ASSERT(idfObject.iddObject().type() == AirflowNetworkCrack::iddObjectType());
28 9 }
29
30 ✗ AirflowNetworkCrack_Impl::AirflowNetworkCrack_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
31 ✗ : AirflowNetworkComponent_Impl(other, model, keepHandle) {
32 ✗ OS_ASSERT(other.iddObject().type() == AirflowNetworkCrack::iddObjectType());
33 ✗ }
34
35 ✗ AirflowNetworkCrack_Impl::AirflowNetworkCrack_Impl(const AirflowNetworkCrack_Impl& other, Model_Impl* model, bool keepHandle)
36 ✗ : AirflowNetworkComponent_Impl(other, model, keepHandle) {}
37
38 ✗ const std::vector<std::string>& AirflowNetworkCrack_Impl::outputVariableNames() const {
39 ✗ static const std::vector<std::string> result;
40 ✗ return result;
41 }
42
43 ✗ IddObjectType AirflowNetworkCrack_Impl::iddObjectType() const {
44 ✗ return AirflowNetworkCrack::iddObjectType();
45 }
46
47 9 double AirflowNetworkCrack_Impl::airMassFlowCoefficient() const {
48
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_AirflowNetworkCrackFields::AirMassFlowCoefficientatReferenceConditions, true);
49
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
50
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
51 }
52
53 9 double AirflowNetworkCrack_Impl::airMassFlowExponent() const {
54
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_AirflowNetworkCrackFields::AirMassFlowExponent, true);
55
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
56
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
57 }
58
59 11 boost::optional<AirflowNetworkReferenceCrackConditions> AirflowNetworkCrack_Impl::referenceCrackConditions() const {
60
1/1
✓ Branch 1 taken 11 times.
22 return getObject<ModelObject>().getModelObjectTarget<AirflowNetworkReferenceCrackConditions>(
61
1/1
✓ Branch 1 taken 11 times.
22 OS_AirflowNetworkCrackFields::ReferenceCrackConditions);
62 }
63
64 ✗ bool AirflowNetworkCrack_Impl::isAirMassFlowExponentDefaulted() const {
65 ✗ return isEmpty(OS_AirflowNetworkCrackFields::AirMassFlowExponent);
66 }
67
68 9 bool AirflowNetworkCrack_Impl::setAirMassFlowCoefficient(double airMassFlowCoefficientatReferenceConditions) {
69 9 bool result = setDouble(OS_AirflowNetworkCrackFields::AirMassFlowCoefficientatReferenceConditions, airMassFlowCoefficientatReferenceConditions);
70 9 return result;
71 }
72
73 9 bool AirflowNetworkCrack_Impl::setAirMassFlowExponent(double airMassFlowExponent) {
74 9 bool result = setDouble(OS_AirflowNetworkCrackFields::AirMassFlowExponent, airMassFlowExponent);
75 9 return result;
76 }
77
78 ✗ void AirflowNetworkCrack_Impl::resetAirMassFlowExponent() {
79 ✗ bool result = setString(OS_AirflowNetworkCrackFields::AirMassFlowExponent, "");
80 ✗ OS_ASSERT(result);
81 ✗ }
82
83 2 bool AirflowNetworkCrack_Impl::setReferenceCrackConditions(const AirflowNetworkReferenceCrackConditions& referenceCrackConditions) {
84
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 bool result = setPointer(OS_AirflowNetworkCrackFields::ReferenceCrackConditions, referenceCrackConditions.handle());
85 2 return result;
86 }
87
88 ✗ void AirflowNetworkCrack_Impl::resetReferenceCrackConditions() {
89 ✗ bool result = setString(OS_AirflowNetworkCrackFields::ReferenceCrackConditions, "");
90 ✗ OS_ASSERT(result);
91 ✗ }
92
93 } // namespace detail
94
95 ✗ AirflowNetworkCrack::AirflowNetworkCrack(const Model& model, double massFlowCoefficient)
96 ✗ : AirflowNetworkComponent(AirflowNetworkCrack::iddObjectType(), model) {
97 ✗ OS_ASSERT(getImpl<detail::AirflowNetworkCrack_Impl>());
98
99 ✗ bool ok = setAirMassFlowCoefficient(massFlowCoefficient);
100 ✗ OS_ASSERT(ok);
101 ✗ }
102
103 8 AirflowNetworkCrack::AirflowNetworkCrack(const Model& model, double massFlowCoefficient, double massFlowExponent)
104 8 : AirflowNetworkComponent(AirflowNetworkCrack::iddObjectType(), model) {
105
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
✗ Branch 5 not taken.
8 OS_ASSERT(getImpl<detail::AirflowNetworkCrack_Impl>());
106
107
1/1
✓ Branch 1 taken 8 times.
8 bool ok = setAirMassFlowCoefficient(massFlowCoefficient);
108
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
109
1/1
✓ Branch 1 taken 8 times.
8 ok = setAirMassFlowExponent(massFlowExponent);
110
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
111 8 }
112
113 1 AirflowNetworkCrack::AirflowNetworkCrack(const Model& model, double massFlowCoefficient, double massFlowExponent,
114 1 const AirflowNetworkReferenceCrackConditions& referenceCrackConditions)
115 1 : AirflowNetworkComponent(AirflowNetworkCrack::iddObjectType(), model) {
116
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
1 OS_ASSERT(getImpl<detail::AirflowNetworkCrack_Impl>());
117
118
1/1
✓ Branch 1 taken 1 time.
1 bool ok = setAirMassFlowCoefficient(massFlowCoefficient);
119
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
1 OS_ASSERT(ok);
120
1/1
✓ Branch 1 taken 1 time.
1 ok = setAirMassFlowExponent(massFlowExponent);
121
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
1 OS_ASSERT(ok);
122
1/1
✓ Branch 1 taken 1 time.
1 ok = setReferenceCrackConditions(referenceCrackConditions);
123
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
1 OS_ASSERT(ok);
124 1 }
125
126 8649 IddObjectType AirflowNetworkCrack::iddObjectType() {
127
1/1
✓ Branch 1 taken 8649 times.
8649 return {IddObjectType::OS_AirflowNetworkCrack};
128 }
129
130 9 double AirflowNetworkCrack::airMassFlowCoefficient() const {
131
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::AirflowNetworkCrack_Impl>()->airMassFlowCoefficient();
132 }
133
134 9 double AirflowNetworkCrack::airMassFlowExponent() const {
135
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::AirflowNetworkCrack_Impl>()->airMassFlowExponent();
136 }
137
138 ✗ bool AirflowNetworkCrack::isAirMassFlowExponentDefaulted() const {
139 ✗ return getImpl<detail::AirflowNetworkCrack_Impl>()->isAirMassFlowExponentDefaulted();
140 }
141
142 11 boost::optional<AirflowNetworkReferenceCrackConditions> AirflowNetworkCrack::referenceCrackConditions() const {
143
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::AirflowNetworkCrack_Impl>()->referenceCrackConditions();
144 }
145
146 9 bool AirflowNetworkCrack::setAirMassFlowCoefficient(double airMassFlowCoefficientatReferenceConditions) {
147
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::AirflowNetworkCrack_Impl>()->setAirMassFlowCoefficient(airMassFlowCoefficientatReferenceConditions);
148 }
149
150 9 bool AirflowNetworkCrack::setAirMassFlowExponent(double airMassFlowExponent) {
151
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::AirflowNetworkCrack_Impl>()->setAirMassFlowExponent(airMassFlowExponent);
152 }
153
154 ✗ void AirflowNetworkCrack::resetAirMassFlowExponent() {
155 ✗ getImpl<detail::AirflowNetworkCrack_Impl>()->resetAirMassFlowExponent();
156 ✗ }
157
158 2 bool AirflowNetworkCrack::setReferenceCrackConditions(const AirflowNetworkReferenceCrackConditions& referenceCrackConditions) {
159
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::AirflowNetworkCrack_Impl>()->setReferenceCrackConditions(referenceCrackConditions);
160 }
161
162 ✗ void AirflowNetworkCrack::resetReferenceCrackConditions() {
163 ✗ getImpl<detail::AirflowNetworkCrack_Impl>()->resetReferenceCrackConditions();
164 ✗ }
165
166 /// @cond
167
1/1
✓ Branch 2 taken 4 times.
4 AirflowNetworkCrack::AirflowNetworkCrack(std::shared_ptr<detail::AirflowNetworkCrack_Impl> impl) : AirflowNetworkComponent(impl) {}
168 /// @endcond
169
170 } // namespace model
171 } // namespace openstudio
172