GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 92.3% 24 / 0 / 26
Functions: 100.0% 1 / 0 / 1
Branches: 73.1% 38 / 0 / 52

src/energyplus/ReverseTranslator/ReverseTranslateCurveRectangularHyperbola2.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/CurveRectangularHyperbola2.hpp"
9 #include "../../model/CurveRectangularHyperbola2_Impl.hpp"
10
11 #include <utilities/idd/Curve_RectangularHyperbola2_FieldEnums.hxx>
12
13 using namespace openstudio::model;
14
15 namespace openstudio {
16 namespace energyplus {
17
18 8 boost::optional<ModelObject> ReverseTranslator::translateCurveRectangularHyperbola2(const WorkspaceObject& workspaceObject) {
19
1/1
✓ Branch 1 taken 8 times.
8 CurveRectangularHyperbola2 curve(m_model);
20
21 8 OptionalString s;
22 8 OptionalDouble d;
23
24
2/3
✓ Branch 1 taken 8 times.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
16 if ((s = workspaceObject.name())) {
25
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setName(*s);
26 }
27
28
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::Coefficient1C1))) {
29
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setCoefficient1C1(*d);
30 }
31
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::Coefficient2C2))) {
32
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setCoefficient2C2(*d);
33 }
34
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::Coefficient3C3))) {
35
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setCoefficient3C3(*d);
36 }
37
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::MinimumValueofx))) {
38
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setMinimumValueofx(*d);
39 }
40
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::MaximumValueofx))) {
41
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setMaximumValueofx(*d);
42 }
43
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::MinimumCurveOutput))) {
44
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setMinimumCurveOutput(*d);
45 }
46
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola2Fields::MaximumCurveOutput))) {
47
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 curve.setMaximumCurveOutput(*d);
48 }
49
2/3
✓ Branch 1 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 8 times.
16 if ((s = workspaceObject.getString(Curve_RectangularHyperbola2Fields::InputUnitTypeforx, false, true))) {
50 ✗ curve.setInputUnitTypeforx(*s);
51 }
52
2/3
✓ Branch 1 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 8 times.
16 if ((s = workspaceObject.getString(Curve_RectangularHyperbola2Fields::OutputUnitType, false, true))) {
53 ✗ curve.setOutputUnitType(*s);
54 }
55
56
1/1
✓ Branch 1 taken 8 times.
16 return curve;
57 8 }
58
59 } // namespace energyplus
60 } // namespace openstudio
61