From 74daa0e94513ce2e96f51706eddee7ac376b5e75 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 22 May 2007 08:50:11 +0000 Subject: Small improvements and fixes to the testing code. --- (limited to 'test') diff --git a/test/gtkrcs/sugar b/test/gtkrcs/sugar index 60365d0..e156f4a 100644 --- a/test/gtkrcs/sugar +++ b/test/gtkrcs/sugar @@ -1,6 +1,7 @@ style "default" { + GtkWidget::interior-focus = 0 engine "sugar" { } } diff --git a/test/torture b/test/torture index 80be4d5..b4d6e95 100755 --- a/test/torture +++ b/test/torture @@ -39,7 +39,7 @@ if [ "$FAILED" != "0" ]; then echo "WARNING: The other tests will be run, but in case of failure SKIP instead of FAIL." echo "WARNING: This way 'make check' will not fail even with a broken GTK+." echo "WARNING:" - echo "WARNING: Currently it may also mean that there is just no X server to run the test on." + echo "WARNING: It may also mean that there is just no X server to run the test on." echo touch torture_buildin-failed exit 77 diff --git a/test/torturetest.c b/test/torturetest.c index 62b8764..694755f 100644 --- a/test/torturetest.c +++ b/test/torturetest.c @@ -539,7 +539,7 @@ get_attached_style (GtkStyle *fallback, GdkWindow *window, const gchar *path, GT style = gtk_rc_get_style_by_paths (settings, path, path, type); if (!style) - style = fallback; + style = g_object_ref (fallback); else g_object_ref (style); @@ -558,6 +558,18 @@ create_teststyles () styles[STYLE_COMBOBOXENTRY] = get_attached_style (window->style, window->window, "GtkWindow.GtkComboBoxEntry.GtkButton", GTK_TYPE_BUTTON); } +static void +destroy_teststyles () +{ + gint i; + + for (i = 0; i < STYLE_COUNT; i++) { + gtk_style_detach (styles[i]); + g_object_unref (styles[i]); + styles[i] = NULL; + } +} + int main (int argc, char **argv) { @@ -591,10 +603,12 @@ main (int argc, char **argv) for (i = 0; i < G_N_ELEMENTS (tests); i++) run_test (i); + + destroy_teststyles (); /* remove the rc file again. This should cause an unload of the engine * and destruction of all engine objects. */ - gtk_rc_set_default_files (new_default_files); + gtk_rc_set_default_files (new_default_files); gtk_rc_reparse_all_for_settings (settings, TRUE); while (gdk_events_pending ()) -- cgit v0.9.1