GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 70.6% 12 / 0 / 17
Functions: 100.0% 1 / 0 / 1
Branches: 53.6% 15 / 0 / 28

src/energyplus/ForwardTranslator/ForwardTranslateConstructionAirBoundary.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 "../ForwardTranslator.hpp"
7
8 #include "../../model/Model.hpp"
9 #include "../../model/ConstructionAirBoundary.hpp"
10 #include "../../model/ConstructionAirBoundary_Impl.hpp"
11 #include "../../model/LifeCycleCost.hpp"
12 #include "../../model/Schedule.hpp"
13
14 #include <utilities/idd/Construction_AirBoundary_FieldEnums.hxx>
15 #include "../../utilities/idd/IddEnums.hpp"
16 #include <utilities/idd/IddEnums.hxx>
17 #include <utilities/idd/IddFactory.hxx>
18
19 using namespace openstudio::model;
20
21 using namespace std;
22
23 namespace openstudio {
24
25 namespace energyplus {
26
27 89 boost::optional<IdfObject> ForwardTranslator::translateConstructionAirBoundary(ConstructionAirBoundary& modelObject) {
28
2/2
✓ Branch 1 taken 89 times.
✓ Branch 4 taken 89 times.
89 IdfObject idfObject(openstudio::IddObjectType::Construction_AirBoundary);
29
1/1
✓ Branch 1 taken 89 times.
89 m_idfObjects.push_back(idfObject);
30
31
2/4
✓ Branch 1 taken 89 times.
✗ Branch 7 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 89 times.
89 for (LifeCycleCost lifeCycleCost : modelObject.lifeCycleCosts()) {
32 ✗ translateAndMapModelObject(lifeCycleCost);
33 89 }
34
35
3/3
✓ Branch 1 taken 89 times.
✓ Branch 4 taken 89 times.
✓ Branch 7 taken 89 times.
89 idfObject.setName(modelObject.name().get());
36
37
2/2
✓ Branch 1 taken 89 times.
✓ Branch 4 taken 89 times.
89 idfObject.setString(Construction_AirBoundaryFields::AirExchangeMethod, modelObject.airExchangeMethod());
38
39
2/2
✓ Branch 1 taken 89 times.
✓ Branch 4 taken 89 times.
89 idfObject.setDouble(Construction_AirBoundaryFields::SimpleMixingAirChangesperHour, modelObject.simpleMixingAirChangesPerHour());
40
41
1/1
✓ Branch 1 taken 89 times.
89 boost::optional<Schedule> schedule = modelObject.simpleMixingSchedule();
42
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 89 times.
89 if (schedule) {
43 ✗ boost::optional<IdfObject> relatedIdfObject = translateAndMapModelObject(*schedule);
44 ✗ OS_ASSERT(relatedIdfObject);
45 ✗ idfObject.setString(Construction_AirBoundaryFields::SimpleMixingScheduleName, relatedIdfObject->name().get());
46 ✗ }
47
48
1/1
✓ Branch 1 taken 89 times.
178 return idfObject;
49 89 }
50
51 } // namespace energyplus
52
53 } // namespace openstudio
54