Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2007-05-22 08:50:11 (GMT)
committer Benjamin Berg <benjamin@sipsolutions.net>2007-05-22 08:50:11 (GMT)
commit74daa0e94513ce2e96f51706eddee7ac376b5e75 (patch)
treee4ea1120f89608e8dbcbc3c4bac21cef6285d5cf /test
parent43c64fc6958d72f2e86c2fadc0bffc1564e9f862 (diff)
Small improvements and fixes to the testing code.
Diffstat (limited to 'test')
-rw-r--r--test/gtkrcs/sugar1
-rwxr-xr-xtest/torture2
-rw-r--r--test/torturetest.c18
3 files changed, 18 insertions, 3 deletions
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 ())