36
36
37
37
class TestTokenList : public TestFixture {
38
38
public:
39
- TestTokenList () : TestFixture(" TestTokenList" ) {
40
- settings.enforcedLang = Standards::Language::C;
41
- }
39
+ TestTokenList () : TestFixture(" TestTokenList" )
40
+ {}
42
41
43
42
private:
44
- /* const*/ Settings settings;
45
-
46
43
void run () override {
47
44
TEST_CASE (testaddtoken1);
48
45
TEST_CASE (testaddtoken2);
@@ -55,15 +52,14 @@ class TestTokenList : public TestFixture {
55
52
// inspired by #5895
56
53
void testaddtoken1 () const {
57
54
const std::string code = " 0x89504e470d0a1a0a" ;
58
- TokenList tokenlist (settings , Standards::Language::CPP);
55
+ TokenList tokenlist (settingsDefault , Standards::Language::CPP);
59
56
tokenlist.addtoken (code, 1 , 1 , false );
60
57
ASSERT_EQUALS (" 0x89504e470d0a1a0a" , tokenlist.front ()->str ());
61
58
}
62
59
63
60
void testaddtoken2 () const {
64
61
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 );
67
63
TokenList tokenlist (settings1, Standards::Language::CPP);
68
64
tokenlist.addtoken (code, 1 , 1 , false );
69
65
ASSERT_EQUALS (" 0xF0000000" , tokenlist.front ()->str ());
@@ -174,7 +170,7 @@ class TestTokenList : public TestFixture {
174
170
void ast1 () const {
175
171
const std::string s = " ('Release|x64' == 'Release|x64');" ;
176
172
177
- TokenList tokenlist (settings , Standards::Language::C);
173
+ TokenList tokenlist (settingsDefault , Standards::Language::C);
178
174
std::istringstream istr (s);
179
175
ASSERT (tokenlist.createTokens (istr));
180
176
// TODO: put this logic in TokenList
0 commit comments