diff --git a/test/testboost.cpp b/test/testboost.cpp index 62cbc7ab5..9980ee3af 100644 --- a/test/testboost.cpp +++ b/test/testboost.cpp @@ -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(); diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index 90c8f3e9b..089020d6f 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -30,9 +30,6 @@ #include #include -// use tinyxml with STL -#include - extern std::ostringstream errout; extern std::ostringstream output; diff --git a/test/testexceptionsafety.cpp b/test/testexceptionsafety.cpp index 005e78a7f..7a1f9176f 100644 --- a/test/testexceptionsafety.cpp +++ b/test/testexceptionsafety.cpp @@ -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(""); diff --git a/test/testinternal.cpp b/test/testinternal.cpp index 0793ff67f..56dfaaca5 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -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(); diff --git a/test/teststl.cpp b/test/teststl.cpp index 274a84a2e..41b529ab9 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -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() {