-
Notifications
You must be signed in to change notification settings - Fork 461
Catch EMS variables initialized after reference #11409
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
base: develop
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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