Skip to content

Commit 6bca6ac

Browse files
committed
tests(other): increase coverage for commaSeparatedReturn (negative case; no comma in return)
Signed-off-by: Aryan Rahar <aryanrahar1@gmail.com>
1 parent e6d84cf commit 6bca6ac

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

test/testother.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11152,9 +11152,8 @@ class TestOther : public TestFixture {
1115211152
{
1115311153
check(
1115411154
"int f(){\n"
11155-
" int a = 0, b = 1;\n"
11156-
" a = (a, b); // comma in assignment, not in return\n"
11157-
" return a; // plain return\n"
11155+
" int a = 0;\n"
11156+
" return a;\n"
1115811157
"}\n",
1115911158
true, false, false
1116011159
);

test/teststl.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ class TestStl : public TestFixture {
176176

177177
TEST_CASE(checkKnownEmptyContainer);
178178
TEST_CASE(checkMutexes);
179-
TEST_CASE(commaSeparatedReturn_no_fp);
180179
}
181180

182181
struct CheckOptions
@@ -7202,17 +7201,6 @@ class TestStl : public TestFixture {
72027201
"}\n");
72037202
ASSERT_EQUALS("", errout_str());
72047203
}
7205-
void commaSeparatedReturn_no_fp()
7206-
{
7207-
check(
7208-
"int g(){\n"
7209-
" int a = 0, b = 1;\n"
7210-
" a = (a, b); // comma operator in an assignment, not in return\n"
7211-
" return a; // plain return, should not trigger\n"
7212-
"}\n"
7213-
);
7214-
ASSERT_EQUALS("", errout_str());
7215-
}
72167204
};
72177205

72187206
REGISTER_TEST(TestStl)

0 commit comments

Comments
 (0)