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

Method function_method

test/testlibrary.cpp:558–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556 }
557
558 void function_method() {
559 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
560 "<def>\n"
561 " <function name=\"CString::Format\">\n"
562 " <noreturn>false</noreturn>\n"
563 " </function>\n"
564 "</def>";
565
566 Library library;
567 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
568 ASSERT_EQUALS(library.functions().size(), 1U);
569
570 {
571 SimpleTokenizer tokenizer(settingsDefault, *this);
572 const char code[] = "CString str; str.Format();";
573 ASSERT(tokenizer.tokenize(code));
574 ASSERT(library.isnotnoreturn(Token::findsimplematch(tokenizer.tokens(), "Format")));
575 }
576
577 {
578 SimpleTokenizer tokenizer(settingsDefault, *this);
579 const char code[] = "HardDrive hd; hd.Format();";
580 ASSERT(tokenizer.tokenize(code));
581 ASSERT(!library.isnotnoreturn(Token::findsimplematch(tokenizer.tokens(), "Format")));
582 }
583 }
584
585 void function_baseClassMethod() {
586 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 4

findsimplematchFunction · 0.85
tokenizeMethod · 0.80
isnotnoreturnMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected