MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / TEST_F

Function TEST_F

src/model/test/Loop_GTest.cpp:30–58  ·  view source on GitHub ↗

Test for https://github.com/NREL/OpenStudio/issues/3024

Source from the content-addressed store, hash-verified

28
29// Test for https://github.com/NREL/OpenStudio/issues/3024
30TEST_F(ModelFixture, Loop_CrashDeleteUnitaryAirLoopHVAC) {
31 Model model = Model();
32
33 AirLoopHVAC airLoopHVAC(model);
34
35 Node supplyInletNode = airLoopHVAC.supplyInletNode();
36 Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
37
38 // Add an OASys
39 ControllerOutdoorAir controllerOutdoorAir(model);
40 AirLoopHVACOutdoorAirSystem outdoorAirSystem(model, controllerOutdoorAir);
41 outdoorAirSystem.addToNode(supplyInletNode);
42 std::vector<ModelObject> inletComponents = airLoopHVAC.supplyComponents(supplyInletNode, supplyOutletNode);
43 EXPECT_EQ(3, inletComponents.size());
44
45 // Add a unitary to the mixed air node
46 AirLoopHVACUnitarySystem unitary(model);
47 Node mixedAirNode = airLoopHVAC.mixedAirNode().get();
48 unitary.addToNode(mixedAirNode);
49 inletComponents = airLoopHVAC.supplyComponents(supplyInletNode, supplyOutletNode);
50 // This added the unitary + the mixed air node, we expect 5:
51 // SupplyInletNode, OA Sys, MixedNode, Unitary, SupplyOutletNode
52 EXPECT_EQ(5, inletComponents.size());
53
54 // Remove the unitary, we should end up in the same point as before
55 unitary.remove();
56 inletComponents = airLoopHVAC.supplyComponents(supplyInletNode, supplyOutletNode);
57 EXPECT_EQ(3, inletComponents.size());
58}
59
60TEST_F(ModelFixture, Loop_DeleteUnitaryVAVChangeoverBypassAirLoopHVAC) {
61 // Note: this already passes, but this inherits StraightComponent and not ZoneHVAComponent

Callers

nothing calls this directly

Calls 10

supplyComponentsMethod · 0.80
mixedAirNodeMethod · 0.80
ModelFunction · 0.50
supplyInletNodeMethod · 0.45
supplyOutletNodeMethod · 0.45
addToNodeMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected