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

Method notokens

test/testtokenlist.cpp:154–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 }
153
154 void notokens() {
155 // analyzing /usr/include/poll.h caused Path::identify() to be called with an empty filename from
156 // TokenList::determineCppC() because there are no tokens
157 const char code[] = "#include <sys/poll.h>";
158 std::vector<std::string> files;
159 simplecpp::TokenList tokens1(code, files, "poll.h", nullptr);
160 Preprocessor preprocessor(tokens1, settingsDefault, *this, Path::identify(tokens1.getFiles()[0], false));
161 simplecpp::OutputList outputList_pp;
162 simplecpp::TokenList tokensP = preprocessor.preprocess("", files, outputList_pp);
163 ASSERT(!preprocessor.reportOutput(outputList_pp, true));
164 TokenList tokenlist(settingsDefault, Standards::Language::C); // headers are treated as C files
165 tokenlist.createTokens(std::move(tokensP)); // do not assert
166 }
167
168 void ast1() const {
169 const char code[] = "('Release|x64' == 'Release|x64');";

Callers

nothing calls this directly

Calls 3

reportOutputMethod · 0.80
preprocessMethod · 0.45
createTokensMethod · 0.45

Tested by

no test coverage detected