MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / testKnownValueOfTok_

Method testKnownValueOfTok_

test/testvalueflow.cpp:545–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543
544#define testKnownValueOfTok(...) testKnownValueOfTok_(__FILE__, __LINE__, __VA_ARGS__)
545 bool testKnownValueOfTok_(const char* file,
546 int line,
547 const char code[],
548 const char tokstr[],
549 int value)
550 {
551 std::list<ValueFlow::Value> values = removeImpossible(tokenValues_(file, line, code, tokstr));
552 return std::any_of(values.begin(), values.end(), [&](const ValueFlow::Value& v) {
553 return v.isKnown() && v.isIntValue() && v.intvalue == value;
554 });
555 }
556
557 static std::list<ValueFlow::Value> removeSymbolicTok(std::list<ValueFlow::Value> values)
558 {

Callers

nothing calls this directly

Calls 4

removeImpossibleFunction · 0.85
isKnownMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected