mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
tests: Add additional keyfile assertions
These slightly improve the tests but, more importantly, squash a scan-build warning about assigning to a variable which is never subsequently used: ``` ../../../glib/tests/keyfile.c:1150:3: warning: Value stored to 'value' is never read value = g_key_file_get_string (keyfile, "a", "key=", &error); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../glib/tests/keyfile.c:1159:3: warning: Value stored to 'value' is never read value = g_key_file_get_string (keyfile, "a", "key[", &error); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../glib/tests/keyfile.c:1176:3: warning: Value stored to 'value' is never read value = g_key_file_get_string (keyfile, "a", " key", &error); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 warnings generated. ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
0544efcbb4
commit
e9c4e19950
@ -1151,6 +1151,7 @@ test_key_names (void)
|
||||
check_error (&error,
|
||||
G_KEY_FILE_ERROR,
|
||||
G_KEY_FILE_ERROR_KEY_NOT_FOUND);
|
||||
g_assert_null (value);
|
||||
g_key_file_free (keyfile);
|
||||
|
||||
keyfile = g_key_file_new ();
|
||||
@ -1160,6 +1161,7 @@ test_key_names (void)
|
||||
check_error (&error,
|
||||
G_KEY_FILE_ERROR,
|
||||
G_KEY_FILE_ERROR_KEY_NOT_FOUND);
|
||||
g_assert_null (value);
|
||||
g_key_file_free (keyfile);
|
||||
|
||||
keyfile = g_key_file_new ();
|
||||
@ -1177,6 +1179,7 @@ test_key_names (void)
|
||||
check_error (&error,
|
||||
G_KEY_FILE_ERROR,
|
||||
G_KEY_FILE_ERROR_KEY_NOT_FOUND);
|
||||
g_assert_null (value);
|
||||
g_key_file_free (keyfile);
|
||||
|
||||
keyfile = g_key_file_new ();
|
||||
|
Loading…
Reference in New Issue
Block a user