diff options
author | 2017-09-25 12:38:35 -0700 | |
---|---|---|
committer | 2017-09-25 12:38:35 -0700 | |
commit | 68ee7ce732f7c45f0cf85d672ef38542639244c6 (patch) | |
tree | 5b3c083f9978c8c0efed408572f41dccdacb54f0 /test/core | |
parent | 1c285b98122ef8fe31aa3325a4c10f5b05107ca8 (diff) |
clang-format
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/channel/channel_args_test.c | 15 | ||||
-rw-r--r-- | test/core/compression/algorithm_test.c | 17 | ||||
-rw-r--r-- | test/core/compression/compression_test.c | 156 | ||||
-rw-r--r-- | test/core/compression/message_compress_test.c | 23 | ||||
-rw-r--r-- | test/core/end2end/tests/compressed_payload.c | 3 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_compressed_payload.c | 7 | ||||
-rw-r--r-- | test/core/surface/byte_buffer_reader_test.c | 6 |
7 files changed, 123 insertions, 104 deletions
diff --git a/test/core/channel/channel_args_test.c b/test/core/channel/channel_args_test.c index 35b0c3e5e7..f356c5b0a5 100644 --- a/test/core/channel/channel_args_test.c +++ b/test/core/channel/channel_args_test.c @@ -63,8 +63,8 @@ static void test_set_compression_algorithm(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_channel_args *ch_args; - ch_args = - grpc_channel_args_set_compression_algorithm(NULL, GRPC_COMPRESS_MESSAGE_GZIP); + ch_args = grpc_channel_args_set_compression_algorithm( + NULL, GRPC_COMPRESS_MESSAGE_GZIP); GPR_ASSERT(ch_args->num_args == 1); GPR_ASSERT(strcmp(ch_args->args[0].key, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM) == 0); @@ -76,7 +76,8 @@ static void test_set_compression_algorithm(void) { static void test_compression_algorithm_states(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args *ch_args, *ch_args_wo_gzip, *ch_args_wo_gzip_deflate, *ch_args_wo_gzip_deflate_gzip; + grpc_channel_args *ch_args, *ch_args_wo_gzip, *ch_args_wo_gzip_deflate, + *ch_args_wo_gzip_deflate_gzip; unsigned states_bitset; size_t i; @@ -96,14 +97,16 @@ static void test_compression_algorithm_states(void) { ch_args_wo_gzip_deflate = grpc_channel_args_compression_algorithm_set_state( &exec_ctx, &ch_args_wo_gzip, GRPC_COMPRESS_MESSAGE_DEFLATE, 0); GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate); - ch_args_wo_gzip_deflate_gzip = grpc_channel_args_compression_algorithm_set_state( - &exec_ctx, &ch_args_wo_gzip_deflate, GRPC_COMPRESS_STREAM_GZIP, 0); + ch_args_wo_gzip_deflate_gzip = + grpc_channel_args_compression_algorithm_set_state( + &exec_ctx, &ch_args_wo_gzip_deflate, GRPC_COMPRESS_STREAM_GZIP, 0); GPR_ASSERT(ch_args_wo_gzip_deflate == ch_args_wo_gzip_deflate_gzip); states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states( ch_args_wo_gzip_deflate); for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) { - if (i == GRPC_COMPRESS_MESSAGE_GZIP || i == GRPC_COMPRESS_MESSAGE_DEFLATE || i == GRPC_COMPRESS_STREAM_GZIP) { + if (i == GRPC_COMPRESS_MESSAGE_GZIP || i == GRPC_COMPRESS_MESSAGE_DEFLATE || + i == GRPC_COMPRESS_STREAM_GZIP) { GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0); } else { GPR_ASSERT(GPR_BITGET(states_bitset, i) != 0); diff --git a/test/core/compression/algorithm_test.c b/test/core/compression/algorithm_test.c index 879664ea70..d637e2c0c2 100644 --- a/test/core/compression/algorithm_test.c +++ b/test/core/compression/algorithm_test.c @@ -53,15 +53,22 @@ static void test_algorithm_mesh(void) { if (parsed == 0) { continue; } else if (grpc_compression_algorithm_is_message(parsed)) { - mdelem = grpc_message_compression_encoding_mdelem(grpc_compression_algorithm_to_message_compression_algorithm(parsed)); + mdelem = grpc_message_compression_encoding_mdelem( + grpc_compression_algorithm_to_message_compression_algorithm(parsed)); grpc_slice value = GRPC_MDVALUE(mdelem); - GPR_ASSERT(0 == memcmp(&name[message_prefix_length], GRPC_SLICE_START_PTR(value), GRPC_SLICE_LENGTH(value))); + GPR_ASSERT(0 == memcmp(&name[message_prefix_length], + GRPC_SLICE_START_PTR(value), + GRPC_SLICE_LENGTH(value))); GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_GRPC_ENCODING)); } else { - mdelem = grpc_stream_compression_encoding_mdelem(grpc_compression_algorithm_to_stream_compression_algorithm(parsed)); + mdelem = grpc_stream_compression_encoding_mdelem( + grpc_compression_algorithm_to_stream_compression_algorithm(parsed)); grpc_slice value = GRPC_MDVALUE(mdelem); - GPR_ASSERT(0 == memcmp(&name[stream_prefix_length], GRPC_SLICE_START_PTR(value), GRPC_SLICE_LENGTH(value))); - GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_CONTENT_ENCODING)); + GPR_ASSERT(0 == memcmp(&name[stream_prefix_length], + GRPC_SLICE_START_PTR(value), + GRPC_SLICE_LENGTH(value))); + GPR_ASSERT( + grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_CONTENT_ENCODING)); } grpc_slice_unref_internal(&exec_ctx, mdstr); GRPC_MDELEM_UNREF(&exec_ctx, mdelem); diff --git a/test/core/compression/compression_test.c b/test/core/compression/compression_test.c index 10f7f07a44..fb5876a57a 100644 --- a/test/core/compression/compression_test.c +++ b/test/core/compression/compression_test.c @@ -28,9 +28,11 @@ static void test_compression_algorithm_parse(void) { size_t i; - const char *valid_names[] = {"identity", "message/gzip", "message/deflate", "stream/gzip"}; + const char *valid_names[] = {"identity", "message/gzip", "message/deflate", + "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { - GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; + GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, + GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; const char *invalid_names[] = {"gzip2", "foo", "", "2gzip"}; gpr_log(GPR_DEBUG, "test_compression_algorithm_parse"); @@ -59,9 +61,11 @@ static void test_compression_algorithm_name(void) { int success; const char *name; size_t i; - const char *valid_names[] = {"identity", "message/gzip", "message/deflate", "stream/gzip"}; + const char *valid_names[] = {"identity", "message/gzip", "message/deflate", + "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { - GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; + GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, + GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; gpr_log(GPR_DEBUG, "test_compression_algorithm_name"); @@ -90,28 +94,28 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_HIGH, accepted_encodings)); } { @@ -125,28 +129,28 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_HIGH, accepted_encodings)); } { @@ -160,28 +164,28 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_HIGH, accepted_encodings)); } { @@ -196,28 +200,28 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_HIGH, accepted_encodings)); } { @@ -231,28 +235,28 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_HIGH, accepted_encodings)); } { @@ -268,28 +272,28 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_MESSAGE_HIGH, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_LOW, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_LOW, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_HIGH, - accepted_encodings)); + grpc_compression_algorithm_for_level( + GRPC_COMPRESS_LEVEL_STREAM_HIGH, accepted_encodings)); } } diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c index 55267f4aa8..015664d281 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -51,7 +51,8 @@ static void assert_passthrough(grpc_slice value, int was_compressed; const char *algorithm_name; - GPR_ASSERT(grpc_message_compression_algorithm_name(algorithm, &algorithm_name) != 0); + GPR_ASSERT( + grpc_message_compression_algorithm_name(algorithm, &algorithm_name) != 0); gpr_log( GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR " value_hash=0x%08x " @@ -93,8 +94,8 @@ static void assert_passthrough(grpc_slice value, { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GPR_ASSERT(grpc_msg_decompress( - &exec_ctx, was_compressed ? algorithm : GRPC_MESSAGE_COMPRESS_NONE, &compressed, - &output)); + &exec_ctx, was_compressed ? algorithm : GRPC_MESSAGE_COMPRESS_NONE, + &compressed, &output)); grpc_exec_ctx_finish(&exec_ctx); } @@ -188,8 +189,8 @@ static void test_bad_decompression_data_crc(void) { memcpy(GRPC_SLICE_START_PTR(corrupted.slices[1]) + idx, &bad, 4); /* try (and fail) to decompress the corrupted compresed buffer */ - GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_GZIP, &corrupted, - &output)); + GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_GZIP, + &corrupted, &output)); grpc_exec_ctx_finish(&exec_ctx); grpc_slice_buffer_destroy(&input); @@ -210,8 +211,8 @@ static void test_bad_decompression_data_trailing_garbage(void) { /* try (and fail) to decompress the invalid compresed buffer */ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_DEFLATE, &input, - &output)); + GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_DEFLATE, + &input, &output)); grpc_exec_ctx_finish(&exec_ctx); grpc_slice_buffer_destroy(&input); @@ -229,8 +230,8 @@ static void test_bad_decompression_data_stream(void) { /* try (and fail) to decompress the invalid compresed buffer */ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_DEFLATE, &input, - &output)); + GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_DEFLATE, + &input, &output)); grpc_exec_ctx_finish(&exec_ctx); grpc_slice_buffer_destroy(&input); @@ -248,8 +249,8 @@ static void test_bad_compression_algorithm(void) { &input, grpc_slice_from_copied_string("Never gonna give you up")); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - was_compressed = grpc_msg_compress(&exec_ctx, GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT, - &input, &output); + was_compressed = grpc_msg_compress( + &exec_ctx, GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_compressed); was_compressed = grpc_msg_compress( diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index a11e24d3a1..1700f58bcd 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -597,7 +597,8 @@ static void test_invoke_request_with_compressed_payload_md_override( grpc_metadata identity_compression_override; gzip_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST; - gzip_compression_override.value = grpc_slice_from_static_string("message/gzip"); + gzip_compression_override.value = + grpc_slice_from_static_string("message/gzip"); memset(&gzip_compression_override.internal_data, 0, sizeof(gzip_compression_override.internal_data)); diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.c b/test/core/end2end/tests/stream_compression_compressed_payload.c index ce7598c508..48f3c53383 100644 --- a/test/core/end2end/tests/stream_compression_compressed_payload.c +++ b/test/core/end2end/tests/stream_compression_compressed_payload.c @@ -232,8 +232,8 @@ static void request_for_disabled_algorithm( const char *algo_name = NULL; GPR_ASSERT(grpc_compression_algorithm_name(algorithm_to_disable, &algo_name)); char *expected_details = NULL; - gpr_asprintf(&expected_details, - "Compression algorithm '%s' is disabled.", algo_name); + gpr_asprintf(&expected_details, "Compression algorithm '%s' is disabled.", + algo_name); /* and we expect a specific reason for it */ GPR_ASSERT(0 == grpc_slice_str_cmp(details, expected_details)); gpr_free(expected_details); @@ -582,7 +582,8 @@ static void test_invoke_request_with_compressed_payload_md_override( gzip_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST; - gzip_compression_override.value = grpc_slice_from_static_string("stream/gzip"); + gzip_compression_override.value = + grpc_slice_from_static_string("stream/gzip"); memset(&gzip_compression_override.internal_data, 0, sizeof(gzip_compression_override.internal_data)); diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c index c4c59ff6e1..40bb4a2913 100644 --- a/test/core/surface/byte_buffer_reader_test.c +++ b/test/core/surface/byte_buffer_reader_test.c @@ -133,8 +133,10 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm, grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */ { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT( - grpc_msg_compress(&exec_ctx, grpc_compression_algorithm_to_message_compression_algorithm(algorithm), &sliceb_in, &sliceb_out)); + GPR_ASSERT(grpc_msg_compress( + &exec_ctx, + grpc_compression_algorithm_to_message_compression_algorithm(algorithm), + &sliceb_in, &sliceb_out)); grpc_exec_ctx_finish(&exec_ctx); } |