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

Method simplifyEnum2

test/testtokenize.cpp:9073–9082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9071 }
9072
9073 void simplifyEnum2() {
9074 const char code[] = "enum AB {A,B}; enum AB static ab; ";
9075 ASSERT_EQUALS("enum AB { A , B } ; static enum AB ab ;", tokenizeAndStringify(code));
9076 SimpleTokenizer tokenizer(settingsDefault, *this);
9077 tokenizer.tokenize(code);
9078 const Token* tok = Token::findsimplematch(tokenizer.tokens(), "static");
9079 ASSERT(tok);
9080 ASSERT_EQUALS(tok->column(), 24);
9081 ASSERT_EQUALS(tok->next()->column(), 16);
9082 }
9083};
9084
9085REGISTER_TEST(TestTokenizer)

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