diff options
author | Thomas Haller <thaller@redhat.com> | 2020-06-10 19:35:36 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-06-11 18:35:42 +0200 |
commit | ef66b99eed471fdf21da2edbf9ffcc0fae67f118 (patch) | |
tree | be2d28c636ed30a00be0e11e4fb00e2a31b14af3 /libnm-core | |
parent | f9721385ce8d296b9ee26b02d25f69e1e374074f (diff) | |
download | NetworkManager-ef66b99eed471fdf21da2edbf9ffcc0fae67f118.tar.gz |
libnm/tests: assert for valid test input for _test_verify_options_bridge()
Diffstat (limited to 'libnm-core')
-rw-r--r-- | libnm-core/tests/test-setting.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c index b8587a7d7f..359c20c43c 100644 --- a/libnm-core/tests/test-setting.c +++ b/libnm-core/tests/test-setting.c @@ -2134,14 +2134,16 @@ _test_verify_options_bridge (gboolean expected_result, case G_TYPE_UINT: { guint uvalue; - uvalue = _nm_utils_ascii_str_to_uint64 (option_val, 10, 0, G_MAXUINT, 0); + uvalue = _nm_utils_ascii_str_to_uint64 (option_val, 10, 0, G_MAXUINT, -1); + g_assert (errno == 0); g_object_set (s_bridge, option_key, uvalue, NULL); } break; case G_TYPE_BOOLEAN: { - gboolean bvalue; + int bvalue; - bvalue = _nm_utils_ascii_str_to_bool (option_val, FALSE); + bvalue = _nm_utils_ascii_str_to_bool (option_val, -1); + g_assert (bvalue != -1); g_object_set (s_bridge, option_key, bvalue, NULL); } break; |