Commit 4168732c authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Enable -Wunreachable-code-break

Summary: Because the `break;` can be dead, and sometimes is indicitive of a different type of error.

Reviewed By: meyering

Differential Revision: D4310056

fbshipit-source-id: ad215eb9b2e5bb4d5c703582203efce893b26a76
parent 38442e01
...@@ -1578,9 +1578,10 @@ TEST(EventBaseTest, IdleTime) { ...@@ -1578,9 +1578,10 @@ TEST(EventBaseTest, IdleTime) {
int latencyCallbacks = 0; int latencyCallbacks = 0;
eventBase.setMaxLatency(6000, [&]() { eventBase.setMaxLatency(6000, [&]() {
++latencyCallbacks; ++latencyCallbacks;
if (latencyCallbacks != 1) {
FAIL() << "Unexpected latency callback";
}
switch (latencyCallbacks) {
case 1:
if (tos0.getTimeouts() < 6) { if (tos0.getTimeouts() < 6) {
// This could only happen if the host this test is running // This could only happen if the host this test is running
// on is heavily loaded. // on is heavily loaded.
...@@ -1588,18 +1589,12 @@ TEST(EventBaseTest, IdleTime) { ...@@ -1588,18 +1589,12 @@ TEST(EventBaseTest, IdleTime) {
std::chrono::steady_clock::now().time_since_epoch()).count(); std::chrono::steady_clock::now().time_since_epoch()).count();
ASSERT_LE(43800, maxLatencyReached - testStart); ASSERT_LE(43800, maxLatencyReached - testStart);
hostOverloaded = true; hostOverloaded = true;
break; return;
} }
ASSERT_EQ(6, tos0.getTimeouts()); ASSERT_EQ(6, tos0.getTimeouts());
ASSERT_GE(6100, eventBase.getAvgLoopTime() - 1200); ASSERT_GE(6100, eventBase.getAvgLoopTime() - 1200);
ASSERT_LE(6100, eventBase.getAvgLoopTime() + 1200); ASSERT_LE(6100, eventBase.getAvgLoopTime() + 1200);
tos.reset(new IdleTimeTimeoutSeries(&eventBase, timeouts)); tos.reset(new IdleTimeTimeoutSeries(&eventBase, timeouts));
break;
default:
FAIL() << "Unexpected latency callback";
break;
}
}); });
// Kick things off with an "immedite" timeout // Kick things off with an "immedite" timeout
......
...@@ -883,7 +883,6 @@ class MoveToFbStringTest ...@@ -883,7 +883,6 @@ class MoveToFbStringTest
} }
default: default:
throw std::invalid_argument("unexpected buffer type parameter"); throw std::invalid_argument("unexpected buffer type parameter");
break;
} }
memset(buf->writableData(), 'x', elementSize_); memset(buf->writableData(), 'x', elementSize_);
return buf; return buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment