|
|
|
@ -59,7 +59,8 @@ 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_GZIP_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_GZIP_DECOMPRESS); |
|
|
|
@ -91,7 +92,8 @@ 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_GZIP_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_GZIP_DECOMPRESS); |
|
|
|
@ -139,7 +141,8 @@ 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_GZIP_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_GZIP_DECOMPRESS); |
|
|
|
@ -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_GZIP_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_GZIP_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, |
|
|
|
@ -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_GZIP_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, |
|
|
|
|