GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 84.6% 11 / 0 / 13
Functions: 100.0% 1 / 0 / 1
Branches: 63.6% 14 / 0 / 22

src/energyplus/ReverseTranslator/ReverseTranslateRunPeriodControlDaylightSavingTime.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/RunPeriodControlDaylightSavingTime.hpp"
9 #include "../../model/RunPeriodControlDaylightSavingTime_Impl.hpp"
10 #include <utilities/idd/OS_RunPeriodControl_DaylightSavingTime_FieldEnums.hxx>
11 #include <utilities/idd/IddEnums.hxx>
12
13 #include <utilities/idd/RunPeriodControl_DaylightSavingTime_FieldEnums.hxx>
14 #include "../../utilities/idd/IddEnums.hpp"
15
16 using namespace openstudio::model;
17
18 namespace openstudio {
19
20 namespace energyplus {
21
22 11 OptionalModelObject ReverseTranslator::translateRunPeriodControlDaylightSavingTime(const WorkspaceObject& workspaceObject) {
23
4/5
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 7 taken 11 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 11 times.
11 if (workspaceObject.iddObject().type() != IddObjectType::RunPeriodControl_DaylightSavingTime) {
24 ✗ LOG(Error, "WorkspaceObject is not IddObjectType: RunPeriodControl_DaylightSavingTime");
25 ✗ return boost::none;
26 }
27
28
1/1
✓ Branch 1 taken 11 times.
11 auto dst = m_model.getUniqueModelObject<RunPeriodControlDaylightSavingTime>();
29
30
1/1
✓ Branch 1 taken 11 times.
11 OptionalString s = workspaceObject.getString(RunPeriodControl_DaylightSavingTimeFields::StartDate);
31
1/2
✓ Branch 0 taken 11 times.
✗ Branch 1 not taken.
11 if (s) {
32
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 dst.setStartDate(*s);
33 }
34
35
1/1
✓ Branch 1 taken 11 times.
11 s = workspaceObject.getString(RunPeriodControl_DaylightSavingTimeFields::EndDate);
36
1/2
✓ Branch 0 taken 11 times.
✗ Branch 1 not taken.
11 if (s) {
37
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 dst.setEndDate(*s);
38 }
39
40
1/1
✓ Branch 1 taken 11 times.
11 return dst;
41 11 }
42
43 } // namespace energyplus
44
45 } // namespace openstudio
46