You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reportError(tok, Severity::performance, "postfixOperator", "You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators");
Copy file name to clipboardExpand all lines: test/testpostfixoperator.cpp
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ class TestPostfixOperator : public TestFixture
101
101
" std::cout << k << std::endl;\n"
102
102
" return 0;\n"
103
103
"}\n");
104
-
ASSERT_EQUALS("[test.cpp:7]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
104
+
ASSERT_EQUALS("[test.cpp:7]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
105
105
106
106
check("\n"
107
107
"#include <iostream>\n"
@@ -116,7 +116,7 @@ class TestPostfixOperator : public TestFixture
116
116
" std::cout << k << std::endl;\n"
117
117
" return 0;\n"
118
118
"}\n");
119
-
ASSERT_EQUALS("[test.cpp:8]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
119
+
ASSERT_EQUALS("[test.cpp:8]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
120
120
121
121
check("\n"
122
122
"#include <iostream>\n"
@@ -132,7 +132,7 @@ class TestPostfixOperator : public TestFixture
132
132
" std::cout << k << std::endl;\n"
133
133
" return 0;\n"
134
134
"}\n");
135
-
ASSERT_EQUALS("[test.cpp:10]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
135
+
ASSERT_EQUALS("[test.cpp:10]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
136
136
137
137
138
138
check("\n"
@@ -146,7 +146,7 @@ class TestPostfixOperator : public TestFixture
146
146
" std::cout << k << std::endl;\n"
147
147
" return 0;\n"
148
148
"}\n");
149
-
ASSERT_EQUALS("[test.cpp:7]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
149
+
ASSERT_EQUALS("[test.cpp:7]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
150
150
151
151
check("\n"
152
152
"#include <iostream>\n"
@@ -199,7 +199,7 @@ class TestPostfixOperator : public TestFixture
199
199
" }\n"
200
200
" return 0;\n"
201
201
"}\n");
202
-
ASSERT_EQUALS("[test.cpp:6]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
202
+
ASSERT_EQUALS("[test.cpp:6]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
203
203
204
204
check("\n"
205
205
"#include <iostream>\n"
@@ -223,7 +223,7 @@ class TestPostfixOperator : public TestFixture
223
223
" }\n"
224
224
" return 0;\n"
225
225
"}\n");
226
-
ASSERT_EQUALS("[test.cpp:6]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
226
+
ASSERT_EQUALS("[test.cpp:6]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
227
227
228
228
check("\n"
229
229
"#include <iostream>\n"
@@ -264,7 +264,7 @@ class TestPostfixOperator : public TestFixture
264
264
" std::cout << k-- << std::endl;\n"
265
265
" return 0;\n"
266
266
"}\n");
267
-
ASSERT_EQUALS("[test.cpp:8]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
267
+
ASSERT_EQUALS("[test.cpp:8]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
268
268
269
269
check("\n"
270
270
"#include <iostream>\n"
@@ -311,7 +311,7 @@ class TestPostfixOperator : public TestFixture
311
311
" v.clear();\n"
312
312
" return 0;\n"
313
313
"}\n");
314
-
ASSERT_EQUALS("[test.cpp:8]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
314
+
ASSERT_EQUALS("[test.cpp:8]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
315
315
316
316
check("\n"
317
317
"#include <iostream>\n"
@@ -328,7 +328,7 @@ class TestPostfixOperator : public TestFixture
328
328
" }\n"
329
329
" return 0;\n"
330
330
"}\n");
331
-
ASSERT_EQUALS("[test.cpp:12]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
331
+
ASSERT_EQUALS("[test.cpp:12]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
332
332
333
333
check("\n"
334
334
"#include <iostream>\n"
@@ -344,7 +344,7 @@ class TestPostfixOperator : public TestFixture
344
344
" }\n"
345
345
" return 0;\n"
346
346
"}\n");
347
-
ASSERT_EQUALS("[test.cpp:11]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
347
+
ASSERT_EQUALS("[test.cpp:11]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
348
348
349
349
check("\n"
350
350
"#include <iostream>\n"
@@ -361,7 +361,7 @@ class TestPostfixOperator : public TestFixture
361
361
" }\n"
362
362
" return 0;\n"
363
363
"}\n");
364
-
ASSERT_EQUALS("[test.cpp:12]: (performance) You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators\n", errout.str());
364
+
ASSERT_EQUALS("[test.cpp:12]: (performance) Prefer prefix ++/-- operators for non-primitive types.\n", errout.str());
0 commit comments