Skip to content

Commit

Permalink
Add a test that crashes for #4544
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Mar 23, 2022
1 parent 6640698 commit 7324ae2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/model/test/CoilCoolingDX_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,29 @@ TEST_F(ModelFixture, CoilCoolingDX_cloneParent) {
EXPECT_EQ(dx, unitary.coolingCoil().get());
EXPECT_NE(dx, unitaryClone.coolingCoil().get());
}

TEST_F(ModelFixture, CoilCoolingDX_cloneOtherModel) {
Model model;

CoilCoolingDXCurveFitOperatingMode operatingMode(model);
CoilCoolingDXCurveFitPerformance performance(model, operatingMode);
CoilCoolingDX dx(model, performance);

EXPECT_EQ(performance, dx.performanceObject());
EXPECT_EQ(1u, model.getConcreteModelObjects<CoilCoolingDX>().size());
EXPECT_EQ(1u, model.getConcreteModelObjects<CoilCoolingDXCurveFitPerformance>().size());
EXPECT_EQ(1u, model.getConcreteModelObjects<CoilCoolingDXCurveFitOperatingMode>().size());

Model model2;
auto dxClone = dx.clone(model2).cast<CoilCoolingDX>();
EXPECT_EQ(1u, model.getConcreteModelObjects<CoilCoolingDX>().size());
EXPECT_EQ(1u, model.getConcreteModelObjects<CoilCoolingDXCurveFitPerformance>().size());
EXPECT_EQ(1u, model.getConcreteModelObjects<CoilCoolingDXCurveFitOperatingMode>().size());

EXPECT_EQ(1u, model2.getConcreteModelObjects<CoilCoolingDX>().size());
EXPECT_EQ(1u, model2.getConcreteModelObjects<CoilCoolingDXCurveFitPerformance>().size());
EXPECT_EQ(1u, model2.getConcreteModelObjects<CoilCoolingDXCurveFitOperatingMode>().size());

EXPECT_EQ(performance, dx.performanceObject());
EXPECT_NE(performance, dxClone.performanceObject());
}

0 comments on commit 7324ae2

Please sign in to comment.