GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 86.5% 32 / 0 / 37
Functions: 83.3% 10 / 0 / 12
Branches: 56.2% 18 / 0 / 32

src/model/ExteriorLightsDefinition.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 "ExteriorLightsDefinition.hpp"
7 #include "ExteriorLightsDefinition_Impl.hpp"
8
9 #include <utilities/idd/OS_Exterior_Lights_Definition_FieldEnums.hxx>
10 #include <utilities/idd/IddEnums.hxx>
11
12 #include "../utilities/core/Assert.hpp"
13
14 namespace openstudio {
15 namespace model {
16
17 namespace detail {
18
19 20 ExteriorLightsDefinition_Impl::ExteriorLightsDefinition_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
20 20 : ExteriorLoadDefinition_Impl(idfObject, model, keepHandle) {
21
4/6
✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
✓ Branch 7 taken 20 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 20 times.
✗ Branch 13 not taken.
20 OS_ASSERT(idfObject.iddObject().type() == ExteriorLightsDefinition::iddObjectType());
22 20 }
23
24 5 ExteriorLightsDefinition_Impl::ExteriorLightsDefinition_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model,
25 5 bool keepHandle)
26 5 : ExteriorLoadDefinition_Impl(other, model, keepHandle) {
27
4/6
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 13 not taken.
5 OS_ASSERT(other.iddObject().type() == ExteriorLightsDefinition::iddObjectType());
28 5 }
29
30 6 ExteriorLightsDefinition_Impl::ExteriorLightsDefinition_Impl(const ExteriorLightsDefinition_Impl& other, Model_Impl* model, bool keepHandle)
31 6 : ExteriorLoadDefinition_Impl(other, model, keepHandle) {}
32
33 // TODO: remove
34 ✗ const std::vector<std::string>& ExteriorLightsDefinition_Impl::outputVariableNames() const {
35 ✗ static const std::vector<std::string> result;
36 ✗ return result;
37 }
38
39 ✗ IddObjectType ExteriorLightsDefinition_Impl::iddObjectType() const {
40 ✗ return ExteriorLightsDefinition::iddObjectType();
41 }
42
43 5 double ExteriorLightsDefinition_Impl::designLevel() const {
44
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_Exterior_Lights_DefinitionFields::DesignLevel, true);
45
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
46
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
47 }
48
49 23 bool ExteriorLightsDefinition_Impl::setDesignLevel(double designLevel) {
50 23 bool result = setDouble(OS_Exterior_Lights_DefinitionFields::DesignLevel, designLevel);
51 23 return result;
52 }
53
54 } // namespace detail
55
56 15 ExteriorLightsDefinition::ExteriorLightsDefinition(const Model& model) : ExteriorLoadDefinition(ExteriorLightsDefinition::iddObjectType(), model) {
57
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 15 times.
✗ Branch 5 not taken.
15 OS_ASSERT(getImpl<detail::ExteriorLightsDefinition_Impl>());
58
59
1/1
✓ Branch 1 taken 15 times.
15 bool ok = setDesignLevel(0.0);
60
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
15 OS_ASSERT(ok);
61 15 }
62
63 7777 IddObjectType ExteriorLightsDefinition::iddObjectType() {
64
1/1
✓ Branch 1 taken 7777 times.
7777 IddObjectType result(IddObjectType::OS_Exterior_Lights_Definition);
65 7777 return result;
66 }
67
68 5 double ExteriorLightsDefinition::designLevel() const {
69
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::ExteriorLightsDefinition_Impl>()->designLevel();
70 }
71
72 23 bool ExteriorLightsDefinition::setDesignLevel(double designLevel) {
73
1/1
✓ Branch 3 taken 23 times.
23 return getImpl<detail::ExteriorLightsDefinition_Impl>()->setDesignLevel(designLevel);
74 }
75
76 /// @cond
77 11 ExteriorLightsDefinition::ExteriorLightsDefinition(std::shared_ptr<detail::ExteriorLightsDefinition_Impl> impl)
78
1/1
✓ Branch 3 taken 11 times.
11 : ExteriorLoadDefinition(std::move(impl)) {}
79 /// @endcond
80
81 } // namespace model
82 } // namespace openstudio
83