mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 02:30:08 +01:00
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);
^~~~~~~~~~~~~~~~
This commit is contained in:
parent
87edaa2a42
commit
4c3e69f9e9
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue