diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-07-22 08:14:12 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-07-22 08:14:12 -0700 |
commit | 6999c096d8fb683cbb78dd27be477d22d64c291f (patch) | |
tree | 4261eeefe684edc57f9647ba28a2c28f34e4d2dc /test | |
parent | f08b067cdbb4000cd997f1aa0641b97db16ebaf8 (diff) |
Canonicalize metadata keys in core
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/tests/request_response_with_metadata_and_payload.c | 4 | ||||
-rw-r--r-- | test/core/transport/metadata_test.c | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_metadata_and_payload.c index ef6dfe9561..9821d7852f 100644 --- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_metadata_and_payload.c @@ -111,8 +111,8 @@ static void test_request_response_with_metadata_and_payload( gpr_timespec deadline = five_seconds_time(); grpc_metadata meta_c[2] = {{"key1", "val1", 4, {{NULL, NULL, NULL}}}, {"key2", "val2", 4, {{NULL, NULL, NULL}}}}; - grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}}, - {"key4", "val4", 4, {{NULL, NULL, NULL}}}}; + grpc_metadata meta_s[2] = {{"KeY3", "val3", 4, {{NULL, NULL, NULL}}}, + {"KeY4", "val4", 4, {{NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *cqv = cq_verifier_create(f.cq); diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index a932e04f33..4a4d4bcb8a 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -63,9 +63,9 @@ static void test_create_string(void) { LOG_TEST("test_create_string"); ctx = grpc_mdctx_create(); - s1 = grpc_mdstr_from_string(ctx, "hello"); - s2 = grpc_mdstr_from_string(ctx, "hello"); - s3 = grpc_mdstr_from_string(ctx, "very much not hello"); + s1 = grpc_mdstr_from_string(ctx, "hello", 0); + s2 = grpc_mdstr_from_string(ctx, "hello", 0); + s3 = grpc_mdstr_from_string(ctx, "very much not hello", 0); GPR_ASSERT(s1 == s2); GPR_ASSERT(s3 != s1); GPR_ASSERT(gpr_slice_str_cmp(s1->slice, "hello") == 0); @@ -190,7 +190,7 @@ static void test_things_stick_around(void) { for (i = 0; i < nstrs; i++) { gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%dx", i); - strs[i] = grpc_mdstr_from_string(ctx, buffer); + strs[i] = grpc_mdstr_from_string(ctx, buffer, 0); shuf[i] = i; gpr_free(buffer); } @@ -212,7 +212,7 @@ static void test_things_stick_around(void) { GRPC_MDSTR_UNREF(strs[shuf[i]]); for (j = i + 1; j < nstrs; j++) { gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%dx", shuf[j]); - test = grpc_mdstr_from_string(ctx, buffer); + test = grpc_mdstr_from_string(ctx, buffer, 0); GPR_ASSERT(test == strs[shuf[j]]); GRPC_MDSTR_UNREF(test); gpr_free(buffer); @@ -235,13 +235,13 @@ static void test_slices_work(void) { ctx = grpc_mdctx_create(); str = grpc_mdstr_from_string( - ctx, "123456789012345678901234567890123456789012345678901234567890"); + ctx, "123456789012345678901234567890123456789012345678901234567890", 0); slice = gpr_slice_ref(str->slice); GRPC_MDSTR_UNREF(str); gpr_slice_unref(slice); str = grpc_mdstr_from_string( - ctx, "123456789012345678901234567890123456789012345678901234567890"); + ctx, "123456789012345678901234567890123456789012345678901234567890", 0); slice = gpr_slice_ref(str->slice); gpr_slice_unref(slice); GRPC_MDSTR_UNREF(str); @@ -258,7 +258,7 @@ static void test_base64_and_huffman_works(void) { LOG_TEST("test_base64_and_huffman_works"); ctx = grpc_mdctx_create(); - str = grpc_mdstr_from_string(ctx, "abcdefg"); + str = grpc_mdstr_from_string(ctx, "abcdefg", 0); slice1 = grpc_mdstr_as_base64_encoded_and_huffman_compressed(str); slice2 = grpc_chttp2_base64_encode_and_huffman_compress(str->slice); GPR_ASSERT(0 == gpr_slice_cmp(slice1, slice2)); |