diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-01 17:04:17 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-01 17:04:17 -0700 |
commit | 8e0b08a33d819d0a2523ec439d545296e1ad2086 (patch) | |
tree | 5613a61a51db9c5a5f7ecc5fec8cfd0eb0b2c436 /test/core/iomgr | |
parent | 3c1331f920569ba3a182e13321db26796d6e920e (diff) | |
parent | fa275a97b968060383fe27c26b1d85f08d9582f9 (diff) |
Merge branch 'count-the-things' into we-dont-need-no-backup
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/fd_posix_test.c | 8 | ||||
-rw-r--r-- | test/core/iomgr/tcp_posix_test.c | 18 |
2 files changed, 16 insertions, 10 deletions
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index 207862bd8d..4faa888ca5 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -206,7 +206,7 @@ static void listen_cb(void *arg, /*=sv_arg*/ fcntl(fd, F_SETFL, flags | O_NONBLOCK); se = gpr_malloc(sizeof(*se)); se->sv = sv; - se->em_fd = grpc_fd_create(fd); + se->em_fd = grpc_fd_create(fd, "listener"); grpc_pollset_add_fd(&g_pollset, se->em_fd); se->session_read_closure.cb = session_read_cb; se->session_read_closure.cb_arg = se; @@ -235,7 +235,7 @@ static int server_start(server *sv) { port = ntohs(sin.sin_port); GPR_ASSERT(listen(fd, MAX_NUM_FD) == 0); - sv->em_fd = grpc_fd_create(fd); + sv->em_fd = grpc_fd_create(fd, "server"); grpc_pollset_add_fd(&g_pollset, sv->em_fd); /* Register to be interested in reading from listen_fd. */ sv->listen_closure.cb = listen_cb; @@ -346,7 +346,7 @@ static void client_start(client *cl, int port) { } } - cl->em_fd = grpc_fd_create(fd); + cl->em_fd = grpc_fd_create(fd, "client"); grpc_pollset_add_fd(&g_pollset, cl->em_fd); client_session_write(cl, 1); @@ -436,7 +436,7 @@ static void test_grpc_fd_change(void) { flags = fcntl(sv[1], F_GETFL, 0); GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0); - em_fd = grpc_fd_create(sv[0]); + em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change"); grpc_pollset_add_fd(&g_pollset, em_fd); /* Register the first callback, then make its FD readable */ diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 04aed132f4..23bcd19fef 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -172,7 +172,7 @@ static void read_test(ssize_t num_bytes, ssize_t slice_size) { create_sockets(sv); - ep = grpc_tcp_create(grpc_fd_create(sv[1]), slice_size); + ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), slice_size); grpc_endpoint_add_to_pollset(ep, &g_pollset); written_bytes = fill_socket_partial(sv[0], num_bytes); @@ -207,8 +207,9 @@ static void large_read_test(ssize_t slice_size) { create_sockets(sv); - ep = grpc_tcp_create(grpc_fd_create(sv[1]), slice_size); + ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test"), slice_size); grpc_endpoint_add_to_pollset(ep, &g_pollset); + written_bytes = fill_socket(sv[0]); gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); @@ -338,7 +339,8 @@ static void write_test(ssize_t num_bytes, ssize_t slice_size) { create_sockets(sv); - ep = grpc_tcp_create(grpc_fd_create(sv[1]), GRPC_TCP_DEFAULT_READ_SLICE_SIZE); + ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test"), + GRPC_TCP_DEFAULT_READ_SLICE_SIZE); grpc_endpoint_add_to_pollset(ep, &g_pollset); state.ep = ep; @@ -391,8 +393,10 @@ static void write_error_test(ssize_t num_bytes, ssize_t slice_size) { create_sockets(sv); - ep = grpc_tcp_create(grpc_fd_create(sv[1]), GRPC_TCP_DEFAULT_READ_SLICE_SIZE); + ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_error_test"), + GRPC_TCP_DEFAULT_READ_SLICE_SIZE); grpc_endpoint_add_to_pollset(ep, &g_pollset); + close(sv[0]); state.ep = ep; @@ -455,8 +459,10 @@ static grpc_endpoint_test_fixture create_fixture_tcp_socketpair( grpc_endpoint_test_fixture f; create_sockets(sv); - f.client_ep = grpc_tcp_create(grpc_fd_create(sv[0]), slice_size); - f.server_ep = grpc_tcp_create(grpc_fd_create(sv[1]), slice_size); + f.client_ep = + grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client"), slice_size); + f.server_ep = + grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server"), slice_size); grpc_endpoint_add_to_pollset(f.client_ep, &g_pollset); grpc_endpoint_add_to_pollset(f.server_ep, &g_pollset); |