aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/transport
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/transport')
-rw-r--r--test/core/transport/chttp2/hpack_parser_fuzzer_test.c2
-rw-r--r--test/core/transport/chttp2/hpack_parser_test.c3
-rw-r--r--test/core/transport/chttp2/hpack_table_test.c10
-rw-r--r--test/core/transport/connectivity_state_test.c16
4 files changed, 18 insertions, 13 deletions
diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c b/test/core/transport/chttp2/hpack_parser_fuzzer_test.c
index 1e3d2d39d8..b7f68e0dd4 100644
--- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c
+++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.c
@@ -53,7 +53,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_chttp2_hpack_parser parser;
grpc_chttp2_hpack_parser_init(&parser);
parser.on_header = onhdr;
- grpc_chttp2_hpack_parser_parse(&parser, data, data + size);
+ GRPC_ERROR_UNREF(grpc_chttp2_hpack_parser_parse(&parser, data, data + size));
grpc_chttp2_hpack_parser_destroy(&parser);
grpc_shutdown();
return 0;
diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c
index 51bf48dc09..9ddceb8981 100644
--- a/test/core/transport/chttp2/hpack_parser_test.c
+++ b/test/core/transport/chttp2/hpack_parser_test.c
@@ -76,7 +76,8 @@ static void test_vector(grpc_chttp2_hpack_parser *parser,
for (i = 0; i < nslices; i++) {
GPR_ASSERT(grpc_chttp2_hpack_parser_parse(
- parser, GPR_SLICE_START_PTR(slices[i]), GPR_SLICE_END_PTR(slices[i])));
+ parser, GPR_SLICE_START_PTR(slices[i]),
+ GPR_SLICE_END_PTR(slices[i])) == GRPC_ERROR_NONE);
}
for (i = 0; i < nslices; i++) {
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
index 90ee662c3d..75b0ef4629 100644
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ b/test/core/transport/chttp2/hpack_table_test.c
@@ -144,7 +144,7 @@ static void test_many_additions(void) {
gpr_asprintf(&key, "K:%d", i);
gpr_asprintf(&value, "VALUE:%d", i);
elem = grpc_mdelem_from_strings(key, value);
- GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem));
+ GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE);
GRPC_MDELEM_UNREF(elem);
assert_index(&tbl, 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY, key, value);
gpr_free(key);
@@ -181,13 +181,13 @@ static void test_find(void) {
grpc_chttp2_hptbl_init(&tbl);
elem = grpc_mdelem_from_strings("abc", "xyz");
- GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem));
+ GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE);
GRPC_MDELEM_UNREF(elem);
elem = grpc_mdelem_from_strings("abc", "123");
- GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem));
+ GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE);
GRPC_MDELEM_UNREF(elem);
elem = grpc_mdelem_from_strings("x", "1");
- GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem));
+ GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE);
GRPC_MDELEM_UNREF(elem);
r = find_simple(&tbl, "abc", "123");
@@ -238,7 +238,7 @@ static void test_find(void) {
for (i = 0; i < 10000; i++) {
int64_ttoa(i, buffer);
elem = grpc_mdelem_from_strings("test", buffer);
- GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem));
+ GPR_ASSERT(grpc_chttp2_hptbl_add(&tbl, elem) == GRPC_ERROR_NONE);
GRPC_MDELEM_UNREF(elem);
}
diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c
index 38dea01cc6..1050059eff 100644
--- a/test/core/transport/connectivity_state_test.c
+++ b/test/core/transport/connectivity_state_test.c
@@ -43,14 +43,15 @@
int g_counter;
-static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
- GPR_ASSERT(success);
+static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg,
+ grpc_error *error) {
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(arg == THE_ARG);
g_counter++;
}
-static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
- GPR_ASSERT(!success);
+static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
GPR_ASSERT(arg == THE_ARG);
g_counter++;
}
@@ -67,15 +68,18 @@ static void test_connectivity_state_name(void) {
0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_TRANSIENT_FAILURE),
"TRANSIENT_FAILURE"));
GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_SHUTDOWN),
- "FATAL_FAILURE"));
+ "SHUTDOWN"));
}
static void test_check(void) {
grpc_connectivity_state_tracker tracker;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_error *error;
gpr_log(GPR_DEBUG, "test_check");
grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
- GPR_ASSERT(grpc_connectivity_state_check(&tracker) == GRPC_CHANNEL_IDLE);
+ GPR_ASSERT(grpc_connectivity_state_check(&tracker, &error) ==
+ GRPC_CHANNEL_IDLE);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
grpc_connectivity_state_destroy(&exec_ctx, &tracker);
grpc_exec_ctx_finish(&exec_ctx);
}