mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
Add a test for grup names of length 1.
2005-09-14 Matthias Clasen <mclasen@redhat.com> * tests/keyfile-test.c: Add a test for grup names of length 1. * glib/gkeyfile.c (g_key_file_line_is_group): Accept group names of length 1. (#316309)
This commit is contained in:
parent
047558bc21
commit
81719cc164
@ -1,3 +1,10 @@
|
||||
2005-09-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* tests/keyfile-test.c: Add a test for grup names of length 1.
|
||||
|
||||
* glib/gkeyfile.c (g_key_file_line_is_group): Accept group names
|
||||
of length 1. (#316309)
|
||||
|
||||
2005-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/gmarkup.c (g_markup_escape_text): Clarify docs.
|
||||
|
@ -1,3 +1,10 @@
|
||||
2005-09-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* tests/keyfile-test.c: Add a test for grup names of length 1.
|
||||
|
||||
* glib/gkeyfile.c (g_key_file_line_is_group): Accept group names
|
||||
of length 1. (#316309)
|
||||
|
||||
2005-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/gmarkup.c (g_markup_escape_text): Clarify docs.
|
||||
|
@ -1,3 +1,10 @@
|
||||
2005-09-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* tests/keyfile-test.c: Add a test for grup names of length 1.
|
||||
|
||||
* glib/gkeyfile.c (g_key_file_line_is_group): Accept group names
|
||||
of length 1. (#316309)
|
||||
|
||||
2005-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/gmarkup.c (g_markup_escape_text): Clarify docs.
|
||||
|
@ -2989,14 +2989,9 @@ g_key_file_line_is_group (const gchar *line)
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
|
||||
if (!*p)
|
||||
return FALSE;
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
|
||||
/* Group name must be non-empty
|
||||
*/
|
||||
if (*p == ']')
|
||||
if (!*p || *p == ']')
|
||||
return FALSE;
|
||||
|
||||
while (*p && *p != ']')
|
||||
|
@ -755,6 +755,25 @@ test_lists (void)
|
||||
g_key_file_free (keyfile);
|
||||
}
|
||||
|
||||
static void
|
||||
test_groups (void)
|
||||
{
|
||||
GKeyFile *keyfile;
|
||||
|
||||
const gchar *data =
|
||||
"[1]\n"
|
||||
"key1=123\n"
|
||||
"[2]\n"
|
||||
"key2=123\n";
|
||||
|
||||
keyfile = load_data (data, 0);
|
||||
|
||||
check_string_value (keyfile, "1", "key1", "123");
|
||||
check_string_value (keyfile, "2", "key2", "123");
|
||||
|
||||
g_key_file_free (keyfile);
|
||||
}
|
||||
|
||||
/* http://bugzilla.gnome.org/show_bug.cgi?id=165887 */
|
||||
static void
|
||||
test_group_remove (void)
|
||||
@ -874,6 +893,7 @@ main (int argc, char *argv[])
|
||||
test_lists ();
|
||||
test_group_remove ();
|
||||
test_key_remove ();
|
||||
test_groups ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user