Skip to content

Commit 3cf6c19

Browse files
committed
Avoid loading the same .cfg file 30 times in testsimplifytokens.cpp
1 parent affd0ff commit 3cf6c19

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

test/testsimplifytokens.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ class TestSimplifyTokens : public TestFixture {
3333

3434

3535
private:
36+
Settings settings_std;
3637

3738
void run() {
39+
LOAD_LIB_2(settings_std.library, "std.cfg");
40+
3841
// Make sure the Tokenizer::simplifyTokenList works.
3942
// The order of the simplifications is important. So this test
4043
// case shall make sure the simplifications are done in the
@@ -311,12 +314,7 @@ class TestSimplifyTokens : public TestFixture {
311314
std::string tokWithStdLib(const char code[]) {
312315
errout.str("");
313316

314-
Settings settings;
315-
if ((settings.library.load("./testrunner", "../cfg/std.cfg").errorcode != Library::OK) && (settings.library.load("./testrunner", "cfg/std.cfg").errorcode != Library::OK)) {
316-
complainMissingLib("std.cfg");
317-
return "";
318-
}
319-
Tokenizer tokenizer(&settings, this);
317+
Tokenizer tokenizer(&settings_std, this);
320318

321319
std::istringstream istr(code);
322320
tokenizer.tokenize(istr, "test.cpp");

0 commit comments

Comments
 (0)