aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2017-09-22 14:41:41 -0700
committerGravatar GitHub <noreply@github.com>2017-09-22 14:41:41 -0700
commit31c66c576ad00504b34182340f8ff21bc3f447fb (patch)
tree2e81b0e758d7b48948dc81ef13a4cf1ce184f36b /test/core
parent806c9c8aba225bd83a85a419209e1cdfcf25c245 (diff)
parent4b527a7d8c895abe537384b49465cfa6a53b6162 (diff)
Merge pull request #12399 from muxi/fix-stream-compression-transport-duplicate
Fix stream compression transport duplicate
Diffstat (limited to 'test/core')
-rw-r--r--test/core/compression/stream_compression_test.c31
-rw-r--r--test/core/end2end/tests/compressed_payload.c9
-rw-r--r--test/core/end2end/tests/stream_compression_compressed_payload.c9
3 files changed, 28 insertions, 21 deletions
diff --git a/test/core/compression/stream_compression_test.c b/test/core/compression/stream_compression_test.c
index e576507aaf..afed6cd6b5 100644
--- a/test/core/compression/stream_compression_test.c
+++ b/test/core/compression/stream_compression_test.c
@@ -59,10 +59,11 @@ static void test_stream_compression_simple_compress_decompress() {
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
grpc_stream_compression_context *compress_ctx =
- grpc_stream_compression_context_create(GRPC_STREAM_COMPRESSION_COMPRESS);
+ grpc_stream_compression_context_create(
+ GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_stream_compression_context *decompress_ctx =
grpc_stream_compression_context_create(
- GRPC_STREAM_COMPRESSION_DECOMPRESS);
+ GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
grpc_slice_buffer_add(&source, slice);
GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
@@ -91,10 +92,11 @@ test_stream_compression_simple_compress_decompress_with_output_size_constraint()
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
grpc_stream_compression_context *compress_ctx =
- grpc_stream_compression_context_create(GRPC_STREAM_COMPRESSION_COMPRESS);
+ grpc_stream_compression_context_create(
+ GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_stream_compression_context *decompress_ctx =
grpc_stream_compression_context_create(
- GRPC_STREAM_COMPRESSION_DECOMPRESS);
+ GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
grpc_slice_buffer_add(&source, slice);
GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
@@ -139,10 +141,11 @@ test_stream_compression_simple_compress_decompress_with_large_data() {
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
grpc_stream_compression_context *compress_ctx =
- grpc_stream_compression_context_create(GRPC_STREAM_COMPRESSION_COMPRESS);
+ grpc_stream_compression_context_create(
+ GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_stream_compression_context *decompress_ctx =
grpc_stream_compression_context_create(
- GRPC_STREAM_COMPRESSION_DECOMPRESS);
+ GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
grpc_slice_buffer_add(&source, slice);
GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
@@ -172,7 +175,8 @@ static void test_stream_compression_drop_context() {
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
grpc_stream_compression_context *compress_ctx =
- grpc_stream_compression_context_create(GRPC_STREAM_COMPRESSION_COMPRESS);
+ grpc_stream_compression_context_create(
+ GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
grpc_slice_buffer_add(&source, slice);
GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
@@ -180,8 +184,8 @@ static void test_stream_compression_drop_context() {
GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
grpc_stream_compression_context_destroy(compress_ctx);
- compress_ctx =
- grpc_stream_compression_context_create(GRPC_STREAM_COMPRESSION_COMPRESS);
+ compress_ctx = grpc_stream_compression_context_create(
+ GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
slice = grpc_slice_from_static_string(test_str2);
grpc_slice_buffer_add(&source, slice);
GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
@@ -205,7 +209,7 @@ static void test_stream_compression_drop_context() {
grpc_stream_compression_context *decompress_ctx =
grpc_stream_compression_context_create(
- GRPC_STREAM_COMPRESSION_DECOMPRESS);
+ GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
bool end_of_context;
size_t output_size;
GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
@@ -219,7 +223,7 @@ static void test_stream_compression_drop_context() {
grpc_slice_buffer_init(&sink);
decompress_ctx = grpc_stream_compression_context_create(
- GRPC_STREAM_COMPRESSION_DECOMPRESS);
+ GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
~(size_t)0, &end_of_context));
GPR_ASSERT(end_of_context == true);
@@ -240,7 +244,8 @@ static void test_stream_compression_sync_flush() {
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
grpc_stream_compression_context *compress_ctx =
- grpc_stream_compression_context_create(GRPC_STREAM_COMPRESSION_COMPRESS);
+ grpc_stream_compression_context_create(
+ GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
grpc_slice_buffer_add(&source, slice);
GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
@@ -249,7 +254,7 @@ static void test_stream_compression_sync_flush() {
grpc_stream_compression_context *decompress_ctx =
grpc_stream_compression_context_create(
- GRPC_STREAM_COMPRESSION_DECOMPRESS);
+ GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
bool end_of_context;
size_t output_size;
GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c
index 639af15454..ce86e97b83 100644
--- a/test/core/end2end/tests/compressed_payload.c
+++ b/test/core/end2end/tests/compressed_payload.c
@@ -151,6 +151,11 @@ static void request_for_disabled_algorithm(
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
+ error =
+ grpc_server_request_call(f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101));
+ GPR_ASSERT(GRPC_CALL_OK == error);
+
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -187,10 +192,6 @@ static void request_for_disabled_algorithm(
error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
- error =
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.cq, f.cq, tag(101));
- GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(101), true);
cq_verify(cqv);
diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.c b/test/core/end2end/tests/stream_compression_compressed_payload.c
index 5a69091a57..094c4de1c0 100644
--- a/test/core/end2end/tests/stream_compression_compressed_payload.c
+++ b/test/core/end2end/tests/stream_compression_compressed_payload.c
@@ -151,6 +151,11 @@ static void request_for_disabled_algorithm(
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
+ error =
+ grpc_server_request_call(f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101));
+ GPR_ASSERT(GRPC_CALL_OK == error);
+
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -187,10 +192,6 @@ static void request_for_disabled_algorithm(
error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
- error =
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.cq, f.cq, tag(101));
- GPR_ASSERT(GRPC_CALL_OK == error);
CQ_EXPECT_COMPLETION(cqv, tag(101), true);
cq_verify(cqv);