From e6d888d0a086e0d208cad1849def4326f28670f0 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 14 Sep 2017 09:42:56 -0700 Subject: Change C core surface API --- test/core/compression/BUILD | 12 ++ test/core/compression/algorithm_test.c | 18 ++- test/core/compression/compression_test.c | 178 +++++++++++++++++++++----- test/core/compression/message_compress_test.c | 34 ++--- 4 files changed, 193 insertions(+), 49 deletions(-) (limited to 'test/core/compression') diff --git a/test/core/compression/BUILD b/test/core/compression/BUILD index 1ab6e35f0d..bbbd4c2e88 100644 --- a/test/core/compression/BUILD +++ b/test/core/compression/BUILD @@ -53,3 +53,15 @@ grpc_cc_test( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "stream_compress_test", + srcs = ["stream_compress_test.c"], + language = "C", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:gpr_test_util", + "//test/core/util:grpc_test_util", + ], +) diff --git a/test/core/compression/algorithm_test.c b/test/core/compression/algorithm_test.c index e37c8c3010..51f7d09984 100644 --- a/test/core/compression/algorithm_test.c +++ b/test/core/compression/algorithm_test.c @@ -29,6 +29,8 @@ #include "src/core/lib/transport/static_metadata.h" #include "test/core/util/test_config.h" +const uint32_t message_prefix_length = 8; +const uint32_t stream_prefix_length = 7; static void test_algorithm_mesh(void) { int i; @@ -48,9 +50,19 @@ static void test_algorithm_mesh(void) { mdstr = grpc_slice_from_copied_string(name); GPR_ASSERT(grpc_slice_eq(mdstr, grpc_compression_algorithm_slice(parsed))); GPR_ASSERT(parsed == grpc_compression_algorithm_from_slice(mdstr)); - mdelem = grpc_compression_encoding_mdelem(parsed); - GPR_ASSERT(grpc_slice_eq(GRPC_MDVALUE(mdelem), mdstr)); - GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_GRPC_ENCODING)); + 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)); + 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(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)); + 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)); + } grpc_slice_unref_internal(&exec_ctx, mdstr); GRPC_MDELEM_UNREF(&exec_ctx, mdelem); grpc_exec_ctx_finish(&exec_ctx); diff --git a/test/core/compression/compression_test.c b/test/core/compression/compression_test.c index 4b6026ec77..4b300e18d3 100644 --- a/test/core/compression/compression_test.c +++ b/test/core/compression/compression_test.c @@ -28,9 +28,9 @@ static void test_compression_algorithm_parse(void) { size_t i; - const char *valid_names[] = {"identity", "gzip", "deflate"}; + const char *valid_names[] = {"identity", "message/gzip", "message/deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { - GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE}; + 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 +59,9 @@ static void test_compression_algorithm_name(void) { int success; char *name; size_t i; - const char *valid_names[] = {"identity", "gzip", "deflate"}; + const char *valid_names[] = {"identity", "message/gzip", "message/deflate", "stream/gzip"}; const grpc_compression_algorithm valid_algorithms[] = { - GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE}; + GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP, GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP}; gpr_log(GPR_DEBUG, "test_compression_algorithm_name"); @@ -90,15 +90,27 @@ static void test_compression_algorithm_for_level(void) { accepted_encodings)); GPR_ASSERT(GRPC_COMPRESS_NONE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, + 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_MED, + 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_HIGH, + 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)); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + 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)); } @@ -106,22 +118,34 @@ static void test_compression_algorithm_for_level(void) { /* accept only gzip */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + 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)); } @@ -129,22 +153,34 @@ static void test_compression_algorithm_for_level(void) { /* accept only deflate */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_LOW, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MESSAGE_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + 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)); } @@ -152,23 +188,107 @@ static void test_compression_algorithm_for_level(void) { /* accept gzip and deflate */ uint32_t accepted_encodings = 0; GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP); - GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE); GPR_ASSERT(GRPC_COMPRESS_NONE == grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_GZIP == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW, + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + 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)); + } + + { + /* accept stream gzip */ + uint32_t accepted_encodings = 0; + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_STREAM_GZIP); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, + accepted_encodings)); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == + 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)); + } + + { + /* accept all algorithms */ + uint32_t accepted_encodings = 0; + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE); + GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_STREAM_GZIP); + + GPR_ASSERT(GRPC_COMPRESS_NONE == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, + accepted_encodings)); + + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP == + 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)); + + GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE == + 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)); - GPR_ASSERT(GRPC_COMPRESS_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED, + GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == + grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_STREAM_MED, accepted_encodings)); - GPR_ASSERT(GRPC_COMPRESS_DEFLATE == - grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH, + GPR_ASSERT(GRPC_COMPRESS_STREAM_GZIP == + 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 fd692fe5a5..4444b65802 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -39,7 +39,7 @@ typedef enum { } compressability; static void assert_passthrough(grpc_slice value, - grpc_compression_algorithm algorithm, + grpc_message_compression_algorithm algorithm, grpc_slice_split_mode uncompressed_split_mode, grpc_slice_split_mode compressed_split_mode, compressability compress_result_check) { @@ -51,7 +51,7 @@ static void assert_passthrough(grpc_slice value, int was_compressed; char *algorithm_name; - GPR_ASSERT(grpc_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,7 +93,7 @@ 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_COMPRESS_NONE, &compressed, + &exec_ctx, was_compressed ? algorithm : GRPC_MESSAGE_COMPRESS_NONE, &compressed, &output)); grpc_exec_ctx_finish(&exec_ctx); } @@ -115,8 +115,8 @@ static grpc_slice repeated(char c, size_t length) { } static compressability get_compressability( - test_value id, grpc_compression_algorithm algorithm) { - if (algorithm == GRPC_COMPRESS_NONE) return SHOULD_NOT_COMPRESS; + test_value id, grpc_message_compression_algorithm algorithm) { + if (algorithm == GRPC_MESSAGE_COMPRESS_NONE) return SHOULD_NOT_COMPRESS; switch (id) { case ONE_A: return SHOULD_NOT_COMPRESS; @@ -148,14 +148,14 @@ static grpc_slice create_test_value(test_value id) { static void test_tiny_data_compress(void) { grpc_slice_buffer input; grpc_slice_buffer output; - grpc_compression_algorithm i; + grpc_message_compression_algorithm i; grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); grpc_slice_buffer_add(&input, create_test_value(ONE_A)); - for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) { - if (i == GRPC_COMPRESS_NONE) continue; + for (i = 0; i < GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT; i++) { + if (i == GRPC_MESSAGE_COMPRESS_NONE) continue; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GPR_ASSERT(0 == grpc_msg_compress(&exec_ctx, i, &input, &output)); grpc_exec_ctx_finish(&exec_ctx); @@ -180,7 +180,7 @@ static void test_bad_decompression_data_crc(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; /* compress it */ - grpc_msg_compress(&exec_ctx, GRPC_COMPRESS_GZIP, &input, &corrupted); + grpc_msg_compress(&exec_ctx, GRPC_MESSAGE_COMPRESS_GZIP, &input, &corrupted); /* corrupt the output by smashing the CRC */ GPR_ASSERT(corrupted.count > 1); GPR_ASSERT(GRPC_SLICE_LENGTH(corrupted.slices[1]) > 8); @@ -188,7 +188,7 @@ 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_COMPRESS_GZIP, &corrupted, + GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_GZIP, &corrupted, &output)); grpc_exec_ctx_finish(&exec_ctx); @@ -210,7 +210,7 @@ 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_COMPRESS_DEFLATE, &input, + GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_DEFLATE, &input, &output)); grpc_exec_ctx_finish(&exec_ctx); @@ -229,7 +229,7 @@ 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_COMPRESS_DEFLATE, &input, + GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_MESSAGE_COMPRESS_DEFLATE, &input, &output)); grpc_exec_ctx_finish(&exec_ctx); @@ -248,12 +248,12 @@ 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_COMPRESS_ALGORITHMS_COUNT, + was_compressed = grpc_msg_compress(&exec_ctx, GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_compressed); was_compressed = grpc_msg_compress( - &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output); + &exec_ctx, GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output); GPR_ASSERT(0 == was_compressed); grpc_exec_ctx_finish(&exec_ctx); @@ -273,11 +273,11 @@ static void test_bad_decompression_algorithm(void) { "I'm not really compressed but it doesn't matter")); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; was_decompressed = grpc_msg_decompress( - &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output); + &exec_ctx, GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT, &input, &output); GPR_ASSERT(0 == was_decompressed); was_decompressed = grpc_msg_decompress( - &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output); + &exec_ctx, GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output); GPR_ASSERT(0 == was_decompressed); grpc_exec_ctx_finish(&exec_ctx); @@ -296,7 +296,7 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); - for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) { + for (i = 0; i < GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT; i++) { for (j = 0; j < GPR_ARRAY_SIZE(uncompressed_split_modes); j++) { for (k = 0; k < GPR_ARRAY_SIZE(compressed_split_modes); k++) { for (m = 0; m < TEST_VALUE_COUNT; m++) { -- cgit v1.2.3