We have a bunch of tests like this using the REQUIRE or google test keywords and I have to add suppresssion (no, I don't want to take the code out, I want the test run)
REQUIRE(MessageTwo == TestMessage); // cppcheck-suppress knownConditionTrueFalse - let the test confirm
REQUIRE(TestMessage == MessageTwo); // cppcheck-suppress knownConditionTrueFalse - let the test confirm
EXPECT_TRUE(mes == mesNull);
Last edit: Steve Albright 2024-05-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We have a bunch of tests like this using the REQUIRE or google test keywords and I have to add suppresssion (no, I don't want to take the code out, I want the test run)
EXPECT_TRUE(mes == mesNull);
Last edit: Steve Albright 2024-05-13
Thanks! I created ticket https://trac.cppcheck.net/ticket/12756
could you please create a minimal example code that cause the false positive? So we can add that as a regression test.
Part of the problem may have been that we didn't have googletest listed as a library so I'll have to check and see if that fixed it.
Update: the config change fixed it in the case I found.
Last edit: Steve Albright 2024-05-22