GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 85.7% 18 / 0 / 21
Functions: 100.0% 1 / 0 / 1
Branches: 73.0% 27 / 0 / 37

src/energyplus/ReverseTranslator/ReverseTranslateZoneAirHeatBalanceAlgorithm.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 "../ReverseTranslator.hpp"
7 #include "../../model/ZoneAirHeatBalanceAlgorithm.hpp"
8 #include "../../model/ZoneAirHeatBalanceAlgorithm_Impl.hpp"
9 #include <utilities/idd/ZoneAirHeatBalanceAlgorithm_FieldEnums.hxx>
10 #include <utilities/idd/OS_ZoneAirHeatBalanceAlgorithm_FieldEnums.hxx>
11 #include "../../utilities/idd/IddEnums.hpp"
12 #include <utilities/idd/IddEnums.hxx>
13
14 using namespace openstudio::model;
15
16 namespace openstudio {
17
18 namespace energyplus {
19
20 2 OptionalModelObject ReverseTranslator::translateZoneAirHeatBalanceAlgorithm(const WorkspaceObject& workspaceObject) {
21
4/5
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
2 if (workspaceObject.iddObject().type() != IddObjectType::ZoneAirHeatBalanceAlgorithm) {
22 ✗ LOG(Error, "WorkspaceObject is not IddObjectType: ZoneAirHeatBalanceAlgorithm");
23 ✗ return boost::none;
24 }
25
26
1/1
✓ Branch 1 taken 2 times.
2 auto mo = m_model.getUniqueModelObject<ZoneAirHeatBalanceAlgorithm>();
27
28
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (auto algorithm_ = workspaceObject.getString(ZoneAirHeatBalanceAlgorithmFields::Algorithm, false, true)) {
29
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 mo.setAlgorithm(algorithm_.get());
30 2 }
31
32
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (auto doSpaceHeatBalanceforSizing_ = workspaceObject.getString(ZoneAirHeatBalanceAlgorithmFields::DoSpaceHeatBalanceforSizing, false, true)) {
33
5/5
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 1 time.
✓ Branch 11 taken 1 time.
6 if (istringEqual("Yes", doSpaceHeatBalanceforSizing_.get())) {
34
1/1
✓ Branch 1 taken 1 time.
1 mo.setDoSpaceHeatBalanceforSizing(true);
35 } else {
36
1/1
✓ Branch 1 taken 1 time.
1 mo.setDoSpaceHeatBalanceforSizing(false);
37 }
38 2 }
39
40 2 if (auto doSpaceHeatBalanceforSimulation_ =
41
3/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
4 workspaceObject.getString(ZoneAirHeatBalanceAlgorithmFields::DoSpaceHeatBalanceforSimulation, false, true)) {
42
4/5
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
3 if (istringEqual("Yes", doSpaceHeatBalanceforSimulation_.get())) {
43 ✗ mo.setDoSpaceHeatBalanceforSimulation(true);
44 } else {
45
1/1
✓ Branch 1 taken 1 time.
1 mo.setDoSpaceHeatBalanceforSimulation(false);
46 }
47 2 }
48
49
1/1
✓ Branch 1 taken 2 times.
2 return mo;
50 2 }
51
52 } // namespace energyplus
53
54 } // namespace openstudio
55