style: knownConditionTrueFalse - Finding the same expression on both sides of an operator is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct.
Code won't fully compile but you should get the idea. The text field resizes on show() so we are testing for the size change.
Definately getting it, went to a completely different repo with the same configuration and tried it there.
style: knownConditionTrueFalse - Finding the same expression on both sides of an operator is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct.
foo.cpp:1:0:style:Thefunction'__SizeChangeDialogTest_SettingOverlayVisibleWillResizeTitleLabelHeight'isneverused.[unusedFunction]TEST(SizeChangeDialogTest,SettingOverlayVisibleWillResizeTitleLabelHeight)^nofile:0:0:information:Activecheckers:178/802(use--checkers-report=<filename> to see details) [checkersReport]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
style: knownConditionTrueFalse - Finding the same expression on both sides of an operator is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct.
Code won't fully compile but you should get the idea. The text field resizes on show() so we are testing for the size change.
This passes
This does not and the only difference is Greater Than
I can't reproduce this with the snippet above.
Hmm, well, it is happening and in multiple places for me.
Do you have the google test library added - I wasn't getting the issue without it.
Yes. Can you confirm that you get the warning on just the code above? Probably there is something missing still.
Definately getting it, went to a completely different repo with the same configuration and tried it there.
style: knownConditionTrueFalse - Finding the same expression on both sides of an operator is suspicious and might indicate a cut and paste or logic error. Please examine this code carefully to determine if it is correct.
Our config looks like this
}
I just get
Hmm, well, I can consistently reproduce it.
We are probably using older google test - not sure if that matters.
Extra configuration we are doing too
Can you test with just one file and a simple command line like
cppcheck file.cpp --library=googletest --enable=all
?Solo file and reproducable in
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
Command:
cppcheck-2.14.0/build$ cppcheck ~/workspace/GreaterThanTest.cpp --library=googletest --enable=all
Output:
Last edit: Steve Albright 2024-05-29
On a different machine, I'm suddenly seeing the warning. Ticket is here: https://trac.cppcheck.net/ticket/12795