aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/transport/chttp2/hpack_parser_test.c
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2016-11-08 11:28:13 -0800
committerGravatar Muxi Yan <mxyan@google.com>2016-11-08 11:28:13 -0800
commit10a27c14273d401b730eff95df37197a63d25cc3 (patch)
tree48e256ff6021ea24a918ebd8602a7cbfd77f35f6 /test/core/transport/chttp2/hpack_parser_test.c
parente266d9fc7519a1cb7f46c84d7ad1dd8669bbfac7 (diff)
parentdb096f3dba94e11bd8f78ed1ed7ff15ea585cd4f (diff)
Merge remote-tracking branch 'upstream/master' into no-authority-header-in-cronet
Diffstat (limited to 'test/core/transport/chttp2/hpack_parser_test.c')
-rw-r--r--test/core/transport/chttp2/hpack_parser_test.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c
index 9ddceb8981..e2813df70c 100644
--- a/test/core/transport/chttp2/hpack_parser_test.c
+++ b/test/core/transport/chttp2/hpack_parser_test.c
@@ -36,32 +36,32 @@
#include <stdarg.h>
#include <grpc/grpc.h>
+#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/slice.h>
#include "test/core/util/parse_hexstring.h"
#include "test/core/util/slice_splitter.h"
#include "test/core/util/test_config.h"
typedef struct { va_list args; } test_checker;
-static void onhdr(void *ud, grpc_mdelem *md) {
+static void onhdr(grpc_exec_ctx *exec_ctx, void *ud, grpc_mdelem *md) {
const char *ekey, *evalue;
test_checker *chk = ud;
ekey = va_arg(chk->args, char *);
GPR_ASSERT(ekey);
evalue = va_arg(chk->args, char *);
GPR_ASSERT(evalue);
- GPR_ASSERT(gpr_slice_str_cmp(md->key->slice, ekey) == 0);
- GPR_ASSERT(gpr_slice_str_cmp(md->value->slice, evalue) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md->key->slice, ekey) == 0);
+ GPR_ASSERT(grpc_slice_str_cmp(md->value->slice, evalue) == 0);
GRPC_MDELEM_UNREF(md);
}
static void test_vector(grpc_chttp2_hpack_parser *parser,
grpc_slice_split_mode mode, const char *hexstring,
... /* char *key, char *value */) {
- gpr_slice input = parse_hexstring(hexstring);
- gpr_slice *slices;
+ grpc_slice input = parse_hexstring(hexstring);
+ grpc_slice *slices;
size_t nslices;
size_t i;
test_checker chk;
@@ -72,16 +72,18 @@ static void test_vector(grpc_chttp2_hpack_parser *parser,
parser->on_header_user_data = &chk;
grpc_split_slices(mode, &input, 1, &slices, &nslices);
- gpr_slice_unref(input);
+ grpc_slice_unref(input);
for (i = 0; i < nslices; i++) {
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
GPR_ASSERT(grpc_chttp2_hpack_parser_parse(
- parser, GPR_SLICE_START_PTR(slices[i]),
- GPR_SLICE_END_PTR(slices[i])) == GRPC_ERROR_NONE);
+ &exec_ctx, parser, GRPC_SLICE_START_PTR(slices[i]),
+ GRPC_SLICE_END_PTR(slices[i])) == GRPC_ERROR_NONE);
+ grpc_exec_ctx_finish(&exec_ctx);
}
for (i = 0; i < nslices; i++) {
- gpr_slice_unref(slices[i]);
+ grpc_slice_unref(slices[i]);
}
gpr_free(slices);