diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2017-01-20 13:39:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-20 13:39:08 -0800 |
commit | 28ec869b5a2567cd30a6e3bcc0efbee0ab0ae7f5 (patch) | |
tree | be591d8c9033c3c4aa064b458acc8e7fe62d7598 /test/core/end2end/end2end_test_utils.c | |
parent | bd827887ffbb57a95990130f585913b13f44a5b7 (diff) | |
parent | 2b5cf1ff2681bb94fa1e3651f8ccfc14bdfa71b2 (diff) |
Merge pull request #8842 from ctiller/metadata_filter
Metadata handling rewrite
Diffstat (limited to 'test/core/end2end/end2end_test_utils.c')
-rw-r--r-- | test/core/end2end/end2end_test_utils.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/core/end2end/end2end_test_utils.c b/test/core/end2end/end2end_test_utils.c index 46fb4ec1af..8783d8451b 100644 --- a/test/core/end2end/end2end_test_utils.c +++ b/test/core/end2end/end2end_test_utils.c @@ -39,13 +39,27 @@ const char *get_host_override_string(const char *str, grpc_end2end_test_config config) { - return (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER ? str - : NULL); + if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) { + return str; + } else { + return NULL; + } +} + +const grpc_slice *get_host_override_slice(const char *str, + grpc_end2end_test_config config) { + const char *r = get_host_override_string(str, config); + if (r != NULL) { + static grpc_slice ret; + ret = grpc_slice_from_static_string(r); + return &ret; + } + return NULL; } -void validate_host_override_string(const char *pattern, const char *str, +void validate_host_override_string(const char *pattern, grpc_slice str, grpc_end2end_test_config config) { if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) { - GPR_ASSERT(0 == strcmp(str, pattern)); + GPR_ASSERT(0 == grpc_slice_str_cmp(str, pattern)); } } |