Refactorization: Avoid loading std.cfg multiple times in testautovariables.cpp

This commit is contained in:
PKEuS 2015-10-07 14:40:09 +02:00
parent 93dbfb72d1
commit f1bbcfe32d
1 changed files with 5 additions and 5 deletions

View File

@ -27,17 +27,13 @@ public:
} }
private: private:
Settings settings;
void check(const char code[], bool inconclusive = false, bool runSimpleChecks = true, const char* filename = "test.cpp") { void check(const char code[], bool inconclusive = false, bool runSimpleChecks = true, const char* filename = "test.cpp") {
// Clear the error buffer.. // Clear the error buffer..
errout.str(""); errout.str("");
Settings settings;
LOAD_LIB_2(settings.library, "std.cfg");
settings.inconclusive = inconclusive; settings.inconclusive = inconclusive;
settings.addEnabled("warning");
settings.addEnabled("style");
// Tokenize.. // Tokenize..
Tokenizer tokenizer(&settings, this); Tokenizer tokenizer(&settings, this);
@ -58,6 +54,10 @@ private:
} }
void run() { void run() {
settings.addEnabled("warning");
settings.addEnabled("style");
LOAD_LIB_2(settings.library, "std.cfg");
TEST_CASE(testautovar1); TEST_CASE(testautovar1);
TEST_CASE(testautovar2); TEST_CASE(testautovar2);
TEST_CASE(testautovar3); // ticket #2925 TEST_CASE(testautovar3); // ticket #2925