Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/teststl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class TestStl : public TestFixture {

TEST_CASE(checkKnownEmptyContainer);
TEST_CASE(checkMutexes);
TEST_CASE(commaSeparatedReturn_no_fp);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems misplaced where are our other commaSeparatedReturn tests?

my hope is that if we put related tests together it's possible to see overlaps and gaps ..

}

struct CheckOptions
Expand Down Expand Up @@ -7201,6 +7202,17 @@ class TestStl : public TestFixture {
"}\n");
ASSERT_EQUALS("", errout_str());
}
void commaSeparatedReturn_no_fp()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code is not formatted properly. Either run the runformat script or there is a diff from the "format" action that you can download and apply.

{
check(
"int g(){\n"
" int a = 0, b = 1;\n"
" a = (a, b); // comma operator in an assignment, not in return\n"
" return a; // plain return, should not trigger\n"
"}\n"
);
ASSERT_EQUALS("", errout_str());
}
};

REGISTER_TEST(TestStl)
Loading