From ef66b99eed471fdf21da2edbf9ffcc0fae67f118 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 10 Jun 2020 19:35:36 +0200 Subject: [PATCH] libnm/tests: assert for valid test input for _test_verify_options_bridge() --- libnm-core/tests/test-setting.c | 8 +++++--- 1 file 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;