mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
tests: Fix compiler warning
Use `const gchar * const` to define a const array of const strings, and initialize the array when declaring it. https://bugzilla.gnome.org/show_bug.cgi?id=751672
This commit is contained in:
parent
b25fa8feed
commit
475445e6e0
@ -508,7 +508,11 @@ test_string (void)
|
||||
GKeyFile *keyfile;
|
||||
GError *error = NULL;
|
||||
gchar *value;
|
||||
const gchar const *list[3];
|
||||
const gchar * const list[3] = {
|
||||
"one",
|
||||
"two;andahalf",
|
||||
"3",
|
||||
};
|
||||
const gchar *data =
|
||||
"[valid]\n"
|
||||
"key1=\\s\\n\\t\\r\\\\\n"
|
||||
@ -544,9 +548,6 @@ test_string (void)
|
||||
g_key_file_set_string (keyfile, "inserted", "key4", "new\nline");
|
||||
g_key_file_set_string (keyfile, "inserted", "key5", "carriage\rreturn");
|
||||
g_key_file_set_string (keyfile, "inserted", "key6", "slash\\yay!");
|
||||
list[0] = "one";
|
||||
list[1] = "two;andahalf";
|
||||
list[2] = "3";
|
||||
g_key_file_set_string_list (keyfile, "inserted", "key7", list, 3);
|
||||
|
||||
check_string_value (keyfile, "inserted", "key1", "simple");
|
||||
|
Loading…
Reference in New Issue
Block a user