GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 19 / 0 / 19
Functions: 100.0% 1 / 0 / 1
Branches: 90.9% 30 / 0 / 33

src/energyplus/ForwardTranslator/ForwardTranslateDefaultSurfaceConstructions.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 #include "../../model/Model.hpp"
8
9 #include "../../model/DefaultSurfaceConstructions.hpp"
10
11 #include "../../model/ConstructionBase.hpp"
12
13 #include <utilities/idd/SurfaceConstructionAssignments_FieldEnums.hxx>
14 #include <utilities/idd/IddEnums.hxx>
15
16 using namespace openstudio::model;
17
18 namespace openstudio {
19
20 namespace energyplus {
21
22 174 boost::optional<IdfObject> ForwardTranslator::translateDefaultSurfaceConstructions(model::DefaultSurfaceConstructions& modelObject) {
23
24 // Instantiate an IdfObject of the class to store the values
25
2/2
✓ Branch 1 taken 174 times.
✓ Branch 4 taken 174 times.
174 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::SurfaceConstructionAssignments, modelObject);
26
27 // Floor Construction Name: Optional Object
28
3/3
✓ Branch 1 taken 174 times.
✓ Branch 3 taken 91 times.
✓ Branch 4 taken 83 times.
348 if (boost::optional<ConstructionBase> floorConstruction_ = modelObject.floorConstruction()) {
29
3/4
✓ Branch 1 taken 91 times.
✓ Branch 4 taken 91 times.
✓ Branch 6 taken 91 times.
✗ Branch 7 not taken.
182 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*floorConstruction_)) {
30
3/3
✓ Branch 1 taken 91 times.
✓ Branch 4 taken 91 times.
✓ Branch 7 taken 91 times.
91 idfObject.setString(SurfaceConstructionAssignmentsFields::FloorConstructionName, wo_->nameString());
31 91 }
32 174 }
33
34 // Wall Construction Name: Optional Object
35
3/3
✓ Branch 1 taken 174 times.
✓ Branch 3 taken 113 times.
✓ Branch 4 taken 61 times.
348 if (boost::optional<ConstructionBase> wallConstruction_ = modelObject.wallConstruction()) {
36
3/4
✓ Branch 1 taken 113 times.
✓ Branch 4 taken 113 times.
✓ Branch 6 taken 113 times.
✗ Branch 7 not taken.
226 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*wallConstruction_)) {
37
3/3
✓ Branch 1 taken 113 times.
✓ Branch 4 taken 113 times.
✓ Branch 7 taken 113 times.
113 idfObject.setString(SurfaceConstructionAssignmentsFields::WallConstructionName, wo_->nameString());
38 113 }
39 174 }
40
41 // Roof Ceiling Construction Name: Optional Object
42
3/3
✓ Branch 1 taken 174 times.
✓ Branch 3 taken 109 times.
✓ Branch 4 taken 65 times.
348 if (boost::optional<ConstructionBase> roofCeilingConstruction_ = modelObject.roofCeilingConstruction()) {
43
3/4
✓ Branch 1 taken 109 times.
✓ Branch 4 taken 109 times.
✓ Branch 6 taken 109 times.
✗ Branch 7 not taken.
218 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(*roofCeilingConstruction_)) {
44
3/3
✓ Branch 1 taken 109 times.
✓ Branch 4 taken 109 times.
✓ Branch 7 taken 109 times.
109 idfObject.setString(SurfaceConstructionAssignmentsFields::RoofCeilingConstructionName, wo_->nameString());
45 109 }
46 174 }
47
48
1/1
✓ Branch 1 taken 174 times.
348 return idfObject;
49 174 } // End of translate function
50
51 } // end namespace energyplus
52 } // end namespace openstudio
53