-
Notifications
You must be signed in to change notification settings - Fork 461
Correct Error Message Level when Node Types are Undefined #11104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a102526
aad8987
0999f49
ee7138b
51d6f61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5257,7 +5257,11 @@ | |
| 1.205980747, !- On Cycle Loss Coefficient to Ambient Temperature {W/K} | ||
| , !- On Cycle Loss Fraction to Zone | ||
| 4.048e-06, !- Peak Use Flow Rate {m3/s} | ||
| BLDG_SWH_SCH; !- Use Flow Rate Fraction Schedule Name | ||
| BLDG_SWH_SCH, !- Use Flow Rate Fraction Schedule Name | ||
| , !- Cold Water Supply Temperature Schedule Name | ||
| SHWSys1 Pump-SHWSys1 Water HeaterNode, !- Use Side Inlet Node Name | ||
| SHWSys1 Supply Equipment Outlet Node; !- Use Side Outlet Node Name | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And yeah, good stuff getting the test file fixed up. |
||
|
|
||
|
|
||
| !- =========== ALL OBJECTS IN CLASS: PLANTLOOP =========== | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,7 @@ | |
|
|
||
| // EnergyPlus Headers | ||
| #include "Fixtures/EnergyPlusFixture.hh" | ||
| #include <EnergyPlus/DataBranchNodeConnections.hh> | ||
| #include <EnergyPlus/DataEnvironment.hh> | ||
| #include <EnergyPlus/DataGlobals.hh> | ||
| #include <EnergyPlus/DataReportingFlags.hh> | ||
|
|
@@ -551,3 +552,34 @@ TEST_F(EnergyPlusFixture, Test_SimulationControl_PureLoadCalc) | |
|
|
||
| EXPECT_TRUE(compare_err_stream(error_string, true)); | ||
| } | ||
|
|
||
| TEST_F(EnergyPlusFixture, SimulationManager_ReportLoopConnectionsTest) | ||
| { | ||
| // Unit Test for Defect #11061: Test Error Message (modified level of message) | ||
| state->dataBranchNodeConnections->NumCompSets = 1; | ||
| state->dataBranchNodeConnections->CompSets.allocate(1); | ||
| state->dataBranchNodeConnections->CompSets(1).ParentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed; | ||
| state->dataBranchNodeConnections->CompSets(1).ComponentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed; | ||
| state->dataBranchNodeConnections->CompSets(1).CName = "WaterHeaterMixed1"; | ||
| state->dataBranchNodeConnections->CompSets(1).ParentObjectType == DataLoopNode::ConnectionObjectType::Undefined; | ||
| state->dataBranchNodeConnections->CompSets(1).InletNodeName = "MixedWaterHeater1Inlet"; | ||
| state->dataBranchNodeConnections->CompSets(1).OutletNodeName = "MixedWaterHeater1Outlet"; | ||
| state->dataSimulationManager->WarningOut = false; | ||
| state->dataBranchNodeConnections->CompSets(1).Description = "UNDEFINED"; | ||
|
|
||
| EXPECT_THROW(EnergyPlus::SimulationManager::ReportLoopConnections(*state), std::runtime_error); | ||
|
|
||
| std::string const error_string = delimited_string({ | ||
| " ** Severe ** Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", | ||
| " ** ~~~ ** Node Types are still UNDEFINED -- See Branch/Node Details file for further information", | ||
| " ** ~~~ ** Inlet Node : MixedWaterHeater1Inlet", | ||
| " ** ~~~ ** Outlet Node: MixedWaterHeater1Outlet", | ||
| " ************* There was 1 node connection error noted.", | ||
| " ** Fatal ** Please see severe error(s) and correct either the branch nodes or the component nodes so that they match.", | ||
| " ...Summary of Errors that led to program termination:", | ||
| " ..... Reference severe error count=1", | ||
| " ..... Last severe error=Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", | ||
| }); | ||
|
|
||
| EXPECT_TRUE(compare_err_stream(error_string, true)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a quick aside, there is a separate unit test function that you can call that is a bit easier. In this case, we don't care what the exact error output looks like. We just really want to make sure it is reporting the node connection error. Instead of and that should be sufficient.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Myoldmopar That is very interesting and not something that I realized was an option. I will definitely try to remember that the next time I need to do something like this in a unit test. Thanks! |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fine fix, bumping it to a severe makes sense. And adding the separate flag to provide extra error context is a good change.