aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests/call_creds.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-01-20 15:42:47 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-01-20 15:42:47 -0800
commitda9de8988b343a6c87a9c3ba6b4594020943b0a7 (patch)
treeeee5260113f8aef5919422558900f582753a464d /test/core/end2end/tests/call_creds.c
parent1d77059e4b1ec17c704acfc876e321cc33bff99d (diff)
parent4a4a3a446871da594ef4662751e707789f2829c2 (diff)
Merge github.com:grpc/grpc into maxmsgsz
Diffstat (limited to 'test/core/end2end/tests/call_creds.c')
-rw-r--r--test/core/end2end/tests/call_creds.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c
index 606938fff6..ebc854606b 100644
--- a/test/core/end2end/tests/call_creds.c
+++ b/test/core/end2end/tests/call_creds.c
@@ -156,8 +156,7 @@ static void request_response_with_payload_and_call_creds(
grpc_call_details call_details;
grpc_status_code status;
grpc_call_error error;
- char *details = NULL;
- size_t details_capacity = 0;
+ grpc_slice details;
int was_cancelled = 2;
grpc_call_credentials *creds = NULL;
grpc_auth_context *s_auth_context = NULL;
@@ -167,8 +166,9 @@ static void request_response_with_payload_and_call_creds(
cqv = cq_verifier_create(f.cq);
c = grpc_channel_create_call(
- f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo",
- get_host_override_string("foo.test.google.fr:1234", config), deadline,
+ f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+ grpc_slice_from_static_string("/foo"),
+ get_host_override_slice("foo.test.google.fr:1234", config), deadline,
NULL);
GPR_ASSERT(c);
creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
@@ -225,7 +225,6 @@ static void request_response_with_payload_and_call_creds(
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
- op->data.recv_status_on_client.status_details_capacity = &details_capacity;
op->flags = 0;
op->reserved = NULL;
op++;
@@ -284,7 +283,8 @@ static void request_response_with_payload_and_call_creds(
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
op->data.send_status_from_server.trailing_metadata_count = 0;
op->data.send_status_from_server.status = GRPC_STATUS_OK;
- op->data.send_status_from_server.status_details = "xyz";
+ grpc_slice status_details = grpc_slice_from_static_string("xyz");
+ op->data.send_status_from_server.status_details = &status_details;
op->flags = 0;
op->reserved = NULL;
op++;
@@ -296,8 +296,8 @@ static void request_response_with_payload_and_call_creds(
cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
- GPR_ASSERT(0 == strcmp(details, "xyz"));
- GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+ GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
validate_host_override_string("foo.test.google.fr:1234", call_details.host,
config);
GPR_ASSERT(was_cancelled == 0);
@@ -337,7 +337,7 @@ static void request_response_with_payload_and_call_creds(
break;
}
- gpr_free(details);
+ grpc_slice_unref(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
grpc_metadata_array_destroy(&request_metadata_recv);
@@ -391,8 +391,7 @@ static void test_request_with_server_rejecting_client_creds(
grpc_call_details call_details;
grpc_status_code status;
grpc_call_error error;
- char *details = NULL;
- size_t details_capacity = 0;
+ grpc_slice details;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
@@ -404,8 +403,9 @@ static void test_request_with_server_rejecting_client_creds(
cqv = cq_verifier_create(f.cq);
c = grpc_channel_create_call(
- f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo",
- get_host_override_string("foo.test.google.fr:1234", config), deadline,
+ f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+ grpc_slice_from_static_string("/foo"),
+ get_host_override_slice("foo.test.google.fr:1234", config), deadline,
NULL);
GPR_ASSERT(c);
@@ -425,7 +425,6 @@ static void test_request_with_server_rejecting_client_creds(
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
- op->data.recv_status_on_client.status_details_capacity = &details_capacity;
op->flags = 0;
op->reserved = NULL;
op++;
@@ -468,7 +467,7 @@ static void test_request_with_server_rejecting_client_creds(
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload_recv);
- gpr_free(details);
+ grpc_slice_unref(details);
grpc_call_destroy(c);