diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-10-23 15:33:21 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-10-25 16:23:01 -0700 |
commit | 34a57d0346afe95e11104462c30dc468b0cb0b89 (patch) | |
tree | 67db15f7b8b361e0618199dc55215f3b4d626201 /test/core/transport | |
parent | c563b583cb9b7fecc33971581368796d2df4759d (diff) |
rename all test core files to cc and a lot of C++ style conversions
Diffstat (limited to 'test/core/transport')
-rw-r--r-- | test/core/transport/byte_stream_test.cc (renamed from test/core/transport/byte_stream_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/chttp2/alpn_test.cc (renamed from test/core/transport/chttp2/alpn_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/chttp2/bin_decoder_test.cc (renamed from test/core/transport/chttp2/bin_decoder_test.c) | 2 | ||||
-rw-r--r-- | test/core/transport/chttp2/bin_encoder_test.cc (renamed from test/core/transport/chttp2/bin_encoder_test.c) | 4 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_encoder_test.cc (renamed from test/core/transport/chttp2/hpack_encoder_test.c) | 9 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_parser_fuzzer_test.cc (renamed from test/core/transport/chttp2/hpack_parser_fuzzer_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_parser_test.cc (renamed from test/core/transport/chttp2/hpack_parser_test.c) | 2 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_table_test.cc (renamed from test/core/transport/chttp2/hpack_table_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/chttp2/stream_map_test.cc (renamed from test/core/transport/chttp2/stream_map_test.c) | 2 | ||||
-rw-r--r-- | test/core/transport/chttp2/varint_test.cc (renamed from test/core/transport/chttp2/varint_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/connectivity_state_test.cc (renamed from test/core/transport/connectivity_state_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/metadata_test.cc (renamed from test/core/transport/metadata_test.c) | 12 | ||||
-rw-r--r-- | test/core/transport/status_conversion_test.cc (renamed from test/core/transport/status_conversion_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/stream_owned_slice_test.cc (renamed from test/core/transport/stream_owned_slice_test.c) | 0 | ||||
-rw-r--r-- | test/core/transport/timeout_encoding_test.cc (renamed from test/core/transport/timeout_encoding_test.c) | 0 |
15 files changed, 18 insertions, 13 deletions
diff --git a/test/core/transport/byte_stream_test.c b/test/core/transport/byte_stream_test.cc index a0c5f961cf..a0c5f961cf 100644 --- a/test/core/transport/byte_stream_test.c +++ b/test/core/transport/byte_stream_test.cc diff --git a/test/core/transport/chttp2/alpn_test.c b/test/core/transport/chttp2/alpn_test.cc index 72c30c40eb..72c30c40eb 100644 --- a/test/core/transport/chttp2/alpn_test.c +++ b/test/core/transport/chttp2/alpn_test.cc diff --git a/test/core/transport/chttp2/bin_decoder_test.c b/test/core/transport/chttp2/bin_decoder_test.cc index 775161ec91..a09aadb18d 100644 --- a/test/core/transport/chttp2/bin_decoder_test.c +++ b/test/core/transport/chttp2/bin_decoder_test.cc @@ -30,7 +30,7 @@ static int all_ok = 1; static void expect_slice_eq(grpc_exec_ctx *exec_ctx, grpc_slice expected, - grpc_slice slice, char *debug, int line) { + grpc_slice slice, const char *debug, int line) { if (!grpc_slice_eq(slice, expected)) { char *hs = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *he = grpc_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII); diff --git a/test/core/transport/chttp2/bin_encoder_test.c b/test/core/transport/chttp2/bin_encoder_test.cc index acadcf6c89..d073f74d27 100644 --- a/test/core/transport/chttp2/bin_encoder_test.c +++ b/test/core/transport/chttp2/bin_encoder_test.cc @@ -31,8 +31,8 @@ static int all_ok = 1; -static void expect_slice_eq(grpc_slice expected, grpc_slice slice, char *debug, - int line) { +static void expect_slice_eq(grpc_slice expected, grpc_slice slice, + const char *debug, int line) { if (!grpc_slice_eq(slice, expected)) { char *hs = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *he = grpc_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII); diff --git a/test/core/transport/chttp2/hpack_encoder_test.c b/test/core/transport/chttp2/hpack_encoder_test.cc index a2af83b6cb..b203df1892 100644 --- a/test/core/transport/chttp2/hpack_encoder_test.c +++ b/test/core/transport/chttp2/hpack_encoder_test.cc @@ -58,7 +58,8 @@ static void verify(grpc_exec_ctx *exec_ctx, const verify_params params, grpc_slice expect = parse_hexstring(expected); size_t i; va_list l; - grpc_linked_mdelem *e = gpr_malloc(sizeof(*e) * nheaders); + grpc_linked_mdelem *e = + static_cast<grpc_linked_mdelem *>(gpr_malloc(sizeof(*e) * nheaders)); grpc_metadata_batch b; grpc_metadata_batch_init(&b); @@ -89,7 +90,8 @@ static void verify(grpc_exec_ctx *exec_ctx, const verify_params params, if (cap_to_delete == num_to_delete) { cap_to_delete = GPR_MAX(2 * cap_to_delete, 1000); - to_delete = gpr_realloc(to_delete, sizeof(*to_delete) * cap_to_delete); + to_delete = static_cast<void **>( + gpr_realloc(to_delete, sizeof(*to_delete) * cap_to_delete)); } to_delete[num_to_delete++] = e; @@ -209,7 +211,8 @@ static void verify_table_size_change_match_elem_size(grpc_exec_ctx *exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(value))); size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, use_true_binary); size_t initial_table_size = g_compressor.table_size; - grpc_linked_mdelem *e = gpr_malloc(sizeof(*e)); + grpc_linked_mdelem *e = + static_cast<grpc_linked_mdelem *>(gpr_malloc(sizeof(*e))); grpc_metadata_batch b; grpc_metadata_batch_init(&b); e[0].md = elem; diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc index 03834084cb..03834084cb 100644 --- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c +++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.cc index 0946c05261..27b4a1c2c0 100644 --- a/test/core/transport/chttp2/hpack_parser_test.c +++ b/test/core/transport/chttp2/hpack_parser_test.cc @@ -32,7 +32,7 @@ typedef struct { va_list args; } test_checker; static void onhdr(grpc_exec_ctx *exec_ctx, void *ud, grpc_mdelem md) { const char *ekey, *evalue; - test_checker *chk = ud; + test_checker *chk = static_cast<test_checker *>(ud); ekey = va_arg(chk->args, char *); GPR_ASSERT(ekey); evalue = va_arg(chk->args, char *); diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.cc index 430ece33c7..430ece33c7 100644 --- a/test/core/transport/chttp2/hpack_table_test.c +++ b/test/core/transport/chttp2/hpack_table_test.cc diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.cc index ae2583ab84..7df7b1b2a6 100644 --- a/test/core/transport/chttp2/stream_map_test.c +++ b/test/core/transport/chttp2/stream_map_test.cc @@ -92,7 +92,7 @@ static void test_basic_add_find(uint32_t n) { /* verify that for_each gets the right values during test_delete_evens_XXX */ static void verify_for_each(void *user_data, uint32_t stream_id, void *ptr) { - uint32_t *for_each_check = user_data; + uint32_t *for_each_check = static_cast<uint32_t *>(user_data); GPR_ASSERT(ptr); GPR_ASSERT(*for_each_check == stream_id); *for_each_check += 2; diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.cc index 0986a2cde6..0986a2cde6 100644 --- a/test/core/transport/chttp2/varint_test.c +++ b/test/core/transport/chttp2/varint_test.cc diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.cc index 4ef8683107..4ef8683107 100644 --- a/test/core/transport/connectivity_state_test.c +++ b/test/core/transport/connectivity_state_test.cc diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.cc index f7124d29a7..e043078560 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.cc @@ -114,7 +114,8 @@ static void test_create_many_ephemeral_metadata(bool intern_keys, static void test_create_many_persistant_metadata(void) { char buffer[GPR_LTOA_MIN_BUFSIZE]; long i; - grpc_mdelem *created = gpr_malloc(sizeof(grpc_mdelem) * MANY); + grpc_mdelem *created = + static_cast<grpc_mdelem *>(gpr_malloc(sizeof(grpc_mdelem) * MANY)); grpc_mdelem md; gpr_log(GPR_INFO, "test_create_many_persistant_metadata"); @@ -226,8 +227,9 @@ static void test_things_stick_around(void) { size_t i, j; char *buffer; size_t nstrs = 1000; - grpc_slice *strs = gpr_malloc(sizeof(grpc_slice) * nstrs); - size_t *shuf = gpr_malloc(sizeof(size_t) * nstrs); + grpc_slice *strs = + static_cast<grpc_slice *>(gpr_malloc(sizeof(grpc_slice) * nstrs)); + size_t *shuf = static_cast<size_t *>(gpr_malloc(sizeof(size_t) * nstrs)); grpc_slice test; gpr_log(GPR_INFO, "test_things_stick_around"); @@ -281,9 +283,9 @@ static void test_user_data_works(void) { grpc_init(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - ud1 = gpr_malloc(sizeof(int)); + ud1 = static_cast<int *>(gpr_malloc(sizeof(int))); *ud1 = 1; - ud2 = gpr_malloc(sizeof(int)); + ud2 = static_cast<int *>(gpr_malloc(sizeof(int))); *ud2 = 2; md = grpc_mdelem_from_slices( &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")), diff --git a/test/core/transport/status_conversion_test.c b/test/core/transport/status_conversion_test.cc index de8fa4458a..de8fa4458a 100644 --- a/test/core/transport/status_conversion_test.c +++ b/test/core/transport/status_conversion_test.cc diff --git a/test/core/transport/stream_owned_slice_test.c b/test/core/transport/stream_owned_slice_test.cc index 774ad4e72e..774ad4e72e 100644 --- a/test/core/transport/stream_owned_slice_test.c +++ b/test/core/transport/stream_owned_slice_test.cc diff --git a/test/core/transport/timeout_encoding_test.c b/test/core/transport/timeout_encoding_test.cc index 30357faed3..30357faed3 100644 --- a/test/core/transport/timeout_encoding_test.c +++ b/test/core/transport/timeout_encoding_test.cc |