Fix the builder tests

This commit is contained in:
Johan Dahlin 2009-12-10 12:04:14 -02:00
parent 53ab5c0b63
commit 6879032113

View File

@ -1008,7 +1008,8 @@ test_children (void)
button = gtk_builder_get_object (builder, "button1");
g_assert (button != NULL);
g_assert (GTK_IS_BUTTON (button));
g_assert (strcmp (GTK_WIDGET (GTK_WIDGET (button)->parent)->name, "window1") == 0);
g_assert (GTK_WIDGET(button)->parent != NULL);
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_WIDGET (button)->parent)), "window1") == 0);
gtk_widget_destroy (GTK_WIDGET (window));
g_object_unref (builder);
@ -1024,10 +1025,9 @@ test_children (void)
vbox = gtk_builder_get_object (builder, "dialog1-vbox");
g_assert (vbox != NULL);
g_assert (GTK_IS_VBOX (vbox));
g_assert (GTK_WIDGET (vbox)->parent != NULL);
g_assert (strcmp (GTK_WIDGET (GTK_WIDGET (vbox)->parent)->name, "dialog1") == 0);
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_WIDGET (vbox)->parent)), "dialog1") == 0);
g_assert (GTK_CONTAINER (vbox)->border_width == 10);
g_assert (strcmp (GTK_WIDGET (GTK_DIALOG (dialog)->vbox)->name, "dialog1-vbox") == 0);
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->vbox)), "dialog1-vbox") == 0);
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
g_assert (action_area != NULL);
@ -1035,8 +1035,8 @@ test_children (void)
g_assert (GTK_WIDGET (action_area)->parent != NULL);
g_assert (GTK_CONTAINER (action_area)->border_width == 20);
g_assert (GTK_DIALOG (dialog)->action_area != NULL);
g_assert (GTK_WIDGET (GTK_DIALOG (dialog)->action_area)->name != NULL);
g_assert (strcmp (GTK_WIDGET (GTK_DIALOG (dialog)->action_area)->name, "dialog1-action_area") == 0);
g_assert (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->action_area)) != NULL);
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->action_area)), "dialog1-action_area") == 0);
gtk_widget_destroy (GTK_WIDGET (dialog));
g_object_unref (builder);
}