aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
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/cpp
parentcddf6f838aa48c8d5c9f75cee5a8ed8abdcb25b9 (diff)
Run clang fmt
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/codegen/proto_utils_test.cc2
-rw-r--r--test/cpp/common/alarm_test.cc40
-rw-r--r--test/cpp/end2end/end2end_test.cc3
-rw-r--r--test/cpp/grpclb/grpclb_test.cc38
-rw-r--r--test/cpp/interop/interop_client.cc3
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_hpack.cc3
-rw-r--r--test/cpp/microbenchmarks/bm_cq_multiple_threads.cc5
-rw-r--r--test/cpp/microbenchmarks/fullstack_fixtures.h6
-rw-r--r--test/cpp/microbenchmarks/helpers.cc15
-rw-r--r--test/cpp/performance/writes_per_rpc_test.cc3
-rw-r--r--test/cpp/qps/report.cc9
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.cc3
12 files changed, 75 insertions, 55 deletions
diff --git a/test/cpp/codegen/proto_utils_test.cc b/test/cpp/codegen/proto_utils_test.cc
index d714e59b5d..b64f9a0d17 100644
--- a/test/cpp/codegen/proto_utils_test.cc
+++ b/test/cpp/codegen/proto_utils_test.cc
@@ -130,7 +130,7 @@ void BufferWriterTest(int block_size, int total_size, int backup_size) {
}
TEST(WriterTest, TinyBlockTinyBackup) {
- for (int i = 2; i < static_cast<int>GRPC_SLICE_INLINED_SIZE; i++) {
+ for (int i = 2; i < static_cast<int> GRPC_SLICE_INLINED_SIZE; i++) {
BufferWriterTest(i, 256, 1);
}
}
diff --git a/test/cpp/common/alarm_test.cc b/test/cpp/common/alarm_test.cc
index 2dc2e4b36c..376aa3e32e 100644
--- a/test/cpp/common/alarm_test.cc
+++ b/test/cpp/common/alarm_test.cc
@@ -35,8 +35,8 @@ TEST(AlarmTest, RegularExpiry) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
@@ -56,8 +56,8 @@ TEST(AlarmTest, MultithreadedRegularExpiry) {
});
std::thread t2([&cq, &ok, &output_tag, &status] {
- status = cq.AsyncNext(&output_tag, &ok,
- grpc_timeout_seconds_to_deadline(2));
+ status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
});
t1.join();
@@ -74,8 +74,8 @@ TEST(AlarmTest, DeprecatedRegularExpiry) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
@@ -90,8 +90,8 @@ TEST(AlarmTest, MoveConstructor) {
Alarm second(std::move(first));
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
EXPECT_EQ(junk, output_tag);
@@ -107,8 +107,8 @@ TEST(AlarmTest, MoveAssignment) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
@@ -125,8 +125,8 @@ TEST(AlarmTest, RegularExpiryChrono) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(2));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
@@ -141,8 +141,8 @@ TEST(AlarmTest, ZeroExpiry) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
@@ -157,8 +157,8 @@ TEST(AlarmTest, NegativeExpiry) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_TRUE(ok);
@@ -174,8 +174,8 @@ TEST(AlarmTest, Cancellation) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_FALSE(ok);
@@ -192,8 +192,8 @@ TEST(AlarmTest, SetDestruction) {
void* output_tag;
bool ok;
- const CompletionQueue::NextStatus status = cq.AsyncNext(
- &output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
+ const CompletionQueue::NextStatus status =
+ cq.AsyncNext(&output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
EXPECT_FALSE(ok);
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index b658e7731a..cd8321771a 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -347,7 +347,8 @@ static void SendRpc(grpc::testing::EchoTestService::Stub* stub, int num_rpcs,
for (int i = 0; i < num_rpcs; ++i) {
ClientContext context;
if (with_binary_metadata) {
- char bytes[8] = {'\0', '\1', '\2', '\3', '\4', '\5', '\6', static_cast<char>(i)};
+ char bytes[8] = {'\0', '\1', '\2', '\3',
+ '\4', '\5', '\6', static_cast<char>(i)};
context.AddMetadata("custom-bin", grpc::string(bytes, 8));
}
context.set_compression_algorithm(GRPC_COMPRESS_GZIP);
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index e47842e526..d17c2957a2 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -198,7 +198,8 @@ static void start_lb_server(server_fixture* sf, int* ports, size_t nports,
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(202), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(202),
+ nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(202), 1);
cq_verify(cqv);
@@ -230,7 +231,8 @@ static void start_lb_server(server_fixture* sf, int* ports, size_t nports,
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(201), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(201),
+ nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
gpr_log(GPR_INFO, "LB Server[%s](%s) after tag 201", sf->servers_hostport,
sf->balancer_name);
@@ -255,8 +257,8 @@ static void start_lb_server(server_fixture* sf, int* ports, size_t nports,
op->flags = 0;
op->reserved = nullptr;
op++;
- error =
- grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(203), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops),
+ tag(203), nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(203), 1);
cq_verify(cqv);
@@ -278,7 +280,8 @@ static void start_lb_server(server_fixture* sf, int* ports, size_t nports,
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(204), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(204),
+ nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(201), 1);
@@ -350,8 +353,8 @@ static void start_backend_server(server_fixture* sf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error =
- grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(101), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops),
+ tag(101), nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
gpr_log(GPR_INFO, "Server[%s] after tag 101", sf->servers_hostport);
@@ -364,8 +367,8 @@ static void start_backend_server(server_fixture* sf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error =
- grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(102), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops),
+ tag(102), nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
ev = grpc_completion_queue_next(
sf->cq, grpc_timeout_seconds_to_deadline(3), nullptr);
@@ -394,8 +397,8 @@ static void start_backend_server(server_fixture* sf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(103),
- nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops),
+ tag(103), nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
ev = grpc_completion_queue_next(
sf->cq, grpc_timeout_seconds_to_deadline(3), nullptr);
@@ -428,8 +431,8 @@ static void start_backend_server(server_fixture* sf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error =
- grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops), tag(104), nullptr);
+ error = grpc_call_start_batch(s, ops, static_cast<size_t>(op - ops),
+ tag(104), nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
@@ -493,7 +496,8 @@ static void perform_request(client_fixture* cf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1), nullptr);
+ error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(1),
+ nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
for (i = 0; i < 4; i++) {
@@ -510,7 +514,8 @@ static void perform_request(client_fixture* cf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2), nullptr);
+ error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(2),
+ nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
@@ -529,7 +534,8 @@ static void perform_request(client_fixture* cf) {
op->flags = 0;
op->reserved = nullptr;
op++;
- error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3), nullptr);
+ error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), tag(3),
+ nullptr);
GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc
index 2ea1d3f79a..865b5c407f 100644
--- a/test/cpp/interop/interop_client.cc
+++ b/test/cpp/interop/interop_client.cc
@@ -875,7 +875,8 @@ bool InteropClient::DoCacheableUnary() {
// Create request with current timestamp
gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE);
- std::string timestamp = std::to_string(static_cast<long long unsigned>(ts.tv_nsec));
+ std::string timestamp =
+ std::to_string(static_cast<long long unsigned>(ts.tv_nsec));
SimpleRequest request;
request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size());
diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
index 3fe709ff83..07bb3c92ae 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
@@ -777,7 +777,8 @@ static void OnHeaderNew(void* user_data, grpc_mdelem md) {
if (GRPC_MDELEM_IS_INTERNED(md)) {
/* not already parsed: parse it now, and store the
* result away */
- cached_timeout = static_cast<grpc_millis*>(gpr_malloc(sizeof(grpc_millis)));
+ cached_timeout =
+ static_cast<grpc_millis*>(gpr_malloc(sizeof(grpc_millis)));
*cached_timeout = timeout;
grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
}
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
index 7b236d94b6..ec79b95cd8 100644
--- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
+++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
@@ -74,8 +74,9 @@ static grpc_error* pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker,
gpr_mu_unlock(&ps->mu);
GPR_ASSERT(grpc_cq_begin_op(g_cq, g_tag));
- grpc_cq_end_op(g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, nullptr,
- static_cast<grpc_cq_completion*>(gpr_malloc(sizeof(grpc_cq_completion))));
+ grpc_cq_end_op(
+ g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, nullptr,
+ static_cast<grpc_cq_completion*>(gpr_malloc(sizeof(grpc_cq_completion))));
grpc_core::ExecCtx::Get()->Flush();
gpr_mu_lock(&ps->mu);
return GRPC_ERROR_NONE;
diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h
index ce9731b7a6..ab6c194830 100644
--- a/test/cpp/microbenchmarks/fullstack_fixtures.h
+++ b/test/cpp/microbenchmarks/fullstack_fixtures.h
@@ -108,7 +108,8 @@ class FullstackFixture : public BaseFixture {
void AddToLabel(std::ostream& out, benchmark::State& state) {
BaseFixture::AddToLabel(out, state);
out << " polls/iter:"
- << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) / state.iterations();
+ << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) /
+ state.iterations();
}
ServerCompletionQueue* cq() { return cq_.get(); }
@@ -236,7 +237,8 @@ class EndpointPairFixture : public BaseFixture {
void AddToLabel(std::ostream& out, benchmark::State& state) {
BaseFixture::AddToLabel(out, state);
out << " polls/iter:"
- << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) / state.iterations();
+ << static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) /
+ state.iterations();
}
ServerCompletionQueue* cq() { return cq_.get(); }
diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc
index 25a033f104..e4a31f50a9 100644
--- a/test/cpp/microbenchmarks/helpers.cc
+++ b/test/cpp/microbenchmarks/helpers.cc
@@ -43,18 +43,21 @@ void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) {
grpc_stats_data stats;
grpc_stats_diff(&stats_end, &stats_begin_, &stats);
for (int i = 0; i < GRPC_STATS_COUNTER_COUNT; i++) {
- out << " " << grpc_stats_counter_name[i]
- << "/iter:" << (static_cast<double>(stats.counters[i]) / static_cast<double>(state.iterations()));
+ out << " " << grpc_stats_counter_name[i] << "/iter:"
+ << (static_cast<double>(stats.counters[i]) /
+ static_cast<double>(state.iterations()));
}
for (int i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) {
std::ostringstream median_ss;
median_ss << grpc_stats_histogram_name[i] << "-median";
- state.counters[median_ss.str()] = benchmark::Counter(
- grpc_stats_histo_percentile(&stats, static_cast<grpc_stats_histograms>(i), 50.0));
+ state.counters[median_ss.str()] =
+ benchmark::Counter(grpc_stats_histo_percentile(
+ &stats, static_cast<grpc_stats_histograms>(i), 50.0));
std::ostringstream tail_ss;
tail_ss << grpc_stats_histogram_name[i] << "-99p";
- state.counters[tail_ss.str()] = benchmark::Counter(
- grpc_stats_histo_percentile(&stats, static_cast<grpc_stats_histograms>(i), 99.0));
+ state.counters[tail_ss.str()] =
+ benchmark::Counter(grpc_stats_histo_percentile(
+ &stats, static_cast<grpc_stats_histograms>(i), 99.0));
}
#ifdef GPR_LOW_LEVEL_COUNTERS
grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot();
diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc
index 0d0ab1891a..d0190de172 100644
--- a/test/cpp/performance/writes_per_rpc_test.cc
+++ b/test/cpp/performance/writes_per_rpc_test.cc
@@ -230,7 +230,8 @@ static double UnaryPingPong(int request_size, int response_size) {
}
double writes_per_iteration =
- static_cast<double>(fixture->writes_performed()) / static_cast<double>(kIterations);
+ static_cast<double>(fixture->writes_performed()) /
+ static_cast<double>(kIterations);
fixture.reset();
server_env[0]->~ServerEnv();
diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc
index 863be40f2a..c5e90bd9a4 100644
--- a/test/cpp/qps/report.cc
+++ b/test/cpp/qps/report.cc
@@ -109,9 +109,12 @@ void GprLogReporter::ReportCoreStats(const char* name, int idx,
for (int i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) {
gpr_log(GPR_DEBUG, "%s[%d].%s = %.1lf/%.1lf/%.1lf (50/95/99%%-ile)", name,
idx, grpc_stats_histogram_name[i],
- grpc_stats_histo_percentile(&data, static_cast<grpc_stats_histograms>(i), 50),
- grpc_stats_histo_percentile(&data, static_cast<grpc_stats_histograms>(i), 95),
- grpc_stats_histo_percentile(&data, static_cast<grpc_stats_histograms>(i), 99));
+ grpc_stats_histo_percentile(
+ &data, static_cast<grpc_stats_histograms>(i), 50),
+ grpc_stats_histo_percentile(
+ &data, static_cast<grpc_stats_histograms>(i), 95),
+ grpc_stats_histo_percentile(
+ &data, static_cast<grpc_stats_histograms>(i), 99));
}
}
diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc
index 5c0bfb3727..0adbf20ce6 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.cc
+++ b/test/cpp/util/proto_reflection_descriptor_database.cc
@@ -50,7 +50,8 @@ ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {
}
gpr_log(GPR_INFO,
"ServerReflectionInfo rpc failed. Error code: %d, details: %s",
- static_cast<int>(status.error_code()), status.error_message().c_str());
+ static_cast<int>(status.error_code()),
+ status.error_message().c_str());
}
}
}