diff --git a/test/echo-server.c b/test/echo-server.c index e5201b9f..2c6ca0d7 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -119,8 +119,9 @@ static void after_read(uv_stream_t* handle, } wr = (write_req_t*) malloc(sizeof *wr); - + ASSERT(wr != NULL); wr->buf = uv_buf_init(buf->base, nread); + if (uv_write(&wr->req, handle, &wr->buf, 1, after_write)) { FATAL("uv_write failed"); } diff --git a/test/test-getaddrinfo.c b/test/test-getaddrinfo.c index bca2a6bd..32ca91ef 100644 --- a/test/test-getaddrinfo.c +++ b/test/test-getaddrinfo.c @@ -126,6 +126,7 @@ TEST_IMPL(getaddrinfo_concurrent) { callback_counts[i] = 0; data = (int*)malloc(sizeof(int)); + ASSERT(data != NULL); *data = i; getaddrinfo_handles[i].data = data; diff --git a/test/test-ping-pong.c b/test/test-ping-pong.c index c579fdd6..81941ab8 100644 --- a/test/test-ping-pong.c +++ b/test/test-ping-pong.c @@ -155,8 +155,10 @@ static void tcp_pinger_v6_new(void) { 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; @@ -185,6 +187,7 @@ static void tcp_pinger_new(void) { 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; @@ -211,6 +214,7 @@ static void pipe_pinger_new(void) { pinger_t *pinger; pinger = (pinger_t*)malloc(sizeof(*pinger)); + ASSERT(pinger != NULL); pinger->state = 0; pinger->pongs = 0; diff --git a/test/test-spawn.c b/test/test-spawn.c index 7eded879..0f4389f1 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -837,6 +837,7 @@ TEST_IMPL(argument_escaping) { WCHAR* non_verbatim_output; test_output = calloc(count, sizeof(WCHAR*)); + ASSERT(test_output != NULL); for (i = 0; i < count; ++i) { test_output[i] = calloc(2 * (wcslen(test_str[i]) + 2), sizeof(WCHAR)); quote_cmd_arg(test_str[i], test_output[i]); @@ -845,6 +846,7 @@ TEST_IMPL(argument_escaping) { total_size += wcslen(test_output[i]) + 1; } command_line = calloc(total_size + 1, sizeof(WCHAR)); + ASSERT(command_line != NULL); for (i = 0; i < count; ++i) { wcscat(command_line, test_output[i]); wcscat(command_line, L" "); diff --git a/test/test-threadpool-cancel.c b/test/test-threadpool-cancel.c index 3f516437..a349876b 100644 --- a/test/test-threadpool-cancel.c +++ b/test/test-threadpool-cancel.c @@ -86,7 +86,9 @@ static void saturate_threadpool(void) { * the thread pool is saturated. As with any timing dependent test, * this is obviously not ideal. */ - if (uv_cond_timedwait(&signal_cond, &signal_mutex, (uint64_t)(350 * 1e6))) { + if (uv_cond_timedwait(&signal_cond, + &signal_mutex, + (uint64_t) (350 * 1e6))) { ASSERT(0 == uv_cancel((uv_req_t*) req)); break; }