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

Method function_baseClassMethod

test/testlibrary.cpp:585–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583 }
584
585 void function_baseClassMethod() {
586 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
587 "<def>\n"
588 " <function name=\"Base::f\">\n"
589 " <arg nr=\"1\"><not-null/></arg>\n"
590 " </function>\n"
591 "</def>";
592
593 Library library;
594 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
595
596 {
597 SimpleTokenizer tokenizer(settingsDefault, *this);
598 const char code[] = "struct X : public Base { void dostuff() { f(0); } };";
599 ASSERT(tokenizer.tokenize(code));
600 ASSERT(library.isnullargbad(Token::findsimplematch(tokenizer.tokens(), "f"),1));
601 }
602
603 {
604 SimpleTokenizer tokenizer(settingsDefault, *this);
605 const char code[] = "struct X : public Base { void dostuff() { f(1,2); } };";
606 ASSERT(tokenizer.tokenize(code));
607 ASSERT(!library.isnullargbad(Token::findsimplematch(tokenizer.tokens(), "f"),1));
608 }
609 }
610
611 void function_warn() const {
612 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 3

findsimplematchFunction · 0.85
tokenizeMethod · 0.80
isnullargbadMethod · 0.80

Tested by

no test coverage detected