Refactorizations in testrunner:
- Avoid creation of std::string instances of static strings where possible in testrunner. - Removed unnecessary include of tinyxml.h in testcppcheck.cpp
This commit is contained in:
parent
37820af7f8
commit
7d33181fba
|
@ -35,7 +35,7 @@ private:
|
|||
TEST_CASE(BoostForeachContainerModification)
|
||||
}
|
||||
|
||||
void check(const std::string &code) {
|
||||
void check(const char code[]) {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
|
@ -45,7 +45,7 @@ private:
|
|||
|
||||
// Tokenize..
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
std::istringstream istr(code.c_str());
|
||||
std::istringstream istr(code);
|
||||
tokenizer.tokenize(istr, "test.cpp");
|
||||
tokenizer.simplifyTokenList();
|
||||
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
#include <list>
|
||||
#include <string>
|
||||
|
||||
// use tinyxml with STL
|
||||
#include <tinyxml.h>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
extern std::ostringstream output;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ private:
|
|||
TEST_CASE(catchExceptionByValue);
|
||||
}
|
||||
|
||||
void check(const std::string &code, bool inconclusive = false) {
|
||||
void check(const char code[], bool inconclusive = false) {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
TEST_CASE(internalError)
|
||||
}
|
||||
|
||||
void check(const std::string &code) {
|
||||
void check(const char code[]) {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
|
@ -50,7 +50,7 @@ private:
|
|||
|
||||
// Tokenize..
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
std::istringstream istr(code.c_str());
|
||||
std::istringstream istr(code);
|
||||
tokenizer.tokenize(istr, "test.cpp");
|
||||
tokenizer.simplifyTokenList();
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ private:
|
|||
|
||||
}
|
||||
|
||||
void check(const std::string &code, const bool inconclusive=false) {
|
||||
void check(const char code[], const bool inconclusive=false) {
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
|
@ -137,6 +137,9 @@ private:
|
|||
CheckStl checkStl;
|
||||
checkStl.runSimplifiedChecks(&tokenizer, &settings, this);
|
||||
}
|
||||
void check(const std::string &code, const bool inconclusive=false) {
|
||||
check(code.c_str(), inconclusive);
|
||||
}
|
||||
|
||||
|
||||
void iterator1() {
|
||||
|
|
Loading…
Reference in New Issue