[gnumeric] [test] Fix test-pango harness



commit 1f48fb7fae64c58326e14b8e71b499088b0f7d1d
Author: Jody Goldberg <jody gnome org>
Date:   Tue Jan 12 09:07:56 2010 -0500

    [test] Fix test-pango harness

 ChangeLog        |    5 +++++
 NEWS             |    1 +
 src/test-pango.c |   15 ++++++++++++++-
 3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c625f4a..aa6a60d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-12  Jody Goldberg <jody gnome org>
+
+	* src/test-pango.c (cb_kill_wbcg) : new.
+	(cb_exercise_pango) : setup shutdown mechanism.
+
 2010-01-11  Morten Welinder  <terra gnome org>
 
 	* schemas/gnumeric-dialogs.schemas.in: Fix default for terminator.
diff --git a/NEWS b/NEWS
index d6addb2..6223446 100644
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,7 @@ Jean
 Jody:
 	* Fix use of ExprEntry from glade on win32.
 	* More win32 build fixes (xslt for libgda & poppler).
+	* Fix pango test harness.
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.17
diff --git a/src/test-pango.c b/src/test-pango.c
index 5db3947..599453f 100644
--- a/src/test-pango.c
+++ b/src/test-pango.c
@@ -25,6 +25,14 @@
 #define STEP_SIZE	40
 
 static gboolean
+cb_kill_wbcg (WBCGtk *wbcg)
+{
+	gboolean still_open = wbc_gtk_close (wbcg);
+	g_assert (!still_open);
+	return FALSE;
+}
+
+static gboolean
 cb_exercise_pango (gpointer data)
 {
 	static int state = 0;
@@ -47,7 +55,10 @@ cb_exercise_pango (gpointer data)
 		g_object_unref (wb_control_get_workbook (wbc));
 	}
 
-	return state++ < TEST_STEPS*2;
+	if (state++ < TEST_STEPS*2)
+	    return 1;
+	g_idle_add ((GSourceFunc)cb_kill_wbcg, wbc);
+	return 0;
 }
 
 int
@@ -74,6 +85,8 @@ main (int argc, char const **argv)
 
 	g_idle_add (cb_exercise_pango, wbc);
 
+	gtk_main ();
+
 	gnm_shutdown ();
 	gnm_pre_parse_shutdown ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]