aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-12-01 22:52:20 +0100
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-12-01 22:52:20 +0100
commitba404826be4720fc46ae161f950e27814928d5c5 (patch)
treeae21ff387782aaffab6e0c3cccd9aab6d629acfd /test
parent3e5cbee777cfd1d05f1161dfb97093878c7e48ed (diff)
Clang format.
Diffstat (limited to 'test')
-rw-r--r--test/core/client_config/lb_policies_test.c9
-rw-r--r--test/core/network_benchmarks/low_level_ping_pong.c8
-rw-r--r--test/core/security/credentials_test.c17
-rw-r--r--test/core/security/oauth2_utils.c3
-rw-r--r--test/core/surface/byte_buffer_reader_test.c4
-rw-r--r--test/cpp/qps/client.h46
6 files changed, 46 insertions, 41 deletions
diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c
index 3eb6f11bf7..02d3314eb8 100644
--- a/test/core/client_config/lb_policies_test.c
+++ b/test/core/client_config/lb_policies_test.c
@@ -286,10 +286,12 @@ int *perform_request(servers_fixture *f, grpc_channel *client,
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
- op->data.recv_status_on_client.trailing_metadata = &rdata->trailing_metadata_recv;
+ op->data.recv_status_on_client.trailing_metadata =
+ &rdata->trailing_metadata_recv;
op->data.recv_status_on_client.status = &rdata->status;
op->data.recv_status_on_client.status_details = &rdata->details;
- op->data.recv_status_on_client.status_details_capacity = &rdata->details_capacity;
+ op->data.recv_status_on_client.status_details_capacity =
+ &rdata->details_capacity;
op->flags = 0;
op->reserved = NULL;
op++;
@@ -354,7 +356,8 @@ int *perform_request(servers_fixture *f, grpc_channel *client,
GPR_ASSERT(rdata->status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(rdata->details, "xyz"));
GPR_ASSERT(0 == strcmp(rdata->call_details[s_idx].method, "/foo"));
- GPR_ASSERT(0 == strcmp(rdata->call_details[s_idx].host, "foo.test.google.fr"));
+ GPR_ASSERT(0 ==
+ strcmp(rdata->call_details[s_idx].host, "foo.test.google.fr"));
GPR_ASSERT(was_cancelled == 1);
} else {
}
diff --git a/test/core/network_benchmarks/low_level_ping_pong.c b/test/core/network_benchmarks/low_level_ping_pong.c
index 7a2d894481..dd1544c27b 100644
--- a/test/core/network_benchmarks/low_level_ping_pong.c
+++ b/test/core/network_benchmarks/low_level_ping_pong.c
@@ -139,7 +139,7 @@ static int poll_read_bytes(int fd, char *buf, size_t read_size, int spin) {
gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
return -1;
}
- bytes_read += (size_t) err2;
+ bytes_read += (size_t)err2;
} while (bytes_read < read_size);
return 0;
}
@@ -174,11 +174,11 @@ static int epoll_read_bytes(struct thread_args *args, char *buf, int spin) {
GPR_ASSERT(ev.data.fd == args->fds.read_fd);
do {
do {
- err2 = read(args->fds.read_fd, buf + bytes_read,
- read_size - bytes_read);
+ err2 =
+ read(args->fds.read_fd, buf + bytes_read, read_size - bytes_read);
} while (err2 < 0 && errno == EINTR);
if (errno == EAGAIN) break;
- bytes_read += (size_t) err2;
+ bytes_read += (size_t)err2;
/* TODO(klempner): This should really be doing an extra call after we are
done to ensure we see an EAGAIN */
} while (bytes_read < read_size);
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index ad17b059f1..b2b7cfdb6e 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -382,8 +382,7 @@ static void test_access_token_creds(void) {
NULL};
GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
grpc_call_credentials_get_request_metadata(
- &exec_ctx, creds, NULL, auth_md_ctx, check_access_token_metadata,
- creds);
+ &exec_ctx, creds, NULL, auth_md_ctx, check_access_token_metadata, creds);
grpc_exec_ctx_finish(&exec_ctx);
}
@@ -443,7 +442,8 @@ static void test_oauth2_google_iam_composite_creds(void) {
test_google_iam_authorization_token, test_google_iam_authority_selector,
NULL);
grpc_call_credentials *composite_creds =
- grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds, NULL);
+ grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds,
+ NULL);
grpc_call_credentials_unref(oauth2_creds);
grpc_call_credentials_unref(google_iam_creds);
GPR_ASSERT(
@@ -488,7 +488,8 @@ static void test_channel_oauth2_google_iam_composite_creds(void) {
grpc_call_credentials *oauth2_creds =
grpc_access_token_credentials_create("blah", NULL);
grpc_channel_credentials *channel_oauth2_creds =
- grpc_composite_channel_credentials_create(channel_creds, oauth2_creds, NULL);
+ grpc_composite_channel_credentials_create(channel_creds, oauth2_creds,
+ NULL);
grpc_call_credentials *google_iam_creds = grpc_google_iam_credentials_create(
test_google_iam_authorization_token, test_google_iam_authority_selector,
NULL);
@@ -981,8 +982,8 @@ static void test_metadata_plugin_success(void) {
creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL);
GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
grpc_call_credentials_get_request_metadata(
- &exec_ctx, creds, NULL, auth_md_ctx,
- on_plugin_metadata_received_success, NULL);
+ &exec_ctx, creds, NULL, auth_md_ctx, on_plugin_metadata_received_success,
+ NULL);
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
grpc_call_credentials_release(creds);
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
@@ -1004,8 +1005,8 @@ static void test_metadata_plugin_failure(void) {
creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL);
GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
grpc_call_credentials_get_request_metadata(
- &exec_ctx, creds, NULL, auth_md_ctx,
- on_plugin_metadata_received_failure, NULL);
+ &exec_ctx, creds, NULL, auth_md_ctx, on_plugin_metadata_received_failure,
+ NULL);
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
grpc_call_credentials_release(creds);
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c
index a283a881e0..fb62bf4134 100644
--- a/test/core/security/oauth2_utils.c
+++ b/test/core/security/oauth2_utils.c
@@ -88,7 +88,8 @@ char *grpc_test_fetch_oauth2_token_with_credentials(
grpc_closure_init(&do_nothing_closure, do_nothing, NULL);
grpc_call_credentials_get_request_metadata(&exec_ctx, creds, &request.pollset,
- null_ctx, on_oauth2_response, &request);
+ null_ctx, on_oauth2_response,
+ &request);
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c
index 7f9cd6b62b..6b41698717 100644
--- a/test/core/surface/byte_buffer_reader_test.c
+++ b/test/core/surface/byte_buffer_reader_test.c
@@ -185,8 +185,8 @@ static void test_byte_buffer_from_reader(void) {
}
static void test_readall(void) {
- char* lotsa_as[512];
- char* lotsa_bs[1024];
+ char *lotsa_as[512];
+ char *lotsa_bs[1024];
gpr_slice slices[2];
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader reader;
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index f4400692fe..b24a90adac 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -181,29 +181,29 @@ class Client {
std::unique_ptr<RandomDist> random_dist;
switch (load.load_case()) {
- case LoadParams::kClosedLoop:
- // Closed-loop doesn't use random dist at all
- break;
- case LoadParams::kPoisson:
- random_dist.reset(
- new ExpDist(load.poisson().offered_load() / num_threads));
- break;
- case LoadParams::kUniform:
- random_dist.reset(
- new UniformDist(load.uniform().interarrival_lo() * num_threads,
- load.uniform().interarrival_hi() * num_threads));
- break;
- case LoadParams::kDeterm:
- random_dist.reset(
- new DetDist(num_threads / load.determ().offered_load()));
- break;
- case LoadParams::kPareto:
- random_dist.reset(
- new ParetoDist(load.pareto().interarrival_base() * num_threads,
- load.pareto().alpha()));
- break;
- default:
- GPR_ASSERT(false);
+ case LoadParams::kClosedLoop:
+ // Closed-loop doesn't use random dist at all
+ break;
+ case LoadParams::kPoisson:
+ random_dist.reset(
+ new ExpDist(load.poisson().offered_load() / num_threads));
+ break;
+ case LoadParams::kUniform:
+ random_dist.reset(
+ new UniformDist(load.uniform().interarrival_lo() * num_threads,
+ load.uniform().interarrival_hi() * num_threads));
+ break;
+ case LoadParams::kDeterm:
+ random_dist.reset(
+ new DetDist(num_threads / load.determ().offered_load()));
+ break;
+ case LoadParams::kPareto:
+ random_dist.reset(
+ new ParetoDist(load.pareto().interarrival_base() * num_threads,
+ load.pareto().alpha()));
+ break;
+ default:
+ GPR_ASSERT(false);
}
// Set closed_loop_ based on whether or not random_dist is set