Avoid loading the same .cfg file 30 times in testsimplifytokens.cpp
This commit is contained in:
parent
affd0ffdfd
commit
3cf6c19a4b
|
@ -33,8 +33,11 @@ public:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Settings settings_std;
|
||||||
|
|
||||||
void run() {
|
void run() {
|
||||||
|
LOAD_LIB_2(settings_std.library, "std.cfg");
|
||||||
|
|
||||||
// Make sure the Tokenizer::simplifyTokenList works.
|
// Make sure the Tokenizer::simplifyTokenList works.
|
||||||
// The order of the simplifications is important. So this test
|
// The order of the simplifications is important. So this test
|
||||||
// case shall make sure the simplifications are done in the
|
// case shall make sure the simplifications are done in the
|
||||||
|
@ -311,12 +314,7 @@ private:
|
||||||
std::string tokWithStdLib(const char code[]) {
|
std::string tokWithStdLib(const char code[]) {
|
||||||
errout.str("");
|
errout.str("");
|
||||||
|
|
||||||
Settings settings;
|
Tokenizer tokenizer(&settings_std, this);
|
||||||
if ((settings.library.load("./testrunner", "../cfg/std.cfg").errorcode != Library::OK) && (settings.library.load("./testrunner", "cfg/std.cfg").errorcode != Library::OK)) {
|
|
||||||
complainMissingLib("std.cfg");
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
Tokenizer tokenizer(&settings, this);
|
|
||||||
|
|
||||||
std::istringstream istr(code);
|
std::istringstream istr(code);
|
||||||
tokenizer.tokenize(istr, "test.cpp");
|
tokenizer.tokenize(istr, "test.cpp");
|
||||||
|
|
Loading…
Reference in New Issue