Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style

This commit is contained in:
PKEuS 2015-03-11 22:26:33 +01:00
parent 958c05cec4
commit bc5132e0ac
51 changed files with 12 additions and 138 deletions

View File

@ -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:

View File

@ -19,9 +19,7 @@
#include "tokenize.h"
#include "checkassert.h"
#include "testsuite.h"
#include <sstream>
extern std::ostringstream errout;
class TestAssert : public TestFixture {
public:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -22,6 +22,7 @@
#include "redirect.h"
#include "timer.h"
class TestCmdlineParser : public TestFixture {
public:
TestCmdlineParser()

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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) {

View File

@ -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:

View File

@ -22,8 +22,6 @@
#include "settings.h"
#include "check.h"
extern std::ostringstream errout;
class TestGarbage : public TestFixture {
public:

View File

@ -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:

View File

@ -21,9 +21,7 @@
#include "tokenize.h"
#include "checkinternal.h"
#include "testsuite.h"
#include <sstream>
extern std::ostringstream errout;
class TestInternal : public TestFixture {
public:

View File

@ -19,9 +19,7 @@
#include "checkio.h"
#include "testsuite.h"
#include "tokenize.h"
#include <sstream>
extern std::ostringstream errout;
class TestIO : public TestFixture {
public:

View File

@ -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:

View File

@ -22,6 +22,7 @@
#include "testsuite.h"
#include <tinyxml2.h>
class TestLibrary : public TestFixture {
public:
TestLibrary() : TestFixture("TestLibrary") { }

View File

@ -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") {

View File

@ -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 {

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -16,9 +16,7 @@
#include "options.h"
#include "testsuite.h"
#include <sstream>
extern std::ostringstream errout;
class TestOptions: public TestFixture {
public:

View File

@ -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:

View File

@ -21,6 +21,7 @@
#include "testsuite.h"
#include "pathmatch.h"
class TestPathMatch : public TestFixture {
public:
TestPathMatch()

View File

@ -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:

View File

@ -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'

View File

@ -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"

View File

@ -22,10 +22,6 @@
#include "settings.h"
#include "templatesimplifier.h"
#include <sstream>
extern std::ostringstream errout;
class TestSimplifyTemplate : public TestFixture {
public:

View File

@ -21,10 +21,6 @@
#include "token.h"
#include "settings.h"
#include <sstream>
extern std::ostringstream errout;
class TestSimplifyTokens : public TestFixture {
public:

View File

@ -21,10 +21,6 @@
#include "token.h"
#include "settings.h"
#include <sstream>
extern std::ostringstream errout;
class TestSimplifyTypedef : public TestFixture {
public:

View File

@ -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:

View File

@ -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:

View File

@ -22,9 +22,7 @@
#include "testsuite.h"
#include "preprocessor.h"
#include "testutils.h"
#include <sstream>
extern std::ostringstream errout;
class TestString : public TestFixture {
public:

View File

@ -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)

View File

@ -24,9 +24,7 @@
#include <string>
#include <map>
#include <sstream>
extern std::ostringstream errout;
class TestSuppressions : public TestFixture {
public:

View File

@ -25,8 +25,6 @@
#include <map>
#include <string>
extern std::ostringstream errout;
extern std::ostringstream output;
class TestThreadExecutor : public TestFixture {
public:

View File

@ -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") {

View File

@ -24,7 +24,7 @@
#include <vector>
#include <string>
extern std::ostringstream errout;
class TestToken : public TestFixture {
public:
TestToken() : TestFixture("TestToken") {

View File

@ -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:

View File

@ -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:

View File

@ -19,9 +19,7 @@
#include "tokenize.h"
#include "checkuninitvar.h"
#include "testsuite.h"
#include <sstream>
extern std::ostringstream errout;
class TestUninitVar : public TestFixture {
public:

View File

@ -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);

View File

@ -21,9 +21,6 @@
#include "checkclass.h"
#include "testsuite.h"
#include <sstream>
extern std::ostringstream errout;
class TestUnusedPrivateFunction : public TestFixture {
public:

View File

@ -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:

View File

@ -19,9 +19,7 @@
#include "testsuite.h"
#include "checkvaarg.h"
#include "tokenize.h"
#include <sstream>
extern std::ostringstream errout;
class TestVaarg : public TestFixture {
public:

View File

@ -25,7 +25,7 @@
#include <vector>
#include <string>
extern std::ostringstream errout;
class TestValueFlow : public TestFixture {
public:
TestValueFlow() : TestFixture("TestValueFlow") {

View File

@ -21,10 +21,6 @@
#include "token.h"
#include "settings.h"
#include <sstream>
extern std::ostringstream errout;
class TestVarID : public TestFixture {
public: