aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/compression
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-10-11 16:23:17 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-10-11 16:27:51 -0700
commit4c7bc85bd824ddeb2216961e0280e9017442c17b (patch)
tree6fd6ad5e926d2fa307b29602111a3706c7d14606 /test/core/compression
parent33d7a7aa5a7ff5230a654390779e5da56a7639f8 (diff)
Revert changes to "identity" "deflate" "gzip" "stream-gzip" compression algorithm names at surface API
Diffstat (limited to 'test/core/compression')
-rw-r--r--test/core/compression/algorithm_test.c3
-rw-r--r--test/core/compression/compression_test.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/test/core/compression/algorithm_test.c b/test/core/compression/algorithm_test.c
index e7a9b0f94a..d637e2c0c2 100644
--- a/test/core/compression/algorithm_test.c
+++ b/test/core/compression/algorithm_test.c
@@ -29,6 +29,7 @@
#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;
@@ -55,7 +56,7 @@ static void test_algorithm_mesh(void) {
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,
+ 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));
diff --git a/test/core/compression/compression_test.c b/test/core/compression/compression_test.c
index 45a1cf4f75..fb5876a57a 100644
--- a/test/core/compression/compression_test.c
+++ b/test/core/compression/compression_test.c
@@ -28,7 +28,8 @@
static void test_compression_algorithm_parse(void) {
size_t i;
- const char *valid_names[] = {"identity", "gzip", "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};
@@ -60,7 +61,8 @@ static void test_compression_algorithm_name(void) {
int success;
const char *name;
size_t i;
- const char *valid_names[] = {"identity", "gzip", "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};