diff options
author | Thomas Haller <thaller@redhat.com> | 2019-04-18 09:45:35 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-04-18 09:47:36 +0200 |
commit | 1e8c08730fc92e4d6fc36b20e8189b42968d5008 (patch) | |
tree | 9eada351d868d014e95826db0a7e889eefcfa2cc | |
parent | 693252d049e76cc456f24425cc024b4a8ccd4e59 (diff) | |
download | NetworkManager-1e8c08730fc92e4d6fc36b20e8189b42968d5008.tar.gz |
libnm-core/tests: fix "-Werror=logical-not-parentheses" warning in _sock_addr_endpoint()
CC libnm-core/tests/libnm_core_tests_test_general-test-general.o
In file included from ../shared/nm-default.h:280:0,
from ../libnm-core/tests/test-general.c:24:
../libnm-core/tests/test-general.c: In function _sock_addr_endpoint:
../libnm-core/tests/test-general.c:5911:18: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
g_assert (!host == (port == -1));
^
../shared/nm-utils/nm-macros-internal.h:1793:7: note: in definition of macro __NM_G_BOOLEAN_EXPR_IMPL
if (expr) \
^
/usr/include/glib-2.0/glib/gmacros.h:376:43: note: in expansion of macro _G_BOOLEAN_EXPR
#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 1))
^
/usr/include/glib-2.0/glib/gtestutils.h:116:49: note: in expansion of macro G_LIKELY
if G_LIKELY (expr) ; else \
^
../libnm-core/tests/test-general.c:5911:2: note: in expansion of macro g_assert
g_assert (!host == (port == -1));
^
Fixes: 713e879d769f ('libnm: add NMSockAddrEndpoint API')
-rw-r--r-- | libnm-core/tests/test-general.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index dfaba1cac5..d3743e0ede 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -5908,7 +5908,7 @@ _sock_addr_endpoint (const char *endpoint, SockAddrUnion sockaddr = { }; g_assert (endpoint); - g_assert (!host == (port == -1)); + g_assert ((!host) == (port == -1)); g_assert (port >= -1 && port <= G_MAXUINT16); ep = nm_sock_addr_endpoint_new (endpoint); |