8205 regression test (#1618)
* Fix trac ticket reference
* Add regression test for #8205
Ticket #8205 was fixed in f65cf220ba
.
Add a test case to avoid regressions.
This commit is contained in:
parent
575f62f39c
commit
080c9d53af
|
@ -4090,11 +4090,22 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) Same expression on both sides of '&&' because '!b' and 'b1' represent the same value.\n", errout.str());
|
||||
|
||||
// 7482
|
||||
// 7284
|
||||
check("void f(void) {\n"
|
||||
" if (a || !!a) {}\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:2]: (style) Same expression on both sides of '||' because 'a' and '!!a' represent the same value.\n", errout.str());
|
||||
|
||||
// 8205
|
||||
check("void f(int x) {\n"
|
||||
" int Diag = 0;\n"
|
||||
" switch (x) {\n"
|
||||
" case 12:\n"
|
||||
" if (Diag==0) {}\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:5]: (style) The expression 'Diag == 0' is always true.\n", errout.str());
|
||||
}
|
||||
|
||||
void duplicateExpression8() {
|
||||
|
|
Loading…
Reference in New Issue