Skip to content

Commit

Permalink
Add test for #4060
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Aug 28, 2020
1 parent 757b033 commit cdb1d4e
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions src/model/test/AirLoopHVAC_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
// Casting in AVM test
#include "../AvailabilityManagerNightCycle_Impl.hpp"

#include <utilities/idd/IddEnums.hxx>

using namespace openstudio::model;

TEST_F(ModelFixture,AirLoopHVAC_AirLoopHVAC)
Expand Down Expand Up @@ -1464,3 +1466,69 @@ TEST_F(ModelFixture,AirLoopHVAC_designReturnAirFlowFractionofSupplyAirFlow) {
// TODO: Not sure if we need to limit the idd to \maximum 1.0 or not
// In theory it can be >1.0 for negative pressurization with a return fan flow that is > than supply. I can't say I've tested that use case.
}


TEST_F(ModelFixture,AirLoopHVAC_dualDuct_Clone)
{
Model m;
AirLoopHVAC a(m, true);

EXPECT_TRUE(a.isDualDuct());


EXPECT_EQ(2u,a.supplyOutletNodes().size());
EXPECT_EQ(4u,a.supplyComponents().size());

EXPECT_EQ(2u,a.supplySplitterOutletNodes().size());
ASSERT_TRUE(a.supplySplitterInletNode());
EXPECT_EQ(a.supplySplitterInletNode().get(),a.supplyInletNode());

ASSERT_TRUE(a.supplySplitter());
EXPECT_TRUE(a.supplyComponent(a.supplySplitter()->handle()));
EXPECT_TRUE(a.supplyComponent(a.supplyOutletNodes().front().handle()));
EXPECT_TRUE(a.supplyComponent(a.supplyOutletNodes().back().handle()));

EXPECT_EQ(6u, m.getConcreteModelObjects<Node>().size());
EXPECT_EQ(6u, a.components(openstudio::IddObjectType::OS_Node).size());

// Clone
AirLoopHVAC aClone = a.clone(m).cast<AirLoopHVAC>();

EXPECT_EQ(12u, m.getConcreteModelObjects<Node>().size());

{
EXPECT_EQ(2u,a.supplyOutletNodes().size());
EXPECT_EQ(4u,a.supplyComponents().size());

EXPECT_EQ(2u,a.supplySplitterOutletNodes().size());

EXPECT_EQ(6u, a.components(openstudio::IddObjectType::OS_Node).size());

ASSERT_TRUE(a.supplySplitterInletNode());
EXPECT_EQ(a.supplySplitterInletNode().get(),a.supplyInletNode());

ASSERT_TRUE(a.supplySplitter());
EXPECT_TRUE(a.supplyComponent(a.supplySplitter()->handle()));
EXPECT_TRUE(a.supplyComponent(a.supplyOutletNodes().front().handle()));
EXPECT_TRUE(a.supplyComponent(a.supplyOutletNodes().back().handle()));

}

{
EXPECT_EQ(2u,aClone.supplyOutletNodes().size());
EXPECT_EQ(4u,aClone.supplyComponents().size());

EXPECT_EQ(2u,aClone.supplySplitterOutletNodes().size());

EXPECT_EQ(6u, aClone.components(openstudio::IddObjectType::OS_Node).size());

ASSERT_TRUE(aClone.supplySplitterInletNode());
EXPECT_EQ(aClone.supplySplitterInletNode().get(),aClone.supplyInletNode());

ASSERT_TRUE(aClone.supplySplitter());
EXPECT_TRUE(aClone.supplyComponent(aClone.supplySplitter()->handle()));
EXPECT_TRUE(aClone.supplyComponent(aClone.supplyOutletNodes().front().handle()));
EXPECT_TRUE(aClone.supplyComponent(aClone.supplyOutletNodes().back().handle()));
}

}

0 comments on commit cdb1d4e

Please sign in to comment.