GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 88.9% 16 / 0 / 18
Functions: 100.0% 1 / 0 / 1
Branches: 71.0% 22 / 0 / 31

src/energyplus/ReverseTranslator/ReverseTranslateSurfacePropertyExposedFoundationPerimeter.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
8 #include "../../model/SurfacePropertyExposedFoundationPerimeter.hpp"
9 #include "../../model/SurfacePropertyExposedFoundationPerimeter_Impl.hpp"
10 #include "../../model/Surface.hpp"
11 #include "../../model/Surface_Impl.hpp"
12
13 #include "../../utilities/idf/WorkspaceExtensibleGroup.hpp"
14
15 #include <utilities/idd/SurfaceProperty_ExposedFoundationPerimeter_FieldEnums.hxx>
16 #include "../../utilities/idd/IddEnums.hpp"
17 #include <utilities/idd/IddEnums.hxx>
18
19 #include "../../utilities/core/Assert.hpp"
20
21 using namespace openstudio::model;
22
23 namespace openstudio {
24
25 namespace energyplus {
26
27 2 OptionalModelObject ReverseTranslator::translateSurfacePropertyExposedFoundationPerimeter(const WorkspaceObject& workspaceObject) {
28
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::SurfaceProperty_ExposedFoundationPerimeter) {
29 ✗ LOG(Error, "WorkspaceObject is not IddObjectType: SurfacePropertyExposedFoundationPerimeter");
30 ✗ return boost::none;
31 }
32
33
1/1
✓ Branch 1 taken 2 times.
2 OptionalString s = workspaceObject.getString(SurfaceProperty_ExposedFoundationPerimeterFields::ExposedPerimeterCalculationMethod);
34
35
1/1
✓ Branch 1 taken 2 times.
2 OptionalDouble d = workspaceObject.getDouble(SurfaceProperty_ExposedFoundationPerimeterFields::TotalExposedPerimeter);
36
37 2 boost::optional<SurfacePropertyExposedFoundationPerimeter> surfacePropertyExposedFoundationPerimeter;
38
39
1/1
✓ Branch 1 taken 2 times.
2 OptionalWorkspaceObject target = workspaceObject.getTarget(openstudio::SurfaceProperty_ExposedFoundationPerimeterFields::SurfaceName);
40
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (target) {
41
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
42
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (modelObject) {
43
3/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
4 if (modelObject->optionalCast<Surface>()) {
44
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 boost::optional<Surface> surface = modelObject->optionalCast<Surface>();
45
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 surfacePropertyExposedFoundationPerimeter = surface.get().createSurfacePropertyExposedFoundationPerimeter(*s, *d);
46 2 }
47 }
48 2 }
49
50
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 return surfacePropertyExposedFoundationPerimeter.get();
51 2 }
52
53 } // namespace energyplus
54
55 } // namespace openstudio
56