Skip to content

Don't report checkLibraryUseIgnore for known functions (refs #7719)#5664

Merged
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix7719
Nov 16, 2023
Merged

Don't report checkLibraryUseIgnore for known functions (refs #7719)#5664
chrchr-github merged 1 commit intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix7719

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/testleakautovar.cpp
" int* p = malloc(4);\n"
" bar(p);\n"
"}\n");
ASSERT_EQUALS("", errout.str());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something off-topic. I wonder if we also should start adding more negative/positive tests in addition to simply testing for the regression.

I was looking into removing some unnecessary settings in the unit tests but it might not be safe to remove some of those as we might just check for a message not appearing. If that result relies on an option/library being specified the tests would still pass but the message would not be absent because of the fix but because the code in question is never executed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well TestLeakAutoVar sets the checkLibrary flag, and there are tests which check the presence of that warning.

@chrchr-github chrchr-github merged commit 85172fe into cppcheck-opensource:main Nov 16, 2023
@chrchr-github chrchr-github deleted the chr_Fix7719 branch November 16, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants