Skip to content

Commit 0cb2877

Browse files
committed
made Settings objects in tests const
1 parent d87527c commit 0cb2877

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/testastutils.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class TestAstUtils : public TestFixture {
4848

4949
#define findLambdaEndToken(code) findLambdaEndToken_(code, __FILE__, __LINE__)
5050
bool findLambdaEndToken_(const char code[], const char* file, int line) {
51-
Settings settings;
51+
const Settings settings;
5252
Tokenizer tokenizer(&settings, this);
5353
std::istringstream istr(code);
5454
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -82,7 +82,7 @@ class TestAstUtils : public TestFixture {
8282

8383
#define findLambdaStartToken(code) findLambdaStartToken_(code, __FILE__, __LINE__)
8484
bool findLambdaStartToken_(const char code[], const char* file, int line) {
85-
Settings settings;
85+
const Settings settings;
8686
Tokenizer tokenizer(&settings, this);
8787
std::istringstream istr(code);
8888
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -115,7 +115,7 @@ class TestAstUtils : public TestFixture {
115115

116116
#define isNullOperand(code) isNullOperand_(code, __FILE__, __LINE__)
117117
bool isNullOperand_(const char code[], const char* file, int line) {
118-
Settings settings;
118+
const Settings settings;
119119
Tokenizer tokenizer(&settings, this);
120120
std::istringstream istr(code);
121121
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -137,7 +137,7 @@ class TestAstUtils : public TestFixture {
137137

138138
#define isReturnScope(code, offset) isReturnScope_(code, offset, __FILE__, __LINE__)
139139
bool isReturnScope_(const char code[], int offset, const char* file, int line) {
140-
Settings settings;
140+
const Settings settings;
141141
Tokenizer tokenizer(&settings, this);
142142
std::istringstream istr(code);
143143
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -168,7 +168,7 @@ class TestAstUtils : public TestFixture {
168168

169169
#define isSameExpression(code, tokStr1, tokStr2) isSameExpression_(code, tokStr1, tokStr2, __FILE__, __LINE__)
170170
bool isSameExpression_(const char code[], const char tokStr1[], const char tokStr2[], const char* file, int line) {
171-
Settings settings;
171+
const Settings settings;
172172
Library library;
173173
Tokenizer tokenizer(&settings, this);
174174
std::istringstream istr(code);
@@ -208,7 +208,7 @@ class TestAstUtils : public TestFixture {
208208

209209
#define isVariableChanged(code, startPattern, endPattern) isVariableChanged_(code, startPattern, endPattern, __FILE__, __LINE__)
210210
bool isVariableChanged_(const char code[], const char startPattern[], const char endPattern[], const char* file, int line) {
211-
Settings settings;
211+
const Settings settings;
212212
Tokenizer tokenizer(&settings, this);
213213
std::istringstream istr(code);
214214
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -231,7 +231,7 @@ class TestAstUtils : public TestFixture {
231231

232232
#define isVariableChangedByFunctionCall(code, pattern, inconclusive) isVariableChangedByFunctionCall_(code, pattern, inconclusive, __FILE__, __LINE__)
233233
bool isVariableChangedByFunctionCall_(const char code[], const char pattern[], bool *inconclusive, const char* file, int line) {
234-
Settings settings;
234+
const Settings settings;
235235
Tokenizer tokenizer(&settings, this);
236236
std::istringstream istr(code);
237237
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -260,7 +260,7 @@ class TestAstUtils : public TestFixture {
260260

261261
#define nextAfterAstRightmostLeaf(code, parentPattern, rightPattern) nextAfterAstRightmostLeaf_(code, parentPattern, rightPattern, __FILE__, __LINE__)
262262
bool nextAfterAstRightmostLeaf_(const char code[], const char parentPattern[], const char rightPattern[], const char* file, int line) {
263-
Settings settings;
263+
const Settings settings;
264264
Tokenizer tokenizer(&settings, this);
265265
std::istringstream istr(code);
266266
ASSERT_LOC(tokenizer.tokenize(istr, "test.cpp"), file, line);
@@ -285,7 +285,7 @@ class TestAstUtils : public TestFixture {
285285
enum class Result {False, True, Fail};
286286

287287
Result isUsedAsBool(const char code[], const char pattern[]) {
288-
Settings settings;
288+
const Settings settings;
289289
Tokenizer tokenizer(&settings, this);
290290
std::istringstream istr(code);
291291
if (!tokenizer.tokenize(istr, "test.cpp"))

0 commit comments

Comments
 (0)