mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 09:40:11 +01:00
settings/ifupdown/tests: avoid asserting on an array
char[] is not a char *; it can not go NULL.
test-ifupdown.c:147:27: error: address of array 'n->name' will always evaluate
to 'true' [-Werror,-Wpointer-bool-conversion]
g_assert (b->name && n->name);
test-ifupdown.c:156:27: error: address of array 'm->key' will always evaluate
to 'true' [-Werror,-Wpointer-bool-conversion]
g_assert (k->key && m->key);
(cherry picked from commit b64ae759ad)
This commit is contained in:
parent
e9a8adce70
commit
2ffcdb8efa
1 changed files with 2 additions and 2 deletions
|
|
@ -144,7 +144,7 @@ compare_expected_to_ifparser (if_parser *parser, Expected *e)
|
|||
|
||||
g_assert (b->type && n->type);
|
||||
g_assert_cmpstr (b->type, ==, n->type);
|
||||
g_assert (b->name && n->name);
|
||||
g_assert (b->name);
|
||||
g_assert_cmpstr (b->name, ==, n->name);
|
||||
|
||||
g_assert_cmpint (g_slist_length (b->keys), ==, ifparser_get_num_info (n));
|
||||
|
|
@ -153,7 +153,7 @@ compare_expected_to_ifparser (if_parser *parser, Expected *e)
|
|||
c_list_for_each_entry (m, &n->data_lst_head, data_lst) {
|
||||
ExpectedKey *k = kiter->data;
|
||||
|
||||
g_assert (k->key && m->key);
|
||||
g_assert (k->key);
|
||||
g_assert_cmpstr (k->key, ==, m->key);
|
||||
g_assert (k->data && m->data);
|
||||
g_assert_cmpstr (k->data, ==, m->data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue