Skip to content

Commit 1b807e1

Browse files
Add test for danmar#11 (danmar#7140)
1 parent 32ab7db commit 1b807e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/testother.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5649,6 +5649,19 @@ class TestOther : public TestFixture {
56495649
" }\n"
56505650
"}\n");
56515651
ASSERT_EQUALS("", errout_str());
5652+
5653+
check("int main(int argc, char *argv[]) {\n" // #11
5654+
" switch (argc) {\n"
5655+
" case 0: {\n"
5656+
" return 1;\n"
5657+
" }\n"
5658+
" break;\n"
5659+
" }\n"
5660+
" return 0;\n"
5661+
"}\n");
5662+
ASSERT_EQUALS("[test.cpp:6]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.\n"
5663+
"[test.cpp:1]: (style) Parameter 'argv' can be declared as const array\n",
5664+
errout_str());
56525665
}
56535666

56545667
void redundantContinue() {

0 commit comments

Comments
 (0)