aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/invalid_call_argument_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/end2end/invalid_call_argument_test.c')
-rw-r--r--test/core/end2end/invalid_call_argument_test.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c
index 2b9904a244..d974d2c8ff 100644
--- a/test/core/end2end/invalid_call_argument_test.c
+++ b/test/core/end2end/invalid_call_argument_test.c
@@ -251,7 +251,8 @@ static void test_send_messages_at_the_same_time() {
gpr_log(GPR_INFO, "test_send_messages_at_the_same_time");
grpc_op *op;
- gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
+ grpc_slice request_payload_slice =
+ grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
prepare_test(1);
@@ -572,6 +573,29 @@ static void test_recv_close_on_server_twice() {
cleanup_test();
}
+static void test_invalid_initial_metadata_reserved_key() {
+ gpr_log(GPR_INFO, "test_invalid_initial_metadata_reserved_key");
+
+ grpc_metadata metadata;
+ metadata.key = ":start_with_colon";
+ metadata.value = "value";
+ metadata.value_length = 6;
+
+ grpc_op *op;
+ prepare_test(1);
+ op = g_state.ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 1;
+ op->data.send_initial_metadata.metadata = &metadata;
+ op->flags = 0;
+ op->reserved = NULL;
+ op++;
+ GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
+ grpc_call_start_batch(g_state.call, g_state.ops,
+ (size_t)(op - g_state.ops), tag(1), NULL));
+ cleanup_test();
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
@@ -594,6 +618,7 @@ int main(int argc, char **argv) {
test_send_server_status_twice();
test_recv_close_on_server_with_invalid_flags();
test_recv_close_on_server_twice();
+ test_invalid_initial_metadata_reserved_key();
grpc_shutdown();
return 0;