From 752be9ceeba1e3958229b2ab0a9d59c072eebb7c Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla <sreek@google.com>
Date: Fri, 3 Mar 2017 14:36:02 -0800
Subject: [PATCH] clang format code

---
 src/core/lib/surface/completion_queue.c    | 10 ++++-----
 src/core/lib/surface/server.c              | 10 ++++-----
 test/core/bad_ssl/server_common.c          |  5 ++---
 test/core/end2end/fixtures/h2_census.c     |  7 +++---
 test/core/end2end/fixtures/h2_compress.c   |  7 +++---
 test/core/end2end/fixtures/h2_full+trace.c |  7 +++---
 test/core/end2end/fixtures/h2_full.c       |  7 +++---
 test/core/end2end/fixtures/h2_proxy.c      |  9 ++++----
 test/core/end2end/fixtures/h2_ssl_cert.c   | 20 ++++++++---------
 test/core/end2end/fixtures/h2_uds.c        |  7 +++---
 test/core/end2end/fuzzers/api_fuzzer.c     | 25 +++++++++-------------
 test/core/end2end/tests/call_creds.c       |  5 +++--
 test/core/fling/server.c                   |  5 ++---
 test/core/memory_usage/client.c            |  5 ++---
 test/core/memory_usage/server.c            |  5 ++---
 test/cpp/grpclb/grpclb_test.cc             |  5 ++---
 16 files changed, 59 insertions(+), 80 deletions(-)

diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c
index ad9d7b20b0..e571733a20 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.c
@@ -381,9 +381,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
       "deadline=gpr_timespec { tv_sec: %" PRId64
       ", tv_nsec: %d, clock_type: %d }, "
       "reserved=%p)",
-      5,
-      (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
-       reserved));
+      5, (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
+          reserved));
   GPR_ASSERT(!reserved);
 
   dump_pending_tags(cc);
@@ -557,9 +556,8 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
         "deadline=gpr_timespec { tv_sec: %" PRId64
         ", tv_nsec: %d, clock_type: %d }, "
         "reserved=%p)",
-        6,
-        (cc, tag, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
-         reserved));
+        6, (cc, tag, deadline.tv_sec, deadline.tv_nsec,
+            (int)deadline.clock_type, reserved));
   }
   GPR_ASSERT(!reserved);
 
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index 13f7321fac..7dd320a75b 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -1431,9 +1431,8 @@ grpc_call_error grpc_server_request_call(
       "grpc_server_request_call("
       "server=%p, call=%p, details=%p, initial_metadata=%p, "
       "cq_bound_to_call=%p, cq_for_notification=%p, tag=%p)",
-      7,
-      (server, call, details, initial_metadata, cq_bound_to_call,
-       cq_for_notification, tag));
+      7, (server, call, details, initial_metadata, cq_bound_to_call,
+          cq_for_notification, tag));
   size_t cq_idx;
   for (cq_idx = 0; cq_idx < server->cq_count; cq_idx++) {
     if (server->cqs[cq_idx] == cq_for_notification) {
@@ -1475,9 +1474,8 @@ grpc_call_error grpc_server_request_registered_call(
       "server=%p, rmp=%p, call=%p, deadline=%p, initial_metadata=%p, "
       "optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, "
       "tag=%p)",
-      9,
-      (server, rmp, call, deadline, initial_metadata, optional_payload,
-       cq_bound_to_call, cq_for_notification, tag));
+      9, (server, rmp, call, deadline, initial_metadata, optional_payload,
+          cq_bound_to_call, cq_for_notification, tag));
 
   size_t cq_idx;
   for (cq_idx = 0; cq_idx < server->cq_count; cq_idx++) {
diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c
index b112ae4e78..1176c079b2 100644
--- a/test/core/bad_ssl/server_common.c
+++ b/test/core/bad_ssl/server_common.c
@@ -97,9 +97,8 @@ void bad_ssl_run(grpc_server *server) {
       shutdown_started = 1;
     }
     ev = grpc_completion_queue_next(
-        cq,
-        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                     gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                         gpr_time_from_micros(1000000, GPR_TIMESPAN)),
         NULL);
     switch (ev.type) {
       case GRPC_OP_COMPLETE:
diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c
index 1077e063b8..35a52fa9a9 100644
--- a/test/core/end2end/fixtures/h2_census.c
+++ b/test/core/end2end/fixtures/h2_census.c
@@ -122,10 +122,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
 
 /* All test configurations */
 static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack+census",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+    {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+                                    FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+                                    FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
      chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
      chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
 };
diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c
index a985faeb5a..e627007151 100644
--- a/test/core/end2end/fixtures/h2_compress.c
+++ b/test/core/end2end/fixtures/h2_compress.c
@@ -122,10 +122,9 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) {
 
 /* All test configurations */
 static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack_compression",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+    {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+                                         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+                                         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
      chttp2_create_fixture_fullstack_compression,
      chttp2_init_client_fullstack_compression,
      chttp2_init_server_fullstack_compression,
diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c
index c24bacc42f..25a76ca266 100644
--- a/test/core/end2end/fixtures/h2_full+trace.c
+++ b/test/core/end2end/fixtures/h2_full+trace.c
@@ -105,10 +105,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
 
 /* All test configurations */
 static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
      chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
      chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
 };
diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c
index 901a419f25..435d9dfd45 100644
--- a/test/core/end2end/fixtures/h2_full.c
+++ b/test/core/end2end/fixtures/h2_full.c
@@ -99,10 +99,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
 
 /* All test configurations */
 static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
      chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
      chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
 };
diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c
index 5a64a10918..55eec11b81 100644
--- a/test/core/end2end/fixtures/h2_proxy.c
+++ b/test/core/end2end/fixtures/h2_proxy.c
@@ -116,11 +116,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
 
 /* All test configurations */
 static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack+proxy",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+    {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+                                   FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
+                                   FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+                                   FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
      chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
      chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
 };
diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c
index c3d25ac836..cf3bc45741 100644
--- a/test/core/end2end/fixtures/h2_ssl_cert.c
+++ b/test/core/end2end/fixtures/h2_ssl_cert.c
@@ -206,17 +206,15 @@ CLIENT_INIT(BAD_CERT_PAIR)
 
 typedef enum { SUCCESS, FAIL } test_result;
 
-#define SSL_TEST(request_type, cert_type, result)     \
-  {                                                   \
-    {TEST_NAME(request_type, cert_type, result),      \
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |       \
-         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL,        \
-     chttp2_create_fixture_secure_fullstack,          \
-     CLIENT_INIT_NAME(cert_type),                     \
-     SERVER_INIT_NAME(request_type),                  \
-     chttp2_tear_down_secure_fullstack},              \
-        result                                        \
+#define SSL_TEST(request_type, cert_type, result)                         \
+  {                                                                       \
+    {TEST_NAME(request_type, cert_type, result),                          \
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |                           \
+         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |                     \
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL,                            \
+     chttp2_create_fixture_secure_fullstack, CLIENT_INIT_NAME(cert_type), \
+     SERVER_INIT_NAME(request_type), chttp2_tear_down_secure_fullstack},  \
+        result                                                            \
   }
 
 /* All test configurations */
diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c
index 820c587bee..8f043566b1 100644
--- a/test/core/end2end/fixtures/h2_uds.c
+++ b/test/core/end2end/fixtures/h2_uds.c
@@ -104,10 +104,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
 
 /* All test configurations */
 static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack_uds",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+    {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+                                 FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+                                 FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
      chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
      chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
 };
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index 278b6dbae0..88026d9815 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -314,9 +314,8 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) {
       cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
       const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0);
       grpc_call_credentials *out =
-          access_token == NULL
-              ? NULL
-              : grpc_access_token_credentials_create(access_token, NULL);
+          access_token == NULL ? NULL : grpc_access_token_credentials_create(
+                                            access_token, NULL);
       cred_artifact_ctx_finish(&ctx);
       return out;
     }
@@ -410,9 +409,8 @@ void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr,
   r->on_done = on_done;
   r->addrs = addresses;
   grpc_timer_init(
-      exec_ctx, &r->timer,
-      gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
-                   gpr_time_from_seconds(1, GPR_TIMESPAN)),
+      exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+                                        gpr_time_from_seconds(1, GPR_TIMESPAN)),
       grpc_closure_create(finish_resolve, r, grpc_schedule_on_exec_ctx),
       gpr_now(GPR_CLOCK_MONOTONIC));
 }
@@ -473,9 +471,8 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
   fc->ep = ep;
   fc->deadline = deadline;
   grpc_timer_init(
-      exec_ctx, &fc->timer,
-      gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
-                   gpr_time_from_millis(1, GPR_TIMESPAN)),
+      exec_ctx, &fc->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+                                         gpr_time_from_millis(1, GPR_TIMESPAN)),
       grpc_closure_create(do_connect, fc, grpc_schedule_on_exec_ctx),
       gpr_now(GPR_CLOCK_MONOTONIC));
 }
@@ -752,9 +749,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
       if (g_server != NULL) {
         if (!server_shutdown) {
           grpc_server_shutdown_and_notify(
-              g_server, cq,
-              create_validator(assert_success_and_decrement,
-                               &pending_server_shutdowns));
+              g_server, cq, create_validator(assert_success_and_decrement,
+                                             &pending_server_shutdowns));
           server_shutdown = true;
           pending_server_shutdowns++;
         } else if (pending_server_shutdowns == 0) {
@@ -859,9 +855,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
       case 5: {
         if (g_server != NULL) {
           grpc_server_shutdown_and_notify(
-              g_server, cq,
-              create_validator(assert_success_and_decrement,
-                               &pending_server_shutdowns));
+              g_server, cq, create_validator(assert_success_and_decrement,
+                                             &pending_server_shutdowns));
           pending_server_shutdowns++;
           server_shutdown = true;
         } else {
diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c
index 2a9269345e..52e7a2a7e4 100644
--- a/test/core/end2end/tests/call_creds.c
+++ b/test/core/end2end/tests/call_creds.c
@@ -91,8 +91,9 @@ static void drain_cq(grpc_completion_queue *cq) {
 static void shutdown_server(grpc_end2end_test_fixture *f) {
   if (!f->server) return;
   grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(
-                 f->shutdown_cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL)
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
                  .type == GRPC_OP_COMPLETE);
   grpc_server_destroy(f->server);
   f->server = NULL;
diff --git a/test/core/fling/server.c b/test/core/fling/server.c
index 02168c4ea9..4a47fe4cf5 100644
--- a/test/core/fling/server.c
+++ b/test/core/fling/server.c
@@ -259,9 +259,8 @@ int main(int argc, char **argv) {
       shutdown_started = 1;
     }
     ev = grpc_completion_queue_next(
-        cq,
-        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                     gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                         gpr_time_from_micros(1000000, GPR_TIMESPAN)),
         NULL);
     s = ev.tag;
     switch (ev.type) {
diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c
index b2bc269136..d3eb5ac7c2 100644
--- a/test/core/memory_usage/client.c
+++ b/test/core/memory_usage/client.c
@@ -261,9 +261,8 @@ int main(int argc, char **argv) {
 
   do {
     event = grpc_completion_queue_next(
-        cq,
-        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                     gpr_time_from_micros(10000, GPR_TIMESPAN)),
+        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                         gpr_time_from_micros(10000, GPR_TIMESPAN)),
         NULL);
   } while (event.type != GRPC_QUEUE_TIMEOUT);
 
diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c
index 9f4c7fd22c..437b5473df 100644
--- a/test/core/memory_usage/server.c
+++ b/test/core/memory_usage/server.c
@@ -245,9 +245,8 @@ int main(int argc, char **argv) {
       shutdown_started = 1;
     }
     ev = grpc_completion_queue_next(
-        cq,
-        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                     gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                         gpr_time_from_micros(1000000, GPR_TIMESPAN)),
         NULL);
     fling_call *s = ev.tag;
     switch (ev.type) {
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index 71370ad3b4..c9c569cfbe 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -354,9 +354,8 @@ static void start_backend_server(server_fixture *sf) {
     }
     GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
     const string expected_token =
-        strlen(sf->lb_token_prefix) == 0
-            ? ""
-            : sf->lb_token_prefix + std::to_string(sf->port);
+        strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix +
+                                                    std::to_string(sf->port);
     GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token",
                                  expected_token.c_str()));
 
-- 
GitLab