aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Hope Casey-Allen <hcaseyal@google.com>2018-09-12 14:47:34 -0700
committerGravatar Hope Casey-Allen <hcaseyal@google.com>2018-09-12 16:34:38 -0700
commit5b27941372debbae80c1b7d77bb9be3f5e8a79e1 (patch)
treebfe3b1e7bed34bdc94aa6aed3ee46711dd9a017f /test
parent713f9bc93a94ee7859314725f6c6fd6836d2fce0 (diff)
Even cleaner implementation that does not modify the grpc_mdelem struct.
Diffstat (limited to 'test')
-rw-r--r--test/core/end2end/tests/authority_not_supported.cc4
-rw-r--r--test/core/end2end/tests/binary_metadata.cc8
-rw-r--r--test/core/end2end/tests/simple_cacheable_request.cc8
-rw-r--r--test/core/end2end/tests/simple_metadata.cc8
-rw-r--r--test/core/end2end/tests/trailing_metadata.cc12
-rw-r--r--test/core/transport/metadata_test.cc5
6 files changed, 22 insertions, 23 deletions
diff --git a/test/core/end2end/tests/authority_not_supported.cc b/test/core/end2end/tests/authority_not_supported.cc
index 4ccdb5e72a..01a95e4e10 100644
--- a/test/core/end2end/tests/authority_not_supported.cc
+++ b/test/core/end2end/tests/authority_not_supported.cc
@@ -93,11 +93,11 @@ static void test_with_authority_header(grpc_end2end_test_config config) {
grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
grpc_slice_from_static_string("val1"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key2"),
grpc_slice_from_static_string("val2"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_end2end_test_fixture f =
begin_test(config, "test_with_authority_header", nullptr, nullptr);
cq_verifier* cqv = cq_verifier_create(f.cq);
diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc
index 2ce050355d..cdf5b1eb94 100644
--- a/test/core/end2end/tests/binary_metadata.cc
+++ b/test/core/end2end/tests/binary_metadata.cc
@@ -101,23 +101,23 @@ static void test_request_response_with_metadata_and_payload(
grpc_slice_from_static_string(
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key2-bin"),
grpc_slice_from_static_string(
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_metadata meta_s[2] = {
{grpc_slice_from_static_string("key3-bin"),
grpc_slice_from_static_string(
"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key4-bin"),
grpc_slice_from_static_string(
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_end2end_test_fixture f =
begin_test(config, "test_request_response_with_metadata_and_payload",
nullptr, nullptr);
diff --git a/test/core/end2end/tests/simple_cacheable_request.cc b/test/core/end2end/tests/simple_cacheable_request.cc
index 7493818a27..be6d16ecad 100644
--- a/test/core/end2end/tests/simple_cacheable_request.cc
+++ b/test/core/end2end/tests/simple_cacheable_request.cc
@@ -101,19 +101,19 @@ static void test_cacheable_request_response_with_metadata_and_payload(
grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
grpc_slice_from_static_string("val1"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key2"),
grpc_slice_from_static_string("val2"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
grpc_slice_from_static_string("val3"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key4"),
grpc_slice_from_static_string("val4"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_end2end_test_fixture f = begin_test(
config, "test_cacheable_request_response_with_metadata_and_payload",
nullptr, nullptr);
diff --git a/test/core/end2end/tests/simple_metadata.cc b/test/core/end2end/tests/simple_metadata.cc
index a9e86bda3a..3e476c2129 100644
--- a/test/core/end2end/tests/simple_metadata.cc
+++ b/test/core/end2end/tests/simple_metadata.cc
@@ -99,19 +99,19 @@ static void test_request_response_with_metadata_and_payload(
grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
grpc_slice_from_static_string("val1"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key2"),
grpc_slice_from_static_string("val2"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
grpc_slice_from_static_string("val3"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key4"),
grpc_slice_from_static_string("val4"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_end2end_test_fixture f =
begin_test(config, "test_request_response_with_metadata_and_payload",
nullptr, nullptr);
diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc
index 1fb9683ee5..5cf6f2bb11 100644
--- a/test/core/end2end/tests/trailing_metadata.cc
+++ b/test/core/end2end/tests/trailing_metadata.cc
@@ -99,27 +99,27 @@ static void test_request_response_with_metadata_and_payload(
grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
grpc_slice_from_static_string("val1"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key2"),
grpc_slice_from_static_string("val2"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
grpc_slice_from_static_string("val3"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key4"),
grpc_slice_from_static_string("val4"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_metadata meta_t[2] = {{grpc_slice_from_static_string("key5"),
grpc_slice_from_static_string("val5"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}},
+ {{nullptr, nullptr, nullptr, nullptr}}},
{grpc_slice_from_static_string("key6"),
grpc_slice_from_static_string("val6"),
0,
- {0, {nullptr, nullptr, nullptr, nullptr}}}};
+ {{nullptr, nullptr, nullptr, nullptr}}}};
grpc_end2end_test_fixture f =
begin_test(config, "test_request_response_with_metadata_and_payload",
nullptr, nullptr);
diff --git a/test/core/transport/metadata_test.cc b/test/core/transport/metadata_test.cc
index 7b064c4f2a..4be34f72d9 100644
--- a/test/core/transport/metadata_test.cc
+++ b/test/core/transport/metadata_test.cc
@@ -350,9 +350,8 @@ static void test_copied_static_metadata(bool dup_key, bool dup_value) {
grpc_core::ExecCtx exec_ctx;
for (size_t i = 0; i < GRPC_STATIC_MDELEM_COUNT; i++) {
- grpc_mdelem p =
- GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[i],
- GRPC_MDELEM_STORAGE_STATIC, GRPC_MDINDEX_UNUSED);
+ grpc_mdelem p = GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[i],
+ GRPC_MDELEM_STORAGE_STATIC);
grpc_mdelem q =
grpc_mdelem_from_slices(maybe_dup(GRPC_MDKEY(p), dup_key),
maybe_dup(GRPC_MDVALUE(p), dup_value));