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

Method function_namespace

test/testlibrary.cpp:531–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529 }
530
531 void function_namespace() const {
532 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
533 "<def>\n"
534 " <function name=\"Foo::foo,bar\">\n"
535 " <noreturn>false</noreturn>\n"
536 " </function>\n"
537 "</def>";
538
539 Library library;
540 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
541 ASSERT_EQUALS(library.functions().size(), 2U);
542 ASSERT(library.functions().at("Foo::foo").argumentChecks.empty());
543 ASSERT(library.functions().at("bar").argumentChecks.empty());
544
545 {
546 const char code[] = "Foo::foo();";
547 const SimpleTokenList tokenList(code);
548 ASSERT(library.isnotnoreturn(tokenList.front()->tokAt(2)));
549 }
550
551 {
552 const char code[] = "bar();";
553 const SimpleTokenList tokenList(code);
554 ASSERT(library.isnotnoreturn(tokenList.front()));
555 }
556 }
557
558 void function_method() {
559 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 6

atMethod · 0.80
isnotnoreturnMethod · 0.80
frontMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
tokAtMethod · 0.45

Tested by

no test coverage detected