Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style
This commit is contained in:
parent
958c05cec4
commit
bc5132e0ac
|
@ -16,13 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "check64bit.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class Test64BitPortability : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
#include "tokenize.h"
|
||||
#include "checkassert.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestAssert : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkautovariables.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestAutoVariables : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkbool.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestBool : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkboost.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestBoost : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,16 +16,13 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkbufferoverrun.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
#include <tinyxml2.h>
|
||||
#include <sstream>
|
||||
#include <climits>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestBufferOverrun : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkother.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestCharVar : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,15 +16,11 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkclass.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
#include <tinyxml2.h>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestClass : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "redirect.h"
|
||||
#include "timer.h"
|
||||
|
||||
|
||||
class TestCmdlineParser : public TestFixture {
|
||||
public:
|
||||
TestCmdlineParser()
|
||||
|
|
|
@ -16,14 +16,11 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkcondition.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
#include <tinyxml2.h>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestCondition : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkclass.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestConstructors : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "cppcheck.h"
|
||||
#include "cppcheckexecutor.h"
|
||||
#include "testsuite.h"
|
||||
|
@ -27,8 +26,6 @@
|
|||
#include <list>
|
||||
#include <string>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
extern std::ostringstream output;
|
||||
|
||||
class TestCppcheck : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "testsuite.h"
|
||||
#include "errorlogger.h"
|
||||
|
||||
|
||||
class TestErrorLogger : public TestFixture {
|
||||
public:
|
||||
TestErrorLogger() : TestFixture("TestErrorLogger"), fooCpp5("foo.cpp", 5), barCpp8("bar.cpp", 8) {
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkexceptionsafety.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestExceptionSafety : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include "settings.h"
|
||||
#include "check.h"
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestGarbage : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,18 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Check for unused variables..
|
||||
|
||||
|
||||
#include "testsuite.h"
|
||||
#include "tokenize.h"
|
||||
#include "checkother.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestIncompleteStatement : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -21,9 +21,7 @@
|
|||
#include "tokenize.h"
|
||||
#include "checkinternal.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestInternal : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
#include "checkio.h"
|
||||
#include "testsuite.h"
|
||||
#include "tokenize.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestIO : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkleakautovar.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestLeakAutoVar : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "testsuite.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
|
||||
class TestLibrary : public TestFixture {
|
||||
public:
|
||||
TestLibrary() : TestFixture("TestLibrary") { }
|
||||
|
|
|
@ -16,11 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "mathlib.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
|
||||
class TestMathLib : public TestFixture {
|
||||
public:
|
||||
TestMathLib() : TestFixture("TestMathLib") {
|
||||
|
|
|
@ -16,17 +16,12 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "tokenlist.h"
|
||||
#include "checkmemoryleak.h"
|
||||
#include "testsuite.h"
|
||||
#include "symboldatabase.h"
|
||||
#include "preprocessor.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestMemleak : private TestFixture {
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checknonreentrantfunctions.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestNonReentrantFunctions : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
#include "tokenize.h"
|
||||
#include "checknullpointer.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
#include <tinyxml2.h>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestNullPointer : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkobsolescentfunctions.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestObsoleteFunctions : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
|
||||
#include "options.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestOptions: public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
#include "checkother.h"
|
||||
#include "testsuite.h"
|
||||
#include "testutils.h"
|
||||
#include <sstream>
|
||||
#include <tinyxml2.h>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestOther : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "testsuite.h"
|
||||
#include "pathmatch.h"
|
||||
|
||||
|
||||
class TestPathMatch : public TestFixture {
|
||||
public:
|
||||
TestPathMatch()
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkpostfixoperator.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestPostfixOperator : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -29,11 +29,8 @@
|
|||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
extern std::ostringstream output;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Visual Studio complains about truncated values for '(char)0xff' and '(char)0xfe'
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "filelister.h"
|
||||
#include "testsuite.h"
|
||||
#include "cppcheckexecutor.h"
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
#include "settings.h"
|
||||
#include "templatesimplifier.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestSimplifyTemplate : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
#include "token.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestSimplifyTokens : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
#include "token.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestSimplifyTypedef : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checksizeof.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestSizeof : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,14 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "checkstl.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestStl : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
#include "testsuite.h"
|
||||
#include "preprocessor.h"
|
||||
#include "testutils.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestString : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -80,6 +80,10 @@ public:
|
|||
static std::size_t runTests(const options& args);
|
||||
};
|
||||
|
||||
extern std::ostringstream errout;
|
||||
extern std::ostringstream output;
|
||||
extern std::ostringstream warnings;
|
||||
|
||||
#define TEST_CASE( NAME ) if ( prepareTest(#NAME) ) { NAME(); }
|
||||
#define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, CONDITION)
|
||||
#define ASSERT_EQUALS( EXPECTED , ACTUAL ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL)
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestSuppressions : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
extern std::ostringstream output;
|
||||
|
||||
class TestThreadExecutor : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,12 +16,11 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "timer.h"
|
||||
#include "testsuite.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
class TestTimer : public TestFixture {
|
||||
public:
|
||||
TestTimer() : TestFixture("TestTimer") {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestToken : public TestFixture {
|
||||
public:
|
||||
TestToken() : TestFixture("TestToken") {
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include "preprocessor.h" // usually tests here should not use preprocessor...
|
||||
#include <cstring>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestTokenizer : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
#include "checktype.h"
|
||||
#include "testsuite.h"
|
||||
#include "testutils.h"
|
||||
#include <sstream>
|
||||
#include <tinyxml2.h>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestType : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
#include "tokenize.h"
|
||||
#include "checkuninitvar.h"
|
||||
#include "testsuite.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestUninitVar : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
#include "tokenize.h"
|
||||
#include "testsuite.h"
|
||||
#include "checkunusedfunctions.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestUnusedFunctions : public TestFixture {
|
||||
public:
|
||||
|
@ -31,7 +29,6 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
|
||||
void run() {
|
||||
TEST_CASE(incondition);
|
||||
TEST_CASE(return1);
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
#include "checkclass.h"
|
||||
#include "testsuite.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestUnusedPrivateFunction : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -16,16 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Check for unused variables..
|
||||
|
||||
#include "testsuite.h"
|
||||
#include "tokenize.h"
|
||||
#include "checkunusedvar.h"
|
||||
|
||||
#include <sstream>
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestUnusedVar : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
#include "testsuite.h"
|
||||
#include "checkvaarg.h"
|
||||
#include "tokenize.h"
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestVaarg : public TestFixture {
|
||||
public:
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
class TestValueFlow : public TestFixture {
|
||||
public:
|
||||
TestValueFlow() : TestFixture("TestValueFlow") {
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
#include "token.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
extern std::ostringstream errout;
|
||||
|
||||
|
||||
class TestVarID : public TestFixture {
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue