-
Notifications
You must be signed in to change notification settings - Fork 460
Quick fix array bound error in test #11059
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
Conversation
| state->dataEconTariff->tariff(3).kindMtr = EconomicTariff::MeterType::Other; | ||
| state->dataEconTariff->tariff(3).reportMeterIndx = GetMeterIndex(*state, "DISTRICTCOOLING:FACILITY"); | ||
|
|
||
| state->dataEconTariff->tariff(4).tariffName = "DistrictHeatingUnit"; | ||
| state->dataEconTariff->tariff(4).isSelected = true; | ||
| state->dataEconTariff->tariff(4).totalAnnualCost = 15.98; | ||
| state->dataEconTariff->tariff(4).totalAnnualEnergy = 1.47; | ||
| state->dataEconTariff->tariff(3).kindMtr = EconomicTariff::MeterType::Other; | ||
| state->dataEconTariff->tariff(4).reportMeterIndx = GetMeterIndex(*state, "DISTRICTHEATINGWATER:FACILITY"); | ||
|
|
||
| for (auto &tariff : state->dataEconTariff->tariff) { | ||
| tariff.demandWindow = EconomicTariff::DemandWindow::Hour; | ||
| } |
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.
Quick fix test
| format("{}{}", | ||
| convDemandStrings[(int)distCoolUnits], | ||
| (distCoolDemWindowUnits == DemandWindow::Invalid) ? "" : demandWindowStrings[(int)distCoolDemWindowUnits])); |
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.
Optional: also protect here, like we do for gas?
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.
Yeah why not.
|
I tried committing and pushing to this branch and I can see the commit in the changes, but I cannot push and get CI going? |
| format("{}{}", | ||
| convDemandStrings[(int)distCoolUnits], | ||
| (distCoolDemWindowUnits == DemandWindow::Invalid) ? "" : demandWindowStrings[(int)distCoolDemWindowUnits])); |
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.
Yeah why not.
|
|
||
| for (auto &tariff : state->dataEconTariff->tariff) { | ||
| tariff.demandWindow = EconomicTariff::DemandWindow::Hour; | ||
| } |
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.
OK, it's fine.
@amirroth were you still wanting something additional here? |
|
I am not. There was one typo in the unit test, but this is otherwise clean. Meta-question, Why were these issues not caught by CI on the EnumPass PR? |
|
Because our Decent runs that do unit test and integration test coverage are set to RelWithDebInfo, which mutes the array bounds checking in favor of running in a more reasonable time. I think we'll be able to re-enable that while still getting some optimizations, so they will be caught in the future. |
See convo here: #11040 (comment) |
|
I'll add |
|
When did we change to RelWithDebInfo? I am worried that a lot of these errors are caused by recent PRs of mine that missed these potential issues because the errors weren’t flagged by CI. 😔 |
|
You or others alike, but that's probably it. We fixed all these errors are one point, so if they creeped in it's code changes or new tests added after relwithdebinfo was picked. |
Pull request overview
@amirroth
Pull Request Author
Reviewer