GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 15 / 0 / 15
Functions: 100.0% 1 / 0 / 1
Branches: 92.3% 12 / 0 / 13

src/energyplus/ReverseTranslator/ReverseTranslateOutputDiagnostics.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/OutputDiagnostics.hpp"
9 #include "../../model/OutputDiagnostics_Impl.hpp"
10
11 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
12
13 #include <utilities/idd/Output_Diagnostics_FieldEnums.hxx>
14 #include <utilities/idd/IddEnums.hxx>
15
16 using namespace openstudio::model;
17
18 namespace openstudio {
19
20 namespace energyplus {
21
22 3 boost::optional<ModelObject> ReverseTranslator::translateOutputDiagnostics(const WorkspaceObject& workspaceObject) {
23 3 boost::optional<ModelObject> result;
24
25 3 std::vector<std::string> keys;
26
27
3/3
✓ Branch 1 taken 3 times.
✓ Branch 8 taken 6 times.
✓ Branch 9 taken 3 times.
9 for (const IdfExtensibleGroup& eg : workspaceObject.extensibleGroups()) {
28
2/3
✓ Branch 1 taken 6 times.
✓ Branch 3 taken 6 times.
✗ Branch 4 not taken.
12 if (auto _s = eg.getString(Output_DiagnosticsExtensibleFields::Key)) {
29
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 keys.push_back(_s.get());
30 6 }
31 3 }
32
33
2/2
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 time.
3 if (!keys.empty()) {
34 // Instantiate an object of the class to store the values,
35
1/1
✓ Branch 1 taken 2 times.
2 auto modelObject = m_model.getUniqueModelObject<OutputDiagnostics>();
36
1/1
✓ Branch 1 taken 2 times.
2 modelObject.setKeys(keys);
37
1/1
✓ Branch 1 taken 2 times.
2 result = modelObject;
38 2 }
39
40 6 return result;
41 3 } // End of translate function
42
43 } // end namespace energyplus
44 } // end namespace openstudio
45