Refactorizations in test suite:
- Removed another custom stringify implementation (testtoken.cpp) - Removed unnecessary forward declaration (testsuite.h) - Use std::ostringstream instead of std::stringstream (redirect.h)
This commit is contained in:
parent
8e5949c6ce
commit
a971e1530b
|
@ -62,8 +62,8 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
std::stringstream _out;
|
||||
std::stringstream _err;
|
||||
std::ostringstream _out;
|
||||
std::ostringstream _err;
|
||||
std::streambuf* _oldCout;
|
||||
std::streambuf *_oldCerr;
|
||||
};
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
|
||||
class options;
|
||||
|
||||
class Token;
|
||||
|
||||
class TestFixture : public ErrorLogger {
|
||||
private:
|
||||
static std::ostringstream errmsg;
|
||||
|
|
|
@ -207,13 +207,7 @@ private:
|
|||
void eraseTokens() {
|
||||
givenACodeSampleToTokenize code("begin ; { this code will be removed } end");
|
||||
Token::eraseTokens(code.tokens()->next(), code.tokens()->tokAt(9));
|
||||
std::ostringstream ret;
|
||||
for (const Token *tok = code.tokens(); tok; tok = tok->next()) {
|
||||
if (tok != code.tokens())
|
||||
ret << " ";
|
||||
ret << tok->str();
|
||||
}
|
||||
ASSERT_EQUALS("begin ; end", ret.str());
|
||||
ASSERT_EQUALS("begin ; end", code.tokens()->stringifyList(0, false));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue