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

Method function_match_args

test/testlibrary.cpp:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 }
146
147 void function_match_args() const {
148 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
149 "<def>\n"
150 " <function name=\"foo\">\n"
151 " <arg nr=\"1\"/>"
152 " </function>\n"
153 "</def>";
154
155 TokenList tokenList(settingsDefault, Standards::Language::CPP);
156 const char code[] = "foo();"; // <- too few arguments, not library function
157 ASSERT(tokenList.createTokensFromString(code));
158 Token::createMutualLinks(tokenList.front()->next(), tokenList.back()->previous());
159 tokenList.createAst();
160
161 Library library;
162 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
163 ASSERT(library.isNotLibraryFunction(tokenList.front()));
164 }
165
166 void function_match_args_default() const {
167 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 5

nextMethod · 0.80
frontMethod · 0.80
createAstMethod · 0.80
isNotLibraryFunctionMethod · 0.80

Tested by

no test coverage detected