diff options
author | Craig Tiller <ctiller@google.com> | 2016-10-26 21:15:29 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-10-26 21:15:29 -0700 |
commit | 28b72428a84ae7d23c106fb282478fa94951c9c0 (patch) | |
tree | d88c2d32bcee3c6b7636a5ec3a77f4dde04b9f4f /test/core | |
parent | 5b676a6b1ae667ab82f56d5485bf0da229091101 (diff) |
clang-format
Diffstat (limited to 'test/core')
43 files changed, 130 insertions, 93 deletions
diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c index 680850af33..fc53cd9d36 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -70,8 +70,8 @@ static void assert_passthrough(grpc_slice value, GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR " value_hash=0x%08x " "algorithm='%s' uncompressed_split='%s' compressed_split='%s'", - GRPC_SLICE_LENGTH(value), - gpr_murmur_hash3(GRPC_SLICE_START_PTR(value), GRPC_SLICE_LENGTH(value), 0), + GRPC_SLICE_LENGTH(value), gpr_murmur_hash3(GRPC_SLICE_START_PTR(value), + GRPC_SLICE_LENGTH(value), 0), algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode), grpc_slice_split_mode_name(compressed_split_mode)); @@ -221,7 +221,7 @@ static void test_bad_decompression_data_stream(void) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); grpc_slice_buffer_add(&input, - grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4)); + grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4)); /* try (and fail) to decompress the invalid compresed buffer */ GPR_ASSERT(0 == grpc_msg_decompress(GRPC_COMPRESS_DEFLATE, &input, &output)); @@ -237,8 +237,8 @@ static void test_bad_compression_algorithm(void) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); - grpc_slice_buffer_add(&input, - grpc_slice_from_copied_string("Never gonna give you up")); + grpc_slice_buffer_add( + &input, grpc_slice_from_copied_string("Never gonna give you up")); was_compressed = grpc_msg_compress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_compressed); @@ -259,8 +259,8 @@ static void test_bad_decompression_algorithm(void) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); grpc_slice_buffer_add(&input, - grpc_slice_from_copied_string( - "I'm not really compressed but it doesn't matter")); + grpc_slice_from_copied_string( + "I'm not really compressed but it doesn't matter")); was_decompressed = grpc_msg_decompress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_decompressed); diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 4fb89eb96e..57373970c4 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -119,7 +119,8 @@ static grpc_slice merge_slices(grpc_slice *slices, size_t nslices) { cursor = GRPC_SLICE_START_PTR(out); for (i = 0; i < nslices; i++) { - memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]), GRPC_SLICE_LENGTH(slices[i])); + memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]), + GRPC_SLICE_LENGTH(slices[i])); cursor += GRPC_SLICE_LENGTH(slices[i]); } diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index 6cc7d28489..765b6ad1be 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -251,7 +251,8 @@ static void test_send_messages_at_the_same_time() { gpr_log(GPR_INFO, "test_send_messages_at_the_same_time"); grpc_op *op; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); prepare_test(1); diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index 317ca3110b..b0d18191e0 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index 8f8b7d5119..05a379cf1b 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -135,8 +135,10 @@ static void request_response_with_payload_and_call_creds( override_mode mode) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = @@ -389,7 +391,8 @@ static void test_request_with_server_rejecting_client_creds( char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_call_credentials *creds; diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 4bf55c8725..f67da2d90d 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -118,8 +118,10 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, size_t details_capacity = 0; grpc_byte_buffer *request_payload_recv = NULL; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index afb17b0719..44be85435d 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -117,8 +117,10 @@ static void test_cancel_after_accept_and_writes_closed( size_t details_capacity = 0; grpc_byte_buffer *request_payload_recv = NULL; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index fe0e0d689c..c276f5e2fa 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -116,7 +116,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 3a0b83c4d2..e33b120a5b 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -114,7 +114,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, char *details = NULL; size_t details_capacity = 0; grpc_byte_buffer *response_payload_recv = NULL; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 92788dd8fa..4ed24baf67 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -308,7 +308,8 @@ static void request_with_payload_template( response_str[1023] = '\0'; request_payload_slice = grpc_slice_from_copied_string(request_str); - grpc_slice response_payload_slice = grpc_slice_from_copied_string(response_str); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string(response_str); client_args = grpc_channel_args_set_compression_algorithm( NULL, default_client_channel_compression_algorithm); diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 36f98694b6..b180957d4f 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -108,7 +108,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_request(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index 66449558c7..943a3df90d 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -104,7 +104,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_request(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index 29dcafb985..26a4eef7d9 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -99,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 1dba200c02..046e0c321b 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -128,7 +128,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f, grpc_metadata *initial_lr_metadata, grpc_metadata *trailing_lr_metadata) { grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg); - grpc_slice response_payload_slice = grpc_slice_from_static_string(response_msg); + grpc_slice response_payload_slice = + grpc_slice_from_static_string(response_msg); grpc_call *c; grpc_call *s; grpc_byte_buffer *request_payload = diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index cdf52f9838..559b00d828 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -116,7 +116,8 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, cq_verifier *cqv; grpc_op ops[6]; grpc_op *op; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *recv_payload = NULL; diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c index e9528ff105..84447e6a2f 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.c @@ -102,7 +102,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_invoke_network_status_change(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index 5a19950726..01ba964ef0 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -/* Creates and returns a grpc_slice containing random alphanumeric characters. */ +/* Creates and returns a grpc_slice containing random alphanumeric characters. + */ static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 3398a9cff7..317788f7fa 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -120,8 +120,10 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_byte_buffer *response_payload; grpc_byte_buffer *response_payload_recv; int i; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr:1234", deadline, diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index a37fc645b4..8649c1563f 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -100,7 +100,8 @@ static void test_invoke_request_with_flags( grpc_end2end_test_config config, uint32_t *flags_for_op, grpc_call_error call_start_batch_expected_result) { grpc_call *c; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 3e2bbb3b0e..144cd58ec0 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -99,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 280bad5749..cf81b06692 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -/* Creates and returns a grpc_slice containing random alphanumeric characters. */ +/* Creates and returns a grpc_slice containing random alphanumeric characters. + */ static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c index 40dd3983e1..4284175214 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.c @@ -102,8 +102,10 @@ static void test_cacheable_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index 1ac9dc8210..e11981f92b 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index 0bbf0879cc..f88d5edeae 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; - grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); + grpc_slice request_payload_slice = + grpc_slice_from_copied_string("hello world"); + grpc_slice response_payload_slice = + grpc_slice_from_copied_string("hello you"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_byte_buffer *response_payload = diff --git a/test/core/http/format_request_test.c b/test/core/http/format_request_test.c index bd31e5e8ab..290990c906 100644 --- a/test/core/http/format_request_test.c +++ b/test/core/http/format_request_test.c @@ -52,13 +52,13 @@ static void test_format_get_request(void) { slice = grpc_httpcli_format_get_request(&req); GPR_ASSERT(0 == grpc_slice_str_cmp(slice, - "GET /index.html HTTP/1.0\r\n" - "Host: example.com\r\n" - "Connection: close\r\n" - "User-Agent: " GRPC_HTTPCLI_USER_AGENT - "\r\n" - "x-yz: abc\r\n" - "\r\n")); + "GET /index.html HTTP/1.0\r\n" + "Host: example.com\r\n" + "Connection: close\r\n" + "User-Agent: " GRPC_HTTPCLI_USER_AGENT + "\r\n" + "x-yz: abc\r\n" + "\r\n")); grpc_slice_unref(slice); } @@ -79,16 +79,16 @@ static void test_format_post_request(void) { slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len); GPR_ASSERT(0 == grpc_slice_str_cmp(slice, - "POST /index.html HTTP/1.0\r\n" - "Host: example.com\r\n" - "Connection: close\r\n" - "User-Agent: " GRPC_HTTPCLI_USER_AGENT - "\r\n" - "x-yz: abc\r\n" - "Content-Type: text/plain\r\n" - "Content-Length: 9\r\n" - "\r\n" - "fake body")); + "POST /index.html HTTP/1.0\r\n" + "Host: example.com\r\n" + "Connection: close\r\n" + "User-Agent: " GRPC_HTTPCLI_USER_AGENT + "\r\n" + "x-yz: abc\r\n" + "Content-Type: text/plain\r\n" + "Content-Length: 9\r\n" + "\r\n" + "fake body")); grpc_slice_unref(slice); } @@ -107,13 +107,13 @@ static void test_format_post_request_no_body(void) { slice = grpc_httpcli_format_post_request(&req, NULL, 0); GPR_ASSERT(0 == grpc_slice_str_cmp(slice, - "POST /index.html HTTP/1.0\r\n" - "Host: example.com\r\n" - "Connection: close\r\n" - "User-Agent: " GRPC_HTTPCLI_USER_AGENT - "\r\n" - "x-yz: abc\r\n" - "\r\n")); + "POST /index.html HTTP/1.0\r\n" + "Host: example.com\r\n" + "Connection: close\r\n" + "User-Agent: " GRPC_HTTPCLI_USER_AGENT + "\r\n" + "x-yz: abc\r\n" + "\r\n")); grpc_slice_unref(slice); } diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 8a1699608e..8186ea7e85 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -36,9 +36,9 @@ #include <stdbool.h> #include <sys/types.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include <grpc/support/time.h> #include <grpc/support/useful.h> #include "test/core/util/test_config.h" @@ -88,7 +88,7 @@ static grpc_endpoint_test_fixture begin_test(grpc_endpoint_test_config config, static void end_test(grpc_endpoint_test_config config) { config.clean_up(); } static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, - size_t *num_blocks, uint8_t *current_data) { + size_t *num_blocks, uint8_t *current_data) { size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0); grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices); size_t num_bytes_left = num_bytes; @@ -99,7 +99,7 @@ static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, for (i = 0; i < nslices; ++i) { slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left - : slice_size); + : slice_size); num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]); buf = GRPC_SLICE_START_PTR(slices[i]); for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) { diff --git a/test/core/iomgr/load_file_test.c b/test/core/iomgr/load_file_test.c index af822466d7..8714e1f368 100644 --- a/test/core/iomgr/load_file_test.c +++ b/test/core/iomgr/load_file_test.c @@ -34,9 +34,9 @@ #include <stdio.h> #include <string.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/support/string.h" diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index bba1900987..5eafa570bb 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -274,7 +274,7 @@ struct write_socket_state { }; static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, - size_t *num_blocks, uint8_t *current_data) { + size_t *num_blocks, uint8_t *current_data) { size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u); grpc_slice *slices = gpr_malloc(sizeof(grpc_slice) * nslices); size_t num_bytes_left = num_bytes; @@ -284,7 +284,7 @@ static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size, for (i = 0; i < nslices; ++i) { slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left - : slice_size); + : slice_size); num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]); buf = GRPC_SLICE_START_PTR(slices[i]); for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) { diff --git a/test/core/security/b64_test.c b/test/core/security/b64_test.c index dea0f56266..af883f51e9 100644 --- a/test/core/security/b64_test.c +++ b/test/core/security/b64_test.c @@ -35,9 +35,9 @@ #include <string.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include "test/core/util/test_config.h" static int buffers_are_equal(const unsigned char *buf1, diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c index 0303b791ae..741ace9bdd 100644 --- a/test/core/security/create_jwt.c +++ b/test/core/security/create_jwt.c @@ -37,10 +37,10 @@ #include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/security/credentials/jwt/jwt_credentials.h" +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/cmdline.h> #include <grpc/support/log.h> -#include <grpc/slice.h> void create_jwt(const char *json_key_file_path, const char *service_url, const char *scope) { diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 0637215915..d4c755088d 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -243,9 +243,10 @@ static void test_oauth2_token_fetcher_creds_parsing_ok(void) { GPR_ASSERT(token_lifetime.tv_sec == 3599); GPR_ASSERT(token_lifetime.tv_nsec == 0); GPR_ASSERT(token_md->num_entries == 1); - GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") == 0); + GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") == + 0); GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].value, - "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == + "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == 0); grpc_credentials_md_store_unref(token_md); grpc_http_response_destroy(&response); @@ -530,7 +531,7 @@ static void on_oauth2_creds_get_metadata_success( GPR_ASSERT(num_md == 1); GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].key, "authorization") == 0); GPR_ASSERT(grpc_slice_str_cmp(md_elems[0].value, - "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == + "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") == 0); GPR_ASSERT(user_data != NULL); GPR_ASSERT(strcmp((const char *)user_data, test_user_data) == 0); diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c index ca093095c3..e9e211206c 100644 --- a/test/core/security/fetch_oauth2.c +++ b/test/core/security/fetch_oauth2.c @@ -36,10 +36,10 @@ #include <grpc/grpc.h> #include <grpc/grpc_security.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/cmdline.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include <grpc/support/sync.h> #include "src/core/lib/iomgr/load_file.h" diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c index 593b79855f..201655881f 100644 --- a/test/core/security/json_token_test.c +++ b/test/core/security/json_token_test.c @@ -37,9 +37,9 @@ #include <string.h> #include <grpc/grpc_security.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include "src/core/lib/json/json.h" #include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h" diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c index 01fe436f27..f8afba8d6d 100644 --- a/test/core/security/jwt_verifier_test.c +++ b/test/core/security/jwt_verifier_test.c @@ -37,9 +37,9 @@ #include <grpc/grpc.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include <grpc/support/string_util.h> #include "src/core/lib/http/httpcli.h" @@ -487,8 +487,8 @@ static void corrupt_jwt_sig(char *jwt) { GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig)); sig_bytes = GRPC_SLICE_START_PTR(sig); (*sig_bytes)++; /* Corrupt first byte. */ - bad_b64_sig = - grpc_base64_encode(GRPC_SLICE_START_PTR(sig), GRPC_SLICE_LENGTH(sig), 1, 0); + bad_b64_sig = grpc_base64_encode(GRPC_SLICE_START_PTR(sig), + GRPC_SLICE_LENGTH(sig), 1, 0); memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig)); gpr_free(bad_b64_sig); grpc_slice_unref(sig); diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c index 22dbf0428d..44a209258d 100644 --- a/test/core/security/oauth2_utils.c +++ b/test/core/security/oauth2_utils.c @@ -37,9 +37,9 @@ #include <grpc/grpc.h> #include <grpc/grpc_security.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include <grpc/support/sync.h> #include "src/core/lib/security/credentials/credentials.h" diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c index 3a04c6e3eb..157b7bf5ff 100644 --- a/test/core/security/print_google_default_creds_token.c +++ b/test/core/security/print_google_default_creds_token.c @@ -36,10 +36,10 @@ #include <grpc/grpc.h> #include <grpc/grpc_security.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/cmdline.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include <grpc/support/sync.h> #include "src/core/lib/security/credentials/composite/composite_credentials.h" diff --git a/test/core/security/verify_jwt.c b/test/core/security/verify_jwt.c index 4d0ff242ea..043d29e6bb 100644 --- a/test/core/security/verify_jwt.c +++ b/test/core/security/verify_jwt.c @@ -36,10 +36,10 @@ #include <grpc/grpc.h> #include <grpc/grpc_security.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/cmdline.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include <grpc/support/sync.h> #include "src/core/lib/security/credentials/jwt/jwt_verifier.h" diff --git a/test/core/slice/slice_buffer_test.c b/test/core/slice/slice_buffer_test.c index 4c26113d05..bf9ae197d2 100644 --- a/test/core/slice/slice_buffer_test.c +++ b/test/core/slice/slice_buffer_test.c @@ -31,8 +31,8 @@ * */ -#include <grpc/support/log.h> #include <grpc/slice_buffer.h> +#include <grpc/support/log.h> #include "test/core/util/test_config.h" void test_slice_buffer_add() { diff --git a/test/core/slice/slice_test.c b/test/core/slice/slice_test.c index e6d29e7459..ca44becfd0 100644 --- a/test/core/slice/slice_test.c +++ b/test/core/slice/slice_test.c @@ -170,11 +170,12 @@ static void test_slice_sub_works(unsigned length) { grpc_slice_unref(slice); } -static void check_head_tail(grpc_slice slice, grpc_slice head, grpc_slice tail) { +static void check_head_tail(grpc_slice slice, grpc_slice head, + grpc_slice tail) { GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == GRPC_SLICE_LENGTH(head) + GRPC_SLICE_LENGTH(tail)); - GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice), GRPC_SLICE_START_PTR(head), - GRPC_SLICE_LENGTH(head))); + GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice), + GRPC_SLICE_START_PTR(head), GRPC_SLICE_LENGTH(head))); GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(head), GRPC_SLICE_START_PTR(tail), GRPC_SLICE_LENGTH(tail))); } @@ -243,8 +244,8 @@ static void test_slice_from_copied_string_works(void) { slice = grpc_slice_from_copied_string(text); GPR_ASSERT(strlen(text) == GRPC_SLICE_LENGTH(slice)); - GPR_ASSERT(0 == - memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice))); + GPR_ASSERT( + 0 == memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice))); grpc_slice_unref(slice); } diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c index c7e8f3a050..e2813df70c 100644 --- a/test/core/transport/chttp2/hpack_parser_test.c +++ b/test/core/transport/chttp2/hpack_parser_test.c @@ -36,9 +36,9 @@ #include <stdarg.h> #include <grpc/grpc.h> +#include <grpc/slice.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include <grpc/slice.h> #include "test/core/util/parse_hexstring.h" #include "test/core/util/slice_splitter.h" #include "test/core/util/test_config.h" diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.c index 5b831c71b2..e29be4b056 100644 --- a/test/core/transport/chttp2/varint_test.c +++ b/test/core/transport/chttp2/varint_test.c @@ -33,15 +33,16 @@ #include "src/core/ext/transport/chttp2/transport/varint.h" -#include <grpc/support/log.h> #include <grpc/slice.h> +#include <grpc/support/log.h> #include "test/core/util/test_config.h" static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or, const char *expect_bytes, size_t expect_length) { uint32_t nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits); - grpc_slice expect = grpc_slice_from_copied_buffer(expect_bytes, expect_length); + grpc_slice expect = + grpc_slice_from_copied_buffer(expect_bytes, expect_length); grpc_slice slice; gpr_log(GPR_DEBUG, "Test: 0x%08x", value); GPR_ASSERT(nbytes == expect_length); diff --git a/test/core/util/mock_endpoint.h b/test/core/util/mock_endpoint.h index 8f8d2a412d..ec7f0fcfcd 100644 --- a/test/core/util/mock_endpoint.h +++ b/test/core/util/mock_endpoint.h @@ -39,6 +39,7 @@ grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice), grpc_resource_quota *resource_quota); void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx, - grpc_endpoint *mock_endpoint, grpc_slice slice); + grpc_endpoint *mock_endpoint, + grpc_slice slice); #endif diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.c index 6b572bb3c3..c016ebb536 100644 --- a/test/core/util/one_corpus_entry_fuzzer.c +++ b/test/core/util/one_corpus_entry_fuzzer.c @@ -47,7 +47,8 @@ int main(int argc, char **argv) { leak_check = false; GPR_ASSERT( GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer))); - LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), GRPC_SLICE_LENGTH(buffer)); + LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), + GRPC_SLICE_LENGTH(buffer)); grpc_slice_unref(buffer); return 0; } |