GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 81.8% 9 / 0 / 11
Functions: 100.0% 1 / 0 / 1
Branches: 58.8% 10 / 0 / 17

src/energyplus/ForwardTranslator/ForwardTranslateZoneAirContaminantBalance.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/Schedule.hpp"
8 #include "../../model/Schedule_Impl.hpp"
9 #include "../../model/ThermalZone.hpp"
10 #include "../../model/ThermalZone_Impl.hpp"
11 #include "../../model/ZoneAirContaminantBalance.hpp"
12 #include "../../model/ZoneAirContaminantBalance_Impl.hpp"
13 #include <utilities/idd/ZoneAirContaminantBalance_FieldEnums.hxx>
14 #include <utilities/idd/IddEnums.hxx>
15
16 using namespace openstudio::model;
17
18 using namespace std;
19
20 namespace openstudio {
21
22 namespace energyplus {
23
24 10 boost::optional<IdfObject> ForwardTranslator::translateZoneAirContaminantBalance(ZoneAirContaminantBalance& modelObject) {
25
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 IdfObject idfObject(openstudio::IddObjectType::ZoneAirContaminantBalance);
26
27
1/1
✓ Branch 1 taken 10 times.
10 m_idfObjects.push_back(idfObject);
28
29 {
30
2/3
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
10 if (modelObject.carbonDioxideConcentration()) {
31 ✗ idfObject.setString(ZoneAirContaminantBalanceFields::CarbonDioxideConcentration, "Yes");
32 } else {
33
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 idfObject.setString(ZoneAirContaminantBalanceFields::CarbonDioxideConcentration, "No");
34 }
35 }
36
37 {
38
2/3
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 10 times.
20 if (auto schedule = modelObject.outdoorCarbonDioxideSchedule()) {
39 ✗ idfObject.setString(ZoneAirContaminantBalanceFields::OutdoorCarbonDioxideScheduleName, schedule->nameString());
40 10 }
41 }
42
43
1/1
✓ Branch 1 taken 10 times.
20 return boost::optional<IdfObject>(idfObject);
44 10 }
45
46 } // namespace energyplus
47
48 } // namespace openstudio
49