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

Method isUsedAsBool

test/testastutils.cpp:478–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476
477 template<size_t size>
478 Result isUsedAsBool(const char (&code)[size], const char pattern[]) {
479 SimpleTokenizer tokenizer(settingsDefault, *this);
480 if (!tokenizer.tokenize(code))
481 return Result::Fail;
482 const Token * const argtok = Token::findmatch(tokenizer.tokens(), pattern);
483 if (!argtok)
484 return Result::Fail;
485 return ::isUsedAsBool(argtok, settingsDefault) ? Result::True : Result::False;
486 }
487
488 void isUsedAsBool() {
489 ASSERT(Result::True == isUsedAsBool("void f() { bool b = true; }", "b"));

Callers

nothing calls this directly

Calls 2

isUsedAsBoolFunction · 0.85
tokenizeMethod · 0.80

Tested by

no test coverage detected