@@ -34,22 +34,23 @@ class TestConstructors : public TestFixture {
3434 TestConstructors () : TestFixture(" TestConstructors" ) {}
3535
3636private:
37- Settings settings;
37+ Settings settings = settingsBuilder().severity(Severity::style).severity(Severity::warning).build() ;
3838
3939#define check (...) check_(__FILE__, __LINE__, __VA_ARGS__)
4040 void check_ (const char * file, int line, const char code[], bool inconclusive = false ) {
4141 // Clear the error buffer..
4242 errout.str (" " );
4343
44- settings.certainty .setEnabled (Certainty::inconclusive, inconclusive);
44+ Settings settings1 = settings;
45+ settings1.certainty .setEnabled (Certainty::inconclusive, inconclusive);
4546
4647 // Tokenize..
47- Tokenizer tokenizer (&settings , this );
48+ Tokenizer tokenizer (&settings1 , this );
4849 std::istringstream istr (code);
4950 ASSERT_LOC (tokenizer.tokenize (istr, " test.cpp" ), file, line);
5051
5152 // Check class constructors..
52- CheckClass checkClass (&tokenizer, &settings , this );
53+ CheckClass checkClass (&tokenizer, &settings1 , this );
5354 checkClass.constructors ();
5455 }
5556
@@ -68,9 +69,6 @@ class TestConstructors : public TestFixture {
6869 }
6970
7071 void run () override {
71- settings.severity .enable (Severity::style);
72- settings.severity .enable (Severity::warning);
73-
7472 TEST_CASE (simple1);
7573 TEST_CASE (simple2);
7674 TEST_CASE (simple3);
@@ -1994,11 +1992,7 @@ class TestConstructors : public TestFixture {
19941992 " { }" , true );
19951993 ASSERT_EQUALS (" [test.cpp:13]: (warning, inconclusive) Member variable 'Fred::ints' is not assigned a value in 'Fred::operator='.\n " , errout.str ());
19961994
1997- Settings s;
1998- s.certainty .setEnabled (Certainty::inconclusive, true );
1999- s.severity .enable (Severity::style);
2000- s.severity .enable (Severity::warning);
2001- LOAD_LIB_2 (s.library , " std.cfg" );
1995+ const Settings s = settingsBuilder ().severity (Severity::style).severity (Severity::warning).certainty (Certainty::inconclusive).library (" std.cfg" ).build ();
20021996 check (" struct S {\n "
20031997 " S& operator=(const S& s) { return *this; }\n "
20041998 " std::mutex m;\n "
0 commit comments