aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/backoff
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:34:04 -0800
committerGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:34:04 -0800
commit4d20a666850b732cf1562487fb5f46ab9654105f (patch)
tree9059162d0f125e02780f506c2476d5d9bbc0eb7d /test/core/backoff
parentcddf6f838aa48c8d5c9f75cee5a8ed8abdcb25b9 (diff)
Run clang fmt
Diffstat (limited to 'test/core/backoff')
-rw-r--r--test/core/backoff/backoff_test.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/core/backoff/backoff_test.cc b/test/core/backoff/backoff_test.cc
index 35a3b1459f..1998a83977 100644
--- a/test/core/backoff/backoff_test.cc
+++ b/test/core/backoff/backoff_test.cc
@@ -143,10 +143,10 @@ TEST(BackOffTest, JitterBackOff) {
grpc_millis next = backoff.NextAttemptTime();
EXPECT_EQ(next - grpc_core::ExecCtx::Get()->Now(), initial_backoff);
- grpc_millis expected_next_lower_bound =
- static_cast<grpc_millis>(static_cast<double>(current_backoff) * (1 - jitter));
- grpc_millis expected_next_upper_bound =
- static_cast<grpc_millis>(static_cast<double>(current_backoff) * (1 + jitter));
+ grpc_millis expected_next_lower_bound = static_cast<grpc_millis>(
+ static_cast<double>(current_backoff) * (1 - jitter));
+ grpc_millis expected_next_upper_bound = static_cast<grpc_millis>(
+ static_cast<double>(current_backoff) * (1 + jitter));
for (int i = 0; i < 10000; i++) {
next = backoff.NextAttemptTime();
@@ -155,12 +155,14 @@ TEST(BackOffTest, JitterBackOff) {
const grpc_millis timeout_millis = next - grpc_core::ExecCtx::Get()->Now();
EXPECT_GE(timeout_millis, expected_next_lower_bound);
EXPECT_LE(timeout_millis, expected_next_upper_bound);
- current_backoff = std::min(
- static_cast<grpc_millis>(static_cast<double>(current_backoff) * multiplier), max_backoff);
- expected_next_lower_bound =
- static_cast<grpc_millis>(static_cast<double>(current_backoff) * (1 - jitter));
- expected_next_upper_bound =
- static_cast<grpc_millis>(static_cast<double>(current_backoff) * (1 + jitter));
+ current_backoff =
+ std::min(static_cast<grpc_millis>(static_cast<double>(current_backoff) *
+ multiplier),
+ max_backoff);
+ expected_next_lower_bound = static_cast<grpc_millis>(
+ static_cast<double>(current_backoff) * (1 - jitter));
+ expected_next_upper_bound = static_cast<grpc_millis>(
+ static_cast<double>(current_backoff) * (1 + jitter));
}
}