mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-10 11:14:05 +02: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:
committed by
Matthias Clasen
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>
|
2005-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gmarkup.c (g_markup_escape_text): Clarify docs.
|
* 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>
|
2005-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gmarkup.c (g_markup_escape_text): Clarify docs.
|
* 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>
|
2005-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gmarkup.c (g_markup_escape_text): Clarify docs.
|
* 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);
|
p = g_utf8_next_char (p);
|
||||||
|
|
||||||
if (!*p)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
p = g_utf8_next_char (p);
|
|
||||||
|
|
||||||
/* Group name must be non-empty
|
/* Group name must be non-empty
|
||||||
*/
|
*/
|
||||||
if (*p == ']')
|
if (!*p || *p == ']')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while (*p && *p != ']')
|
while (*p && *p != ']')
|
||||||
|
@@ -755,6 +755,25 @@ test_lists (void)
|
|||||||
g_key_file_free (keyfile);
|
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 */
|
/* http://bugzilla.gnome.org/show_bug.cgi?id=165887 */
|
||||||
static void
|
static void
|
||||||
test_group_remove (void)
|
test_group_remove (void)
|
||||||
@@ -874,6 +893,7 @@ main (int argc, char *argv[])
|
|||||||
test_lists ();
|
test_lists ();
|
||||||
test_group_remove ();
|
test_group_remove ();
|
||||||
test_key_remove ();
|
test_key_remove ();
|
||||||
|
test_groups ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user