Catch EMS variables initialized after reference#11409
Catch EMS variables initialized after reference#11409joseph-robertson wants to merge 4 commits intodevelopfrom
Conversation
…ter reference does not throw error.
|
As I understand it, Windows builds don't pick up uninitialized variables, which we treat as errors. /home/mitchute/Projects/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:1065:9: error: unused variable ‘wallSurfNum’ [-Werror=unused-variable]
1065 | int wallSurfNum = Util::FindItemInList("WALL", state->dataSurface->Surface);
| ^~~~~~~~~~~ |
|
This PR is about the EMS variable |
| " Set power_mult = site_temp_adj, !- Program Line 1", | ||
| " Set site_temp_adj = 0.1, !- Program Line 2", |
There was a problem hiding this comment.
Variable site_temp_adj is being initialized after it is referenced. We should expect an error, right?
| int wallSurfNum = Util::FindItemInList("WALL", state->dataSurface->Surface); | ||
| bool anyRan; | ||
| EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); | ||
| EXPECT_EQ(state->dataSurface->Surface(wallSurfNum).ViewFactorGround, 0.1); |
There was a problem hiding this comment.
I intentionally had this line commented out so that we could get to EXPECT_TRUE(seriousErrorFound); down below.
There was a problem hiding this comment.
Sure, feel free to do what you need. I won't interfere anymore until you need someone to look. I was just pointing out that the CI linux builds were failing due to to the unused variable, that we treat as an error.
There was a problem hiding this comment.
No problem, understood.
… just ManageSimulation.
|
Pretty sure I have this narrowed down. I think |
|
|
||
| internalVarNum = RuntimeLanguageProcessor::FindEMSVariable(*state, "site_temp_adj", 1); | ||
| ASSERT_GT(internalVarNum, 0); | ||
| EXPECT_TRUE(state->dataRuntimeLang->ErlVariable(internalVarNum).Value.initialized); |
There was a problem hiding this comment.
This is the main difference with the first test; why is this suddenly initialized?

Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer