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

Method function_match_var

test/testlibrary.cpp:220–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218 }
219
220 void function_match_var() const {
221 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
222 "<def>\n"
223 " <function name=\"foo\">\n"
224 " <arg nr=\"1\"/>"
225 " </function>\n"
226 "</def>";
227
228 const char code[] = "Fred foo(123);"; // <- Variable declaration, not library function
229 SimpleTokenList tokenList(code);
230 tokenList.front()->next()->astOperand1(tokenList.front());
231 tokenList.front()->next()->varId(1);
232
233 Library library;
234 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
235 ASSERT(library.isNotLibraryFunction(tokenList.front()->next()));
236 }
237
238 void function_arg() const {
239 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 4

astOperand1Method · 0.80
nextMethod · 0.80
frontMethod · 0.80
isNotLibraryFunctionMethod · 0.80

Tested by

no test coverage detected