From 5f15f72ccacd5243b354b2cfc7d573389ac60340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 18 Nov 2015 22:13:11 +0100 Subject: [PATCH] test: fix -Wtautological-pointer-compare warnings ~~~~ test/test-get-loadavg.c:30:14: warning: comparison of array 'avg' not equal to a null pointer is always true [-Wtautological-pointer-compare] test/test-getnameinfo.c:76:18: warning: comparison of array 'req.host' not equal to a null pointer is always true [-Wtautological-pointer-compare] test/test-getnameinfo.c:77:18: warning: comparison of array 'req.service' not equal to a null pointer is always true [-Wtautological-pointer-compare] ~~~~ PR-URL: https://github.com/libuv/libuv/pull/622 Reviewed-By: Ben Noordhuis --- test/test-get-loadavg.c | 3 +-- test/test-getnameinfo.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/test-get-loadavg.c b/test/test-get-loadavg.c index 7465e18b9..4762e4757 100644 --- a/test/test-get-loadavg.c +++ b/test/test-get-loadavg.c @@ -24,10 +24,9 @@ TEST_IMPL(get_loadavg) { - double avg[3]; + double avg[3] = {-1, -1, -1}; uv_loadavg(avg); - ASSERT(avg != NULL); ASSERT(avg[0] >= 0); ASSERT(avg[1] >= 0); ASSERT(avg[2] >= 0); diff --git a/test/test-getnameinfo.c b/test/test-getnameinfo.c index ebe924669..b1391616d 100644 --- a/test/test-getnameinfo.c +++ b/test/test-getnameinfo.c @@ -73,8 +73,8 @@ TEST_IMPL(getnameinfo_basic_ip4_sync) { NULL, (const struct sockaddr*)&addr4, 0)); - ASSERT(req.host != NULL); - ASSERT(req.service != NULL); + ASSERT(req.host[0] != '\0'); + ASSERT(req.service[0] != '\0'); MAKE_VALGRIND_HAPPY(); return 0;