Refactorizations in test suite:
- Removed again one custom stringify implementation - Avoided unnecessary std::string creation in testbufferoverrun.cpp
This commit is contained in:
parent
bac8ed7127
commit
4dcb2ef57b
|
@ -33,7 +33,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
void check(const char code[], bool experimental = true, const std::string &filename="test.cpp") {
|
||||
void check(const char code[], bool experimental = true, const char filename[] = "test.cpp") {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
|
@ -47,7 +47,7 @@ private:
|
|||
// Tokenize..
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
std::istringstream istr(code);
|
||||
tokenizer.tokenize(istr, filename.c_str());
|
||||
tokenizer.tokenize(istr, filename);
|
||||
|
||||
// Assign variable ids
|
||||
tokenizer.simplifyTokenList();
|
||||
|
|
|
@ -635,11 +635,7 @@ private:
|
|||
CheckMemoryLeakInFunction checkMemoryLeak(&tokenizer, &settings, NULL);
|
||||
checkMemoryLeak.simplifycode(tokens);
|
||||
|
||||
std::ostringstream ret;
|
||||
for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next())
|
||||
ret << (tok->previous() ? " " : "") << tok->str();
|
||||
|
||||
return ret.str();
|
||||
return tokenizer.tokens()->stringifyList(0, false);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue