GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 88.9% 8 / 0 / 9
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 7 / 0 / 7

src/energyplus/ReverseTranslator/ReverseTranslateOutputSchedules.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/OutputSchedules.hpp"
9 #include "../../model/OutputSchedules_Impl.hpp"
10
11 #include <utilities/idd/Output_Schedules_FieldEnums.hxx>
12 #include <utilities/idd/IddEnums.hxx>
13
14 using namespace openstudio::model;
15
16 namespace openstudio {
17
18 namespace energyplus {
19
20 3 boost::optional<ModelObject> ReverseTranslator::translateOutputSchedules(const WorkspaceObject& workspaceObject) {
21 3 boost::optional<ModelObject> result;
22
23
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 1 time.
6 if (boost::optional<std::string> keyField_ = workspaceObject.getString(Output_SchedulesFields::KeyField, false, true)) {
24 // This is a Unique ModelObject
25
1/1
✓ Branch 1 taken 2 times.
2 auto modelObject = m_model.getUniqueModelObject<OutputSchedules>();
26
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 modelObject.setKeyField(keyField_.get());
27
1/1
✓ Branch 1 taken 2 times.
2 result = modelObject;
28 5 }
29
30 3 return result;
31
32 ✗ } // End of translate function
33
34 } // end namespace energyplus
35 } // end namespace openstudio
36