GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 90.0% 9 / 0 / 10
Functions: 100.0% 1 / 0 / 1
Branches: 72.2% 13 / 0 / 18

src/energyplus/ForwardTranslator/ForwardTranslateVersion.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 "../ForwardTranslator.hpp"
7 #include "../../model/Version.hpp"
8 #include <utilities/idd/Version_FieldEnums.hxx>
9 #include "../../utilities/idd/IddEnums.hpp"
10 #include "../../utilities/idd/IddObject.hpp"
11 #include <utilities/idd/IddEnums.hxx>
12
13 #include "../../utilities/core/Assert.hpp"
14
15 using namespace openstudio::model;
16
17 using namespace std;
18
19 namespace openstudio {
20 namespace energyplus {
21
22 889 boost::optional<IdfObject> ForwardTranslator::translateVersion(Version& modelObject) {
23
2/2
✓ Branch 1 taken 889 times.
✓ Branch 4 taken 889 times.
889 IdfObject version(openstudio::IddObjectType::Version);
24
5/7
✓ Branch 1 taken 889 times.
✓ Branch 4 taken 889 times.
✓ Branch 7 taken 889 times.
✓ Branch 10 taken 889 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 889 times.
✗ Branch 15 not taken.
889 OS_ASSERT(istringEqual(version.iddObject().name(), "Version"));
25
26
1/1
✓ Branch 1 taken 889 times.
889 m_idfObjects.push_back(version);
27
28
1/1
✓ Branch 1 taken 889 times.
889 OptionalString s = modelObject.name();
29
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 889 times.
889 if (s) {
30 ✗ version.setName(*s);
31 }
32
33
2/2
✓ Branch 1 taken 889 times.
✓ Branch 4 taken 889 times.
889 version.setString(openstudio::VersionFields::VersionIdentifier, ENERGYPLUS_VERSION);
34
35
1/1
✓ Branch 1 taken 889 times.
1778 return boost::optional<IdfObject>(version);
36 889 }
37
38 } // namespace energyplus
39 } // namespace openstudio
40