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

Method simplifyEnum1

test/testtokenize.cpp:9062–9071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9060 }
9061
9062 void simplifyEnum1() {
9063 const char code[] = "static enum {A,B} ab;";
9064 ASSERT_EQUALS("enum Anonymous0 { A , B } ; static enum Anonymous0 ab ;", tokenizeAndStringify(code));
9065 SimpleTokenizer tokenizer(settingsDefault, *this);
9066 tokenizer.tokenize(code);
9067 const Token* tok = Token::findsimplematch(tokenizer.tokens(), "static");
9068 ASSERT(tok);
9069 ASSERT_EQUALS(tok->column(), 1);
9070 ASSERT_EQUALS(tok->next()->column(), 8);
9071 }
9072
9073 void simplifyEnum2() {
9074 const char code[] = "enum AB {A,B}; enum AB static ab; ";

Callers

nothing calls this directly

Calls 4

findsimplematchFunction · 0.85
tokenizeMethod · 0.80
columnMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected