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:
Emmanuele Bassi 2015-06-29 20:14:40 +01:00
parent b25fa8feed
commit 475445e6e0

View File

@ -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");