-
Notifications
You must be signed in to change notification settings - Fork 1.5k
improved library loading in tests #4806
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
| void initvar_smartptr() { // #10237 | ||
| Settings s; | ||
| s.libraries.emplace_back("std"); | ||
| // TODO: test shuld probably not pass without library |
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.
@chrchr-github Please have a look at this. It was added in 9d6e5c2.
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.
That should probably be LOAD_LIB_2(s.library, "std.cfg"); Since the fix was for a FP, the test is ineffective, but still passes with or without the library
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.
The changes in that commit check for smart pointers. But without the library it shouldn't know what is a smart pointer.
Let me guess - those are tracked hard-coded in the source instead of using the library.
| void uninitVarInheritClassInit() { | ||
| Settings s; | ||
| s.libraries.emplace_back("vcl"); | ||
| // TODO: test should probably not pass without library |
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.
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.
Loading a library with the name "vcl" triggers a bit of hard coded handling in cppcheck. That is unfortunate. But I think the code is intentional at least.
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.
Yes, but the test never triggers that code since it does pass without the library being loaded.
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.
hmm I believe I wanted to test that there would be no FP. I am confused why you could remove the vcl library and still don't get false positives.
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.
Please take a look. It doesn't have to be tackled within this PR though.
I only aligned
Settings::libraryandSettings::librarieswhere necessary. That will be improved in #4798.