diff options
Diffstat (limited to 'test/core/surface')
-rw-r--r-- | test/core/surface/byte_buffer_reader_test.cc | 21 | ||||
-rw-r--r-- | test/core/surface/public_headers_must_be_c89.c | 8 |
2 files changed, 16 insertions, 13 deletions
diff --git a/test/core/surface/byte_buffer_reader_test.cc b/test/core/surface/byte_buffer_reader_test.cc index 94a8615b3c..91662b027a 100644 --- a/test/core/surface/byte_buffer_reader_test.cc +++ b/test/core/surface/byte_buffer_reader_test.cc @@ -109,7 +109,7 @@ static void test_read_corrupted_slice(void) { LOG_TEST("test_read_corrupted_slice"); slice = grpc_slice_from_copied_string("test"); buffer = grpc_raw_byte_buffer_create(&slice, 1); - buffer->data.raw.compression = GRPC_COMPRESS_GZIP; /* lies! */ + buffer->data.raw.compression = GRPC_COMPRESS_MESSAGE_GZIP; /* lies! */ grpc_slice_unref(slice); GPR_ASSERT(!grpc_byte_buffer_reader_init(&reader, buffer)); grpc_byte_buffer_destroy(buffer); @@ -133,7 +133,10 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm, grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */ { grpc_core::ExecCtx exec_ctx; - GPR_ASSERT(grpc_msg_compress(algorithm, &sliceb_in, &sliceb_out)); + GPR_ASSERT(grpc_msg_compress( + + grpc_compression_algorithm_to_message_compression_algorithm(algorithm), + &sliceb_in, &sliceb_out)); } buffer = grpc_raw_compressed_byte_buffer_create(sliceb_out.slices, @@ -158,13 +161,13 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm, static void test_read_gzip_compressed_slice(void) { const size_t INPUT_SIZE = 2048; LOG_TEST("test_read_gzip_compressed_slice"); - read_compressed_slice(GRPC_COMPRESS_GZIP, INPUT_SIZE); + read_compressed_slice(GRPC_COMPRESS_MESSAGE_GZIP, INPUT_SIZE); } static void test_read_deflate_compressed_slice(void) { const size_t INPUT_SIZE = 2048; LOG_TEST("test_read_deflate_compressed_slice"); - read_compressed_slice(GRPC_COMPRESS_DEFLATE, INPUT_SIZE); + read_compressed_slice(GRPC_COMPRESS_MESSAGE_DEFLATE, INPUT_SIZE); } static void test_byte_buffer_from_reader(void) { @@ -202,8 +205,8 @@ static void test_readall(void) { LOG_TEST("test_readall"); - memset(lotsa_as, 'a', 512); - memset(lotsa_bs, 'b', 1024); + memset(lotsa_as, 'a', 512 * sizeof(lotsa_as[0])); + memset(lotsa_bs, 'b', 1024 * sizeof(lotsa_bs[0])); /* use slices large enough to overflow inlining */ slices[0] = grpc_slice_malloc(512); memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512); @@ -237,8 +240,8 @@ static void test_byte_buffer_copy(void) { LOG_TEST("test_byte_buffer_copy"); - memset(lotsa_as, 'a', 512); - memset(lotsa_bs, 'b', 1024); + memset(lotsa_as, 'a', 512 * sizeof(lotsa_as[0])); + memset(lotsa_bs, 'b', 1024 * sizeof(lotsa_bs[0])); /* use slices large enough to overflow inlining */ slices[0] = grpc_slice_malloc(512); memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512); @@ -265,7 +268,6 @@ static void test_byte_buffer_copy(void) { int main(int argc, char** argv) { grpc_test_init(argc, argv); - grpc_init(); test_read_one_slice(); test_read_one_slice_malloc(); test_read_none_compressed_slice(); @@ -275,6 +277,5 @@ int main(int argc, char** argv) { test_byte_buffer_from_reader(); test_byte_buffer_copy(); test_readall(); - grpc_shutdown(); return 0; } diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index 7fd36a241a..f4de5d7d8a 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -20,6 +20,7 @@ #include <grpc/byte_buffer_reader.h> #include <grpc/census.h> #include <grpc/compression.h> +#include <grpc/compression_ruby.h> #include <grpc/fork.h> #include <grpc/grpc.h> #include <grpc/grpc_security.h> @@ -66,16 +67,17 @@ #include <stdio.h> int main(int argc, char **argv) { + printf("%lx", (unsigned long) grpc_compression_algorithm_is_message); + printf("%lx", (unsigned long) grpc_compression_algorithm_is_stream); printf("%lx", (unsigned long) grpc_compression_algorithm_parse); printf("%lx", (unsigned long) grpc_compression_algorithm_name); - printf("%lx", (unsigned long) grpc_stream_compression_algorithm_name); printf("%lx", (unsigned long) grpc_compression_algorithm_for_level); - printf("%lx", (unsigned long) grpc_stream_compression_algorithm_for_level); printf("%lx", (unsigned long) grpc_compression_options_init); printf("%lx", (unsigned long) grpc_compression_options_enable_algorithm); printf("%lx", (unsigned long) grpc_compression_options_disable_algorithm); printf("%lx", (unsigned long) grpc_compression_options_is_algorithm_enabled); - printf("%lx", (unsigned long) grpc_compression_options_is_stream_compression_algorithm_enabled); + printf("%lx", (unsigned long) grpc_compression_algorithm_parse_ruby); + printf("%lx", (unsigned long) grpc_compression_algorithm_name_ruby); printf("%lx", (unsigned long) grpc_metadata_array_init); printf("%lx", (unsigned long) grpc_metadata_array_destroy); printf("%lx", (unsigned long) grpc_call_details_init); |