ext/libuv/test/test-ping-pong.c in libuv-0.12.2 vs ext/libuv/test/test-ping-pong.c in libuv-0.12.3
- old
+ new
@@ -153,12 +153,14 @@
static void tcp_pinger_v6_new(void) {
int r;
struct sockaddr_in6 server_addr;
pinger_t *pinger;
+
ASSERT(0 ==uv_ip6_addr("::1", TEST_PORT, &server_addr));
pinger = malloc(sizeof(*pinger));
+ ASSERT(pinger != NULL);
pinger->state = 0;
pinger->pongs = 0;
/* Try to connect to the server and do NUM_PINGS ping-pongs. */
r = uv_tcp_init(uv_default_loop(), &pinger->stream.tcp);
@@ -183,10 +185,11 @@
struct sockaddr_in server_addr;
pinger_t *pinger;
ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr));
pinger = malloc(sizeof(*pinger));
+ ASSERT(pinger != NULL);
pinger->state = 0;
pinger->pongs = 0;
/* Try to connect to the server and do NUM_PINGS ping-pongs. */
r = uv_tcp_init(uv_default_loop(), &pinger->stream.tcp);
@@ -209,9 +212,10 @@
static void pipe_pinger_new(void) {
int r;
pinger_t *pinger;
pinger = (pinger_t*)malloc(sizeof(*pinger));
+ ASSERT(pinger != NULL);
pinger->state = 0;
pinger->pongs = 0;
/* Try to connect to the server and do NUM_PINGS ping-pongs. */
r = uv_pipe_init(uv_default_loop(), &pinger->stream.pipe, 0);