diff --git a/test/test-shutdown-eof.c b/test/test-shutdown-eof.c index adda9f15..ebc94f4d 100644 --- a/test/test-shutdown-eof.c +++ b/test/test-shutdown-eof.c @@ -142,6 +142,7 @@ void timer_cb(uv_handle_t* handle, int status) { * calling uv_close when the client receives the EOF from echo-server. */ TEST_IMPL(shutdown_eof) { + struct sockaddr_in server_addr; int r; uv_init(); @@ -152,7 +153,7 @@ TEST_IMPL(shutdown_eof) { uv_timer_init(&timer, timer_close_cb, NULL); uv_timer_start(&timer, timer_cb, 100, 0); - struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT); + server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT); r = uv_tcp_init(&tcp, tcp_close_cb, NULL); ASSERT(!r); diff --git a/test/test-tcp-writealot.c b/test/test-tcp-writealot.c index 26a079cb..f31057d7 100644 --- a/test/test-tcp-writealot.c +++ b/test/test-tcp-writealot.c @@ -64,10 +64,12 @@ static void close_cb(uv_handle_t* handle, int status) { static void shutdown_cb(uv_req_t* req, int status) { + uv_tcp_t* tcp; + ASSERT(req); ASSERT(status == 0); - uv_tcp_t* tcp = (uv_tcp_t*)(req->handle); + tcp = (uv_tcp_t*)(req->handle); /* The write buffer should be empty by now. */ ASSERT(tcp->write_queue_size == 0);