Skip to content

Do not shadow the "result" variable and fix one use of it [blocks: #2310] #3352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2018
Merged
Changes from all 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
20 changes: 10 additions & 10 deletions unit/util/symbol_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ SCENARIO("journalling_symbol_table_writer",
}
WHEN("Adding the same symbol again")
{
auto result=symbol_table.insert(symbol);
const auto result_re_insert = symbol_table.insert(symbol);
THEN("The insert should fail")
{
REQUIRE(!result.second);
REQUIRE(!result_re_insert.second);
}
}
}
Expand Down Expand Up @@ -106,10 +106,10 @@ SCENARIO("journalling_symbol_table_writer",
WHEN("Moving the same symbol again")
{
symbolt *symbol_in_table2;
auto result=symbol_table.move(symbol, symbol_in_table2);
const auto result_move = symbol_table.move(symbol, symbol_in_table2);
THEN("The move should fail")
{
REQUIRE(result);
REQUIRE(result_move);
}
THEN("The returned pointer should match the previous move result")
{
Expand Down Expand Up @@ -145,10 +145,10 @@ SCENARIO("journalling_symbol_table_writer",
}
WHEN("Adding the same symbol again")
{
auto result=symbol_table.add(symbol);
auto result_add_2 = symbol_table.add(symbol);
THEN("The insert should fail")
{
REQUIRE(result);
REQUIRE(result_add_2);
}
}
}
Expand Down Expand Up @@ -259,16 +259,16 @@ SCENARIO("journalling_symbol_table_writer",
{
symbolt symbol;
symbol.name = symbol_name;
auto result=symbol_table.add(symbol);
const auto result_add_1 = symbol_table.add(symbol);
symbol_table.remove(symbol.name);
auto result2=symbol_table.add(symbol);
const auto result_add_2 = symbol_table.add(symbol);
THEN("The first add should succeed")
{
REQUIRE(!result);
REQUIRE(!result_add_1);
}
THEN("The second add should succeed")
{
REQUIRE(!result);
REQUIRE(!result_add_2);
}
THEN("The symbol should be journalled as updated but not removed")
{
Expand Down