From 2c1e36e63eed610e951d1d64261619c703447f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Mon, 13 Apr 2020 13:44:48 +0200 Subject: [PATCH] cleaned up includes based on include-what-you-use (#2600) * cleaned up includes based on include-what-you-use * check.h: trying to work around Visual Studio 2012 bug * fixed Visual Studio compilation --- cli/cppcheckexecutor.cpp | 1 - cli/threadexecutor.h | 4 +++- gui/checkthread.h | 2 +- gui/codeeditor.cpp | 1 + gui/codeeditor.h | 5 +---- gui/codeeditstyledialog.cpp | 2 ++ gui/codeeditstyledialog.h | 6 ++++-- gui/csvreport.cpp | 1 + gui/erroritem.h | 2 -- gui/printablereport.cpp | 1 + gui/projectfile.cpp | 1 - gui/report.h | 3 ++- gui/txtreport.cpp | 1 + gui/xmlreport.h | 2 +- lib/astutils.h | 2 +- lib/check.cpp | 1 + lib/check.h | 14 +++++++++----- lib/checkautovariables.h | 2 +- lib/checkbool.cpp | 1 - lib/checkbufferoverrun.cpp | 3 --- lib/checkbufferoverrun.h | 11 +++++++++-- lib/checkclass.cpp | 1 - lib/checkcondition.h | 2 +- lib/checkexceptionsafety.h | 1 - lib/checkinternal.cpp | 4 +++- lib/checkinternal.h | 1 + lib/checkleakautovar.cpp | 1 - lib/checkmemoryleak.cpp | 5 ----- lib/checkmemoryleak.h | 1 - lib/checknullpointer.cpp | 2 +- lib/checkother.cpp | 1 - lib/checkother.h | 8 ++++++-- lib/checkstl.cpp | 3 ++- lib/checkstl.h | 6 +++--- lib/checkuninitvar.cpp | 8 ++++++-- lib/checkuninitvar.h | 6 ++++-- lib/cppcheck.cpp | 1 - lib/ctu.cpp | 1 + lib/exprengine.h | 3 +-- lib/forwardanalyzer.cpp | 1 + lib/forwardanalyzer.h | 2 +- lib/importproject.cpp | 2 +- lib/pathanalysis.cpp | 4 +--- lib/pathanalysis.h | 2 -- lib/programmemory.h | 3 ++- lib/suppressions.cpp | 2 -- lib/suppressions.h | 1 - lib/symboldatabase.h | 6 +++++- lib/tokenize.cpp | 1 - lib/tokenlist.cpp | 3 ++- lib/tokenlist.h | 1 - test/testbufferoverrun.cpp | 4 +++- test/testexprengine.cpp | 5 ++++- test/testmemleak.cpp | 8 +------- test/testnullpointer.cpp | 5 +++-- test/testplatform.cpp | 2 +- test/testsamples.cpp | 3 ++- test/testsimplifyusing.cpp | 2 +- test/testsuppressions.cpp | 1 - test/testsymboldatabase.cpp | 3 ++- 60 files changed, 98 insertions(+), 84 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 18a0c334d..aaf85170c 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -29,7 +29,6 @@ #include "pathmatch.h" #include "preprocessor.h" #include "settings.h" -#include "standards.h" #include "suppressions.h" #include "threadexecutor.h" #include "utils.h" diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index 408b665ef..638366de7 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -19,8 +19,8 @@ #ifndef THREADEXECUTOR_H #define THREADEXECUTOR_H +#include "config.h" #include "errorlogger.h" -#include "importproject.h" #include #include @@ -32,6 +32,8 @@ #elif defined(_WIN32) #define THREADING_MODEL_WIN #include + +#include "importproject.h" #endif class Settings; diff --git a/gui/checkthread.h b/gui/checkthread.h index c92ff2d4a..3923138bd 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -22,10 +22,10 @@ #include #include "cppcheck.h" -#include "threadresult.h" #include "suppressions.h" class Settings; +class ThreadResult; /// @addtogroup GUI /// @{ diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index 9219008b6..a44e351c1 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -1,6 +1,7 @@ #include #include #include "codeeditor.h" +#include "codeeditorstyle.h" Highlighter::Highlighter(QTextDocument *parent, diff --git a/gui/codeeditor.h b/gui/codeeditor.h index 3f4f2b92c..ed73a3015 100644 --- a/gui/codeeditor.h +++ b/gui/codeeditor.h @@ -5,16 +5,13 @@ #include #include #include -#include "codeeditorstyle.h" +class CodeEditorStyle; class QPaintEvent; class QResizeEvent; class QSize; class QWidget; -class LineNumberArea; - - class Highlighter : public QSyntaxHighlighter { Q_OBJECT diff --git a/gui/codeeditstyledialog.cpp b/gui/codeeditstyledialog.cpp index 0e1701f52..4b4aaf97a 100644 --- a/gui/codeeditstyledialog.cpp +++ b/gui/codeeditstyledialog.cpp @@ -16,7 +16,9 @@ * along with this program. If not, see . */ +#include "codeeditor.h" #include "codeeditstyledialog.h" +#include "codeeditstylecontrols.h" #include #include #include diff --git a/gui/codeeditstyledialog.h b/gui/codeeditstyledialog.h index dfe424de1..08ff8024d 100644 --- a/gui/codeeditstyledialog.h +++ b/gui/codeeditstyledialog.h @@ -21,10 +21,12 @@ #include #include -#include "codeeditstylecontrols.h" -#include "codeeditor.h" #include "codeeditorstyle.h" +class CodeEditor; +class SelectColorButton; +class SelectFontWeightCombo; + class StyleEditDialog : public QDialog { Q_OBJECT public: diff --git a/gui/csvreport.cpp b/gui/csvreport.cpp index d67233b9d..b886ede20 100644 --- a/gui/csvreport.cpp +++ b/gui/csvreport.cpp @@ -20,6 +20,7 @@ #include #include #include +#include "erroritem.h" #include "report.h" #include "csvreport.h" diff --git a/gui/erroritem.h b/gui/erroritem.h index ab16ed887..342f33341 100644 --- a/gui/erroritem.h +++ b/gui/erroritem.h @@ -24,8 +24,6 @@ #include #include "errorlogger.h" -class ErrorLine; - /// @addtogroup GUI /// @{ diff --git a/gui/printablereport.cpp b/gui/printablereport.cpp index 17ec50f34..e228c4bc7 100644 --- a/gui/printablereport.cpp +++ b/gui/printablereport.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include "erroritem.h" #include "printablereport.h" #include diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index d1892fe52..e27b9eda7 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -26,7 +26,6 @@ #include "common.h" #include "importproject.h" -#include "path.h" #include "settings.h" ProjectFile::ProjectFile(QObject *parent) : diff --git a/gui/report.h b/gui/report.h index 99184f376..b5f7e1146 100644 --- a/gui/report.h +++ b/gui/report.h @@ -22,7 +22,8 @@ #include #include #include -#include "erroritem.h" + +class ErrorItem; /// @addtogroup GUI /// @{ diff --git a/gui/txtreport.cpp b/gui/txtreport.cpp index cbf25f1ea..bb78d5595 100644 --- a/gui/txtreport.cpp +++ b/gui/txtreport.cpp @@ -17,6 +17,7 @@ */ #include +#include "erroritem.h" #include "txtreport.h" TxtReport::TxtReport(const QString &filename) : diff --git a/gui/xmlreport.h b/gui/xmlreport.h index 9e917b5f9..4da954eb8 100644 --- a/gui/xmlreport.h +++ b/gui/xmlreport.h @@ -22,8 +22,8 @@ #include #include #include "report.h" -#include "erroritem.h" +class ErrorItem; class QObject; /// @addtogroup GUI diff --git a/lib/astutils.h b/lib/astutils.h index 396b773f3..7cd536a45 100644 --- a/lib/astutils.h +++ b/lib/astutils.h @@ -23,6 +23,7 @@ //--------------------------------------------------------------------------- #include +#include #include #include @@ -31,7 +32,6 @@ class Library; class Settings; -class Scope; class Token; class Variable; diff --git a/lib/check.cpp b/lib/check.cpp index 94d555dbf..5a1c92c92 100644 --- a/lib/check.cpp +++ b/lib/check.cpp @@ -19,6 +19,7 @@ //--------------------------------------------------------------------------- #include "check.h" +#include "settings.h" #include diff --git a/lib/check.h b/lib/check.h index 40306c249..e8e4fd026 100644 --- a/lib/check.h +++ b/lib/check.h @@ -22,11 +22,8 @@ //--------------------------------------------------------------------------- #include "config.h" -#include "errorlogger.h" -#include "settings.h" #include "token.h" #include "tokenize.h" -#include "valueflow.h" #include #include @@ -39,6 +36,13 @@ namespace CTU { class FileInfo; } +namespace ValueFlow { + class Value; +} + +class Settings; +class Token; + /** Use WRONG_DATA in checkers to mark conditions that check that data is correct */ #define WRONG_DATA(COND, TOK) (wrongData((TOK), (COND), #COND)) @@ -110,10 +114,10 @@ public: } // Return true if an error is reported. - virtual bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) { + virtual bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& /*settings*/, ErrorLogger &errorLogger) { (void)ctu; (void)fileInfo; - (void)settings; + //(void)settings; (void)errorLogger; return false; } diff --git a/lib/checkautovariables.h b/lib/checkautovariables.h index bda712422..5e479c523 100644 --- a/lib/checkautovariables.h +++ b/lib/checkautovariables.h @@ -24,10 +24,10 @@ #include "check.h" #include "config.h" +#include "errorlogger.h" #include -class ErrorLogger; class Settings; class Token; class Tokenizer; diff --git a/lib/checkbool.cpp b/lib/checkbool.cpp index d5649b112..16a1cb92d 100644 --- a/lib/checkbool.cpp +++ b/lib/checkbool.cpp @@ -27,7 +27,6 @@ #include "symboldatabase.h" #include "token.h" #include "tokenize.h" -#include "valueflow.h" #include #include diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 18345ac4d..e3bee8cab 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -29,7 +29,6 @@ #include "symboldatabase.h" #include "token.h" #include "tokenize.h" -#include "tokenlist.h" #include "utils.h" #include "valueflow.h" @@ -38,8 +37,6 @@ #include #include // std::accumulate #include -#include -#include //--------------------------------------------------------------------------- diff --git a/lib/checkbufferoverrun.h b/lib/checkbufferoverrun.h index 386aad59e..494dcf7c6 100644 --- a/lib/checkbufferoverrun.h +++ b/lib/checkbufferoverrun.h @@ -25,10 +25,9 @@ #include "check.h" #include "config.h" #include "ctu.h" -#include "errorlogger.h" #include "mathlib.h" -#include "tokenize.h" #include "symboldatabase.h" +#include "valueflow.h" #include #include @@ -36,6 +35,14 @@ #include #include +namespace tinyxml2 { + class XMLElement; +} + +class ErrorLogger; +class Settings; +class Token; +class Tokenizer; /// @addtogroup Checks /// @{ diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 399a83e8f..bacbbed3b 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -31,7 +31,6 @@ #include #include -#include #include //--------------------------------------------------------------------------- diff --git a/lib/checkcondition.h b/lib/checkcondition.h index bcadceb20..bcb9bb966 100644 --- a/lib/checkcondition.h +++ b/lib/checkcondition.h @@ -24,11 +24,11 @@ #include "check.h" #include "config.h" +#include "errorlogger.h" #include "mathlib.h" #include -class ErrorLogger; class Settings; class Token; class Tokenizer; diff --git a/lib/checkexceptionsafety.h b/lib/checkexceptionsafety.h index 76884b61a..30ed6339a 100644 --- a/lib/checkexceptionsafety.h +++ b/lib/checkexceptionsafety.h @@ -26,7 +26,6 @@ #include "errorlogger.h" #include "token.h" #include "tokenize.h" -#include "utils.h" #include #include diff --git a/lib/checkinternal.cpp b/lib/checkinternal.cpp index e7848c351..01faafa61 100644 --- a/lib/checkinternal.cpp +++ b/lib/checkinternal.cpp @@ -21,8 +21,10 @@ #include "checkinternal.h" #include "astutils.h" +#include "errorlogger.h" #include "symboldatabase.h" -#include "utils.h" +#include "token.h" +#include "tokenize.h" #include #include diff --git a/lib/checkinternal.h b/lib/checkinternal.h index 28d0800bc..7eee138a8 100644 --- a/lib/checkinternal.h +++ b/lib/checkinternal.h @@ -24,6 +24,7 @@ #include "check.h" #include "config.h" +#include "settings.h" #include diff --git a/lib/checkleakautovar.cpp b/lib/checkleakautovar.cpp index 4ea5c7396..d19bcda13 100644 --- a/lib/checkleakautovar.cpp +++ b/lib/checkleakautovar.cpp @@ -31,7 +31,6 @@ #include "symboldatabase.h" #include "token.h" #include "tokenize.h" -#include "valueflow.h" #include #include diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index acb4e14c3..a76656b4a 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -21,20 +21,15 @@ #include "astutils.h" #include "library.h" -#include "mathlib.h" #include "settings.h" -#include "standards.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" -#include "tokenlist.h" #include "utils.h" -#include "valueflow.h" #include #include #include -#include //--------------------------------------------------------------------------- diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index 424c7263b..d66dd76c7 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -43,7 +43,6 @@ class Function; class Scope; class Settings; -class SymbolDatabase; class Token; class Variable; diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 5cb202d50..4ed9a6eb9 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -23,11 +23,11 @@ #include "astutils.h" #include "errorlogger.h" #include "library.h" +#include "mathlib.h" #include "settings.h" #include "symboldatabase.h" #include "token.h" #include "tokenize.h" -#include "utils.h" #include #include diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 7a6b5d343..ac9d85d32 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include //--------------------------------------------------------------------------- diff --git a/lib/checkother.h b/lib/checkother.h index 0028c5a39..6fa4e7d92 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -24,13 +24,17 @@ #include "check.h" #include "config.h" -#include "valueflow.h" +#include "errorlogger.h" +#include "utils.h" #include #include #include -class ErrorLogger; +namespace ValueFlow { + class Value; +} + class Settings; class Token; class Tokenizer; diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 9fe1f643f..090fa9963 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -18,8 +18,9 @@ #include "checkstl.h" -#include "checknullpointer.h" #include "errorlogger.h" +#include "library.h" +#include "mathlib.h" #include "settings.h" #include "standards.h" #include "symboldatabase.h" diff --git a/lib/checkstl.h b/lib/checkstl.h index 41b002392..e0d3ec800 100644 --- a/lib/checkstl.h +++ b/lib/checkstl.h @@ -24,13 +24,13 @@ #include "check.h" #include "config.h" -#include "library.h" +#include "errorlogger.h" #include "tokenize.h" +#include "utils.h" +#include "valueflow.h" -#include #include -class ErrorLogger; class Scope; class Settings; class Token; diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index 4b56f1e32..62f81be6c 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -31,14 +31,18 @@ #include "tokenize.h" #include "valueflow.h" -#include - #include #include #include #include #include #include + + +namespace tinyxml2 { + class XMLElement; +} + //--------------------------------------------------------------------------- // Register this check class (by creating a static instance of it) diff --git a/lib/checkuninitvar.h b/lib/checkuninitvar.h index d10dd9a14..33a053ec9 100644 --- a/lib/checkuninitvar.h +++ b/lib/checkuninitvar.h @@ -25,13 +25,15 @@ #include "check.h" #include "config.h" #include "ctu.h" +#include "errorlogger.h" +#include "mathlib.h" +#include "settings.h" +#include "utils.h" #include #include -class ErrorLogger; class Scope; -class Settings; class Token; class Tokenizer; class Variable; diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 0206afb96..c41043be6 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -28,7 +28,6 @@ #include "preprocessor.h" // Preprocessor #include "suppressions.h" #include "timer.h" -#include "token.h" #include "tokenize.h" // Tokenizer #include "tokenlist.h" #include "version.h" diff --git a/lib/ctu.cpp b/lib/ctu.cpp index 8313cb66a..9cfb566ab 100644 --- a/lib/ctu.cpp +++ b/lib/ctu.cpp @@ -20,6 +20,7 @@ //--------------------------------------------------------------------------- #include "ctu.h" #include "astutils.h" +#include "settings.h" #include "symboldatabase.h" #include #include // back_inserter diff --git a/lib/exprengine.h b/lib/exprengine.h index 44da3f1d2..24cdd7b6c 100644 --- a/lib/exprengine.h +++ b/lib/exprengine.h @@ -26,10 +26,9 @@ #include #include #include -#include #include #include -#include +#include class ErrorLogger; class Tokenizer; diff --git a/lib/forwardanalyzer.cpp b/lib/forwardanalyzer.cpp index 49bc5aeed..84ec6eddc 100644 --- a/lib/forwardanalyzer.cpp +++ b/lib/forwardanalyzer.cpp @@ -3,6 +3,7 @@ #include "settings.h" #include "symboldatabase.h" #include "token.h" +#include "valueptr.h" #include diff --git a/lib/forwardanalyzer.h b/lib/forwardanalyzer.h index 908f898a9..4d49f2ffd 100644 --- a/lib/forwardanalyzer.h +++ b/lib/forwardanalyzer.h @@ -19,11 +19,11 @@ #ifndef forwardanalyzerH #define forwardanalyzerH -#include "token.h" #include "valueptr.h" #include class Settings; +class Token; struct ForwardAnalyzer { struct Action { diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 056c2cbc2..b99f71d48 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -20,10 +20,10 @@ #include "path.h" #include "settings.h" +#include "suppressions.h" #include "tinyxml2.h" #include "token.h" #include "tokenize.h" -#include "tokenlist.h" #include "utils.h" #define PICOJSON_USE_INT64 #include diff --git a/lib/pathanalysis.cpp b/lib/pathanalysis.cpp index 583430536..c8ecc2a68 100644 --- a/lib/pathanalysis.cpp +++ b/lib/pathanalysis.cpp @@ -1,10 +1,8 @@ #include "pathanalysis.h" #include "astutils.h" -#include "library.h" -#include "mathlib.h" -#include "settings.h" #include "symboldatabase.h" #include "token.h" +#include "valueflow.h" const Scope* PathAnalysis::findOuterScope(const Scope * scope) { diff --git a/lib/pathanalysis.h b/lib/pathanalysis.h index 126a6de60..6efc76d83 100644 --- a/lib/pathanalysis.h +++ b/lib/pathanalysis.h @@ -4,10 +4,8 @@ #include #include "errorlogger.h" -#include "utils.h" class Library; -class Settings; class Scope; class Token; diff --git a/lib/programmemory.h b/lib/programmemory.h index 2877f455e..68df1db4a 100644 --- a/lib/programmemory.h +++ b/lib/programmemory.h @@ -1,13 +1,14 @@ #ifndef GUARD_PROGRAMMEMORY_H #define GUARD_PROGRAMMEMORY_H -#include "config.h" #include "utils.h" #include "valueflow.h" #include "mathlib.h" #include #include +class Token; + struct ProgramMemory { using Map = std::unordered_map; Map values; diff --git a/lib/suppressions.cpp b/lib/suppressions.cpp index 3ed9ee777..854fea173 100644 --- a/lib/suppressions.cpp +++ b/lib/suppressions.cpp @@ -30,8 +30,6 @@ #include #include -class ErrorLogger; - static bool isAcceptedErrorIdChar(char c) { switch (c) { diff --git a/lib/suppressions.h b/lib/suppressions.h index ca4c4855f..a07ae3cc4 100644 --- a/lib/suppressions.h +++ b/lib/suppressions.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 2d634af7a..03f8e0b04 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -24,8 +24,8 @@ #include "config.h" #include "library.h" #include "mathlib.h" -#include "platform.h" #include "token.h" +#include "utils.h" #include #include @@ -35,6 +35,10 @@ #include #include +namespace cppcheck { + class Platform; +} + class ErrorLogger; class Function; class Scope; diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 7bd0daa71..4583c881d 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -22,7 +22,6 @@ #include "check.h" #include "library.h" #include "mathlib.h" -#include "path.h" #include "platform.h" #include "settings.h" #include "standards.h" diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index f442e7e2b..81608d0f2 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -20,9 +20,10 @@ #include "tokenlist.h" #include "errorlogger.h" -#include "mathlib.h" +#include "library.h" #include "path.h" #include "settings.h" +#include "standards.h" #include "token.h" #include diff --git a/lib/tokenlist.h b/lib/tokenlist.h index 9ef144c9f..9ee65eecf 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -28,7 +28,6 @@ #include class Settings; -class Token; namespace simplecpp { class TokenList; diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 9013d219c..6d96fe312 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -17,11 +17,13 @@ */ +#include "check.h" #include "checkbufferoverrun.h" +#include "config.h" +#include "ctu.h" #include "library.h" #include "settings.h" #include "testsuite.h" -#include "token.h" #include "tokenize.h" #include diff --git a/test/testexprengine.cpp b/test/testexprengine.cpp index 829875a0e..d5b1703ad 100644 --- a/test/testexprengine.cpp +++ b/test/testexprengine.cpp @@ -16,9 +16,12 @@ * along with this program. If not, see . */ +#include "config.h" #include "exprengine.h" +#include "library.h" +#include "platform.h" #include "settings.h" -#include "symboldatabase.h" +#include "token.h" #include "tokenize.h" #include "testsuite.h" diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 40cecbaec..6a88cd302 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -16,22 +16,16 @@ * along with this program. If not, see . */ #include "checkmemoryleak.h" -#include "preprocessor.h" +#include "config.h" #include "settings.h" -#include "simplecpp.h" -#include "standards.h" #include "symboldatabase.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" -#include "tokenlist.h" #include #include #include -#include - -struct InternalError; class TestMemleak : private TestFixture { diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 92bb85c92..bed036f28 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -16,8 +16,10 @@ * along with this program. If not, see . */ +#include "check.h" #include "checknullpointer.h" -#include "checkuninitvar.h" +#include "config.h" +#include "ctu.h" #include "library.h" #include "settings.h" #include "testsuite.h" @@ -25,7 +27,6 @@ #include "tokenize.h" #include -#include #include #include #include diff --git a/test/testplatform.cpp b/test/testplatform.cpp index 27ca7bb62..b60b7a0fe 100644 --- a/test/testplatform.cpp +++ b/test/testplatform.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include "errorlogger.h" +#include "config.h" #include "platform.h" #include "testsuite.h" diff --git a/test/testsamples.cpp b/test/testsamples.cpp index 19db64b6a..d395be6cf 100644 --- a/test/testsamples.cpp +++ b/test/testsamples.cpp @@ -16,13 +16,14 @@ * along with this program. If not, see . */ +#include "config.h" #include "cppcheckexecutor.h" #include "errorlogger.h" -#include "cppcheck.h" #include "filelister.h" #include "path.h" #include "pathmatch.h" #include "redirect.h" +#include "settings.h" #include "testsuite.h" #include diff --git a/test/testsimplifyusing.cpp b/test/testsimplifyusing.cpp index 02011c0d8..e82598dcd 100644 --- a/test/testsimplifyusing.cpp +++ b/test/testsimplifyusing.cpp @@ -17,12 +17,12 @@ */ +#include "config.h" #include "platform.h" #include "settings.h" #include "testsuite.h" #include "token.h" #include "tokenize.h" -#include "tokenlist.h" struct InternalError; diff --git a/test/testsuppressions.cpp b/test/testsuppressions.cpp index 63a9266aa..eed41391b 100644 --- a/test/testsuppressions.cpp +++ b/test/testsuppressions.cpp @@ -22,7 +22,6 @@ #include "suppressions.h" #include "testsuite.h" #include "threadexecutor.h" -#include "path.h" #include #include diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index daa561bf5..4952388fb 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "config.h" +#include "library.h" #include "platform.h" #include "settings.h" #include "symboldatabase.h" @@ -24,7 +26,6 @@ #include "token.h" #include "tokenize.h" #include "tokenlist.h" -#include "utils.h" #include #include