Skip to content
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

testrunner: stop comparing mismatching types in generic assertEquals() / added ASSERT_EQUALS_ENUM #6035

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Feb 25, 2024

If only one case explicitly specified the enum it would have compiled with ASSERT_EQUALS but we would be have an implicit conversion and would not have detected a type mismatch.

@firewave firewave marked this pull request as draft February 25, 2024 19:51
@firewave firewave changed the title added ASSERT_EQUALS_ENUM testrunner: stop comparing mismatching types in generic assertEquals() / added ASSERT_EQUALS_ENUM Feb 25, 2024
@firewave firewave force-pushed the assert-enum branch 2 times, most recently from eea413d to 3c27fd2 Compare February 25, 2024 20:09
@firewave firewave marked this pull request as ready for review February 25, 2024 20:09
@@ -827,8 +827,8 @@ class TestLibrary : public TestFixture {
Library library;
ASSERT(loadxmldata(library, xmldata, sizeof(xmldata)));

Library::Container& A = library.containers["A"];
Library::Container& B = library.containers["B"];
const Library::Container& A = library.containers["A"];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this false negative is already tracked in https://trac.cppcheck.net/ticket/12211.

@chrchr-github chrchr-github merged commit 0fe775c into danmar:main Feb 26, 2024
64 checks passed
@firewave firewave deleted the assert-enum branch February 26, 2024 10:57
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.

2 participants