3636
3737class TestTokenList : public TestFixture {
3838public:
39- TestTokenList () : TestFixture(" TestTokenList" ) {
40- settings.enforcedLang = Standards::Language::C;
41- }
39+ TestTokenList () : TestFixture(" TestTokenList" )
40+ {}
4241
4342private:
44- /* const*/ Settings settings;
45-
4643 void run () override {
4744 TEST_CASE (testaddtoken1);
4845 TEST_CASE (testaddtoken2);
@@ -55,15 +52,14 @@ class TestTokenList : public TestFixture {
5552 // inspired by #5895
5653 void testaddtoken1 () const {
5754 const std::string code = " 0x89504e470d0a1a0a" ;
58- TokenList tokenlist (settings , Standards::Language::CPP);
55+ TokenList tokenlist (settingsDefault , Standards::Language::CPP);
5956 tokenlist.addtoken (code, 1 , 1 , false );
6057 ASSERT_EQUALS (" 0x89504e470d0a1a0a" , tokenlist.front ()->str ());
6158 }
6259
6360 void testaddtoken2 () const {
6461 const std::string code = " 0xF0000000" ;
65- /* const*/ Settings settings1 = settings;
66- settings1.platform .int_bit = 32 ;
62+ const Settings settings1 = dinit (Settings, $.platform .int_bit = 32 );
6763 TokenList tokenlist (settings1, Standards::Language::CPP);
6864 tokenlist.addtoken (code, 1 , 1 , false );
6965 ASSERT_EQUALS (" 0xF0000000" , tokenlist.front ()->str ());
@@ -174,7 +170,7 @@ class TestTokenList : public TestFixture {
174170 void ast1 () const {
175171 const std::string s = " ('Release|x64' == 'Release|x64');" ;
176172
177- TokenList tokenlist (settings , Standards::Language::C);
173+ TokenList tokenlist (settingsDefault , Standards::Language::C);
178174 std::istringstream istr (s);
179175 ASSERT (tokenlist.createTokens (istr));
180176 // TODO: put this logic in TokenList
0 commit comments