diff options
author | Johan Dahlin <johan@src.gnome.org> | 2007-06-27 01:27:18 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2007-06-27 01:27:18 +0000 |
commit | 610331684f696959f927fcda459e47207a068760 (patch) | |
tree | a7a13be8433f6c3c178fbab4ffb188eaadf48e13 /tests | |
parent | ae800a34fa31f83feca666c0684d867409df109f (diff) | |
download | gtk+-610331684f696959f927fcda459e47207a068760.tar.gz |
Add a test to check object properties
* tests/buildertest.c (test_object_properties):
Add a test to check object properties
svn path=/trunk/; revision=18253
Diffstat (limited to 'tests')
-rw-r--r-- | tests/buildertest.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/buildertest.c b/tests/buildertest.c index 3367bdcd1f..199ee376ad 100644 --- a/tests/buildertest.c +++ b/tests/buildertest.c @@ -761,6 +761,41 @@ gboolean test_construct_only_property (void) return TRUE; } +gboolean test_object_properties (void) +{ + GtkBuilder *builder; + const gchar buffer[] = + "<interface>" + " <object class=\"GtkWindow\" id=\"window1\">" + " <child>" + " <object class=\"GtkVBox\" id=\"vbox\">" + " <property name=\"border-width\">10</property>" + " <child>" + " <object class=\"GtkLabel\" id=\"label1\">" + " <property name=\"mnemonic-widget\">spinbutton1</property>" + " </object>" + " </child>" + " <child>" + " <object class=\"GtkSpinButton\" id=\"spinbutton1\"/>" + " </child>" + " </object>" + " </child>" + " </object>" + "</interface>"; + GObject *label, *spinbutton; + + builder = builder_new_from_string (buffer, -1, NULL); + label = gtk_builder_get_object (builder, "label1"); + g_return_val_if_fail (label != NULL, FALSE); + spinbutton = gtk_builder_get_object (builder, "spinbutton1"); + g_return_val_if_fail (spinbutton != NULL, FALSE); + g_return_val_if_fail (spinbutton == (GObject*)gtk_label_get_mnemonic_widget (GTK_LABEL (label)), FALSE); + + g_object_unref (builder); + + return TRUE; +} + gboolean test_children (void) { GtkBuilder * builder; @@ -1474,6 +1509,10 @@ main (int argc, char **argv) if (!test_child_properties ()) g_error ("test_child_properties failed"); + g_print ("Testing object properties\n"); + if (!test_object_properties ()) + g_error ("test_object_properties failed"); + g_print ("Testing notebook\n"); if (!test_notebook ()) g_error ("test_notebook failed"); |