diff options
author | apolcyn <apolcyn@google.com> | 2017-07-31 17:10:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-31 17:10:41 -0700 |
commit | b667f12cef5efd2b379efd7a0bbddd2acd59ad0c (patch) | |
tree | c0674f12f583783e8b60a15f31f6cb921af0b8b6 /test | |
parent | 3188ae5cafda7f86904f1940703fd5ee9659fb3b (diff) | |
parent | 088e85ca647ffecc06ca961933d7532ed75d1b8d (diff) |
Merge pull request #11979 from apolcyn/ensure_cancel_with_status_memory_api
Add comment and test for API of a parameter to grpc_call_cancel_with_status
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/tests/cancel_with_status.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index d659d1173a..fd26fd122e 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -25,6 +25,7 @@ #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> +#include <grpc/support/string_util.h> #include <grpc/support/time.h> #include <grpc/support/useful.h> #include "src/core/lib/support/string.h" @@ -138,7 +139,12 @@ static void simple_request_body(grpc_end2end_test_config config, error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL); GPR_ASSERT(GRPC_CALL_OK == error); - grpc_call_cancel_with_status(c, GRPC_STATUS_UNIMPLEMENTED, "xyz", NULL); + char *dynamic_string = gpr_strdup("xyz"); + grpc_call_cancel_with_status(c, GRPC_STATUS_UNIMPLEMENTED, + (const char *)dynamic_string, NULL); + // The API of \a description allows for it to be a dynamic/non-const + // string, test this guarantee. + gpr_free(dynamic_string); CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); |