Add regression test for #6904 (#1611)

Ticket #6904 was fixed in 34dbc3c00c.
Add a regression test to make sure it doesn't reappear.
This commit is contained in:
rikardfalkeborn 2019-01-20 10:05:09 +01:00 committed by Daniel Marjamäki
parent 0945e827c6
commit f7d85e9df2
1 changed files with 7 additions and 0 deletions

View File

@ -2831,6 +2831,13 @@ private:
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (style) Condition 'activate' is always false\n"
"[test.cpp:5]: (style) Condition 'foo' is always false\n", errout.str());
// #6904
check("void f() {\n"
" const int b[2] = { 1,0 };\n"
" if(b[1] == 2) {}\n"
"}\n");
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'b[1]==2' is always false\n", errout.str());
}
void duplicateCondition() {