diff options
author | Paolo Borelli <pborelli@gnome.org> | 2009-08-14 00:08:09 +0200 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2009-08-14 15:56:44 +0200 |
commit | 6cfb23d185254ab1402c66508e02f6e7942b1a2c (patch) | |
tree | 59b5e793dba4ce340a228457c3e21ff81e261a06 /gtk/tests/builder.c | |
parent | bd0755753a02a0898961be757e2b8bc2d243688d (diff) | |
download | gtk+-6cfb23d185254ab1402c66508e02f6e7942b1a2c.tar.gz |
Fix duplicated id detection in gtkbuilder
Fix memory handling of duplicated id hashtable and add unit test
Diffstat (limited to 'gtk/tests/builder.c')
-rw-r--r-- | gtk/tests/builder.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c index f5a85ac4fa..2a653b5d79 100644 --- a/gtk/tests/builder.c +++ b/gtk/tests/builder.c @@ -116,6 +116,13 @@ test_parser (void) GTK_BUILDER_ERROR_INVALID_VALUE)); g_error_free (error); + error = NULL; + gtk_builder_add_from_string (builder, "<interface><object class=\"GtkButton\" id=\"a\"></object><object class=\"GtkButton\" id=\"a\"/></object></interface>", -1, &error); + g_assert (g_error_matches (error, + GTK_BUILDER_ERROR, + GTK_BUILDER_ERROR_DUPLICATE_ID)); + g_error_free (error); + g_object_unref (builder); } @@ -2172,7 +2179,7 @@ test_add_objects (void) " </object>" " <object class=\"GtkWindow\" id=\"window2\">" " <child>" - " <object class=\"GtkLabel\" id=\"label1\">" + " <object class=\"GtkLabel\" id=\"label3\">" " <property name=\"label\" translatable=\"no\">second label</property>" " </object>" " </child>" |