-
Notifications
You must be signed in to change notification settings - Fork 222
Fix #5544 - Do not Warn about adding a GenericModelObject for CommentOnly #5545
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
🧪 Test Results DashboardSummary
|
| Run | XML File | Status |
|---|---|---|
| run1 | results.xml |
✅ Found |
| run3 | results.xml |
✅ Found |
| run2 | results.xml |
✅ Found |
```
[ RUN ] ModelFixture.Model_nowarn_GenericModelObject_CommentOnly
/Users/julien/Software/Others/OpenStudio/src/model/test/Model_GTest.cpp:1217: Failure
Expected equality of these values:
0
sink.logMessages().size()
Which is: 1
Expected zero log messages but found 1: [openstudio.model.Model] <0> Creating GenericModelObject for IddObjectType 'CommentOnly'.
```
97c04c7 to
145f467
Compare
| sink.setLogLevel(Warn); | ||
| EXPECT_TRUE(m.addObject(i)); | ||
| EXPECT_EQ(0, sink.logMessages().size()) << "Expected zero log messages but found " << sink.logMessages().size() << ": " << sink.string(); |
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.
Before fix there is 1 Warning
[ RUN ] ModelFixture.Model_nowarn_GenericModelObject_CommentOnly
/Users/julien/Software/Others/OpenStudio/src/model/test/Model_GTest.cpp:1217: Failure
Expected equality of these values:
0
sink.logMessages().size()
Which is: 1
Expected zero log messages but found 1: [openstudio.model.Model] <0> Creating GenericModelObject for IddObjectType 'CommentOnly'.
| if (object.iddObject().type().value() != IddObjectType::CommentOnly) { | ||
| LOG(Warn, "Creating GenericModelObject for IddObjectType '" << object.iddObject().type().valueName() << "'."); | ||
| } |
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.
Protect the Warn
joseph-robertson
left a comment
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.
LGTM. Only log warning when creating object not of IddObjectType "CommentOnly". And a new test, nice.
Pull request overview
Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.