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,28 +1578,23 @@ TEST(EventBaseTest, IdleTime) { ...@@ -1578,28 +1578,23 @@ TEST(EventBaseTest, IdleTime) {
int latencyCallbacks = 0; int latencyCallbacks = 0;
eventBase.setMaxLatency(6000, [&]() { eventBase.setMaxLatency(6000, [&]() {
++latencyCallbacks; ++latencyCallbacks;
if (latencyCallbacks != 1) {
switch (latencyCallbacks) {
case 1:
if (tos0.getTimeouts() < 6) {
// This could only happen if the host this test is running
// on is heavily loaded.
int64_t maxLatencyReached = duration_cast<microseconds>(
std::chrono::steady_clock::now().time_since_epoch()).count();
ASSERT_LE(43800, maxLatencyReached - testStart);
hostOverloaded = true;
break;
}
ASSERT_EQ(6, tos0.getTimeouts());
ASSERT_GE(6100, eventBase.getAvgLoopTime() - 1200);
ASSERT_LE(6100, eventBase.getAvgLoopTime() + 1200);
tos.reset(new IdleTimeTimeoutSeries(&eventBase, timeouts));
break;
default:
FAIL() << "Unexpected latency callback"; FAIL() << "Unexpected latency callback";
break;
} }
if (tos0.getTimeouts() < 6) {
// This could only happen if the host this test is running
// on is heavily loaded.
int64_t maxLatencyReached = duration_cast<microseconds>(
std::chrono::steady_clock::now().time_since_epoch()).count();
ASSERT_LE(43800, maxLatencyReached - testStart);
hostOverloaded = true;
return;
}
ASSERT_EQ(6, tos0.getTimeouts());
ASSERT_GE(6100, eventBase.getAvgLoopTime() - 1200);
ASSERT_LE(6100, eventBase.getAvgLoopTime() + 1200);
tos.reset(new IdleTimeTimeoutSeries(&eventBase, timeouts));
}); });
// 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