|
50 | 50 |
|
51 | 51 | // EnergyPlus Headers |
52 | 52 | #include "Fixtures/EnergyPlusFixture.hh" |
| 53 | +#include <EnergyPlus/DataBranchNodeConnections.hh> |
53 | 54 | #include <EnergyPlus/DataEnvironment.hh> |
54 | 55 | #include <EnergyPlus/DataGlobals.hh> |
55 | 56 | #include <EnergyPlus/DataReportingFlags.hh> |
@@ -551,3 +552,34 @@ TEST_F(EnergyPlusFixture, Test_SimulationControl_PureLoadCalc) |
551 | 552 |
|
552 | 553 | EXPECT_TRUE(compare_err_stream(error_string, true)); |
553 | 554 | } |
| 555 | + |
| 556 | +TEST_F(EnergyPlusFixture, SimulationManager_ReportLoopConnectionsTest) |
| 557 | +{ |
| 558 | + // Unit Test for Defect #11061: Test Error Message (modified level of message) |
| 559 | + state->dataBranchNodeConnections->NumCompSets = 1; |
| 560 | + state->dataBranchNodeConnections->CompSets.allocate(1); |
| 561 | + state->dataBranchNodeConnections->CompSets(1).ParentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed; |
| 562 | + state->dataBranchNodeConnections->CompSets(1).ComponentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed; |
| 563 | + state->dataBranchNodeConnections->CompSets(1).CName = "WaterHeaterMixed1"; |
| 564 | + state->dataBranchNodeConnections->CompSets(1).ParentObjectType == DataLoopNode::ConnectionObjectType::Undefined; |
| 565 | + state->dataBranchNodeConnections->CompSets(1).InletNodeName = "MixedWaterHeater1Inlet"; |
| 566 | + state->dataBranchNodeConnections->CompSets(1).OutletNodeName = "MixedWaterHeater1Outlet"; |
| 567 | + state->dataSimulationManager->WarningOut = false; |
| 568 | + state->dataBranchNodeConnections->CompSets(1).Description = "UNDEFINED"; |
| 569 | + |
| 570 | + EXPECT_THROW(EnergyPlus::SimulationManager::ReportLoopConnections(*state), std::runtime_error); |
| 571 | + |
| 572 | + std::string const error_string = delimited_string({ |
| 573 | + " ** Severe ** Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", |
| 574 | + " ** ~~~ ** Node Types are still UNDEFINED -- See Branch/Node Details file for further information", |
| 575 | + " ** ~~~ ** Inlet Node : MixedWaterHeater1Inlet", |
| 576 | + " ** ~~~ ** Outlet Node: MixedWaterHeater1Outlet", |
| 577 | + " ************* There was 1 node connection error noted.", |
| 578 | + " ** Fatal ** Please see severe error(s) and correct either the branch nodes or the component nodes so that they match.", |
| 579 | + " ...Summary of Errors that led to program termination:", |
| 580 | + " ..... Reference severe error count=1", |
| 581 | + " ..... Last severe error=Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", |
| 582 | + }); |
| 583 | + |
| 584 | + EXPECT_TRUE(compare_err_stream(error_string, true)); |
| 585 | +} |
0 commit comments