diff options
author | Craig Tiller <ctiller@google.com> | 2016-01-08 08:00:16 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-01-08 08:00:16 -0800 |
commit | fdd02259b5aa23dc4dc4a31128b6faaf43904192 (patch) | |
tree | feec1a035fbca4b54f625afa4487a62678f17bb1 /test | |
parent | 5bf8e61ff7d31744fd2e77c73d94b80eff5bc1ad (diff) | |
parent | a7ed54cba76c9c2cf39876e0a2b52fb78c15adb0 (diff) |
Merge pull request #4627 from daniel-j-born/tcp_fd
Expose the fd in grpc_fd and grpc_tcp.
Diffstat (limited to 'test')
-rw-r--r-- | test/core/iomgr/tcp_posix_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 0aeec27654..b59ba1014b 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -389,7 +389,8 @@ void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, int success) { grpc_pollset_kick(&g_pollset, NULL); } -/* Do a read_test, then release fd and try to read/write again. */ +/* Do a read_test, then release fd and try to read/write again. Verify that + grpc_tcp_fd() is available before the fd is released. */ static void release_fd_test(size_t num_bytes, size_t slice_size) { int sv[2]; grpc_endpoint *ep; @@ -408,6 +409,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { create_sockets(sv); ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), slice_size, "test"); + GPR_ASSERT(grpc_tcp_fd(ep) == sv[1] && sv[1] >= 0); grpc_endpoint_add_to_pollset(&exec_ctx, ep, &g_pollset); written_bytes = fill_socket_partial(sv[0], num_bytes); |