From 4c3e69f9e91fdecbbcc657e03bec7d7fc086cd1a Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 12 Feb 2016 09:05:27 +0100 Subject: [PATCH] test: use g_assert_not_reached () instead of asserting FALSE It's declared as never returning, making do a better at understanding control flow. Otherwise it makes a poor guess: In file included from test-crypto.c:37: ../../shared/nm-test-utils.h:1344:3: error: variable 'family' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] g_assert (FALSE); ^~~~~~~~~~~~~~~~ --- shared/nm-test-utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/nm-test-utils.h b/shared/nm-test-utils.h index fcae76122..66cacb785 100644 --- a/shared/nm-test-utils.h +++ b/shared/nm-test-utils.h @@ -1341,7 +1341,7 @@ nmtst_setting_ip_config_add_address (NMSettingIPConfig *s_ip, else if (nm_utils_ipaddr_valid (AF_INET6, address)) family = AF_INET6; else - g_assert (FALSE); + g_assert_not_reached (); addr = nm_ip_address_new (family, address, prefix, NULL); g_assert (addr); @@ -1366,7 +1366,7 @@ nmtst_setting_ip_config_add_route (NMSettingIPConfig *s_ip, else if (nm_utils_ipaddr_valid (AF_INET6, dest)) family = AF_INET6; else - g_assert (FALSE); + g_assert_not_reached (); route = nm_ip_route_new (family, dest, prefix, next_hop, metric, NULL); g_assert (route);