$cppcheck--versionCppcheck2.15.0$cppcheck--library=googletest--enable=alltest.cppCheckingtest.cpp...test.cpp:1:0:information:Includefile:<gtest/gtest.h>notfound.Pleasenote:Cppcheckdoesnotneedstandardlibraryheaderstogetproperresults.[missingIncludeSystem]#include<gtest/gtest.h>^test.cpp:8:27:style:classmember'TestClass::ApplicationName'isneverused.[unusedStructMember]std::stringconstApplicationName="TestApp";^test.cpp:11:0:style:Thefunction'__TestClass_testCase'isneverused.[unusedFunction]TEST_F(TestClass,testCase)^nofile:0:0:information:Activecheckers:167/835(use--checkers-report=<filename> to see details) [checkersReport]
The test case is not unused and the struct member is used.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The test case is not unused and the struct member is used.
See https://trac.cppcheck.net/ticket/12782
What about the unused function warning? It seems to be happening a lot for Gtest tests, but des not happen always. I cannot see the pattern in yet.