test/testtokenize.cpp: use tokenizeAndStringify() function.

Instead of self-written code.

No functional change.
This commit is contained in:
Slava Semushin 2009-07-25 16:41:16 +07:00
parent 9fa8c0ee9c
commit 88d7c598e3
1 changed files with 4 additions and 11 deletions

View File

@ -351,17 +351,10 @@ private:
" if (5==5);\n"
"}\n";
// tokenize..
Tokenizer tokenizer;
std::istringstream istr(code);
tokenizer.tokenize(istr, "test.cpp");
tokenizer.simplifyTokenList();
std::ostringstream ostr;
for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next())
ostr << " " << tok->str();
ASSERT_EQUALS(" void f ( ) { { ; } }", ostr.str());
ASSERT_EQUALS("void f ( )\n"
"{\n"
"{ ; }\n"
"}", tokenizeAndStringify(code, true));
}
void ifAddBraces1()