From a216db21dd72d491edaca5c7746d3a2a23b17dd1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 Jan 2010 16:39:27 -0600 Subject: Adding a kill function and letting the test fail over it. --- tests/test-libappindicator-fallback-item.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-libappindicator-fallback-item.c b/tests/test-libappindicator-fallback-item.c index 02724fe..83dc876 100644 --- a/tests/test-libappindicator-fallback-item.c +++ b/tests/test-libappindicator-fallback-item.c @@ -49,6 +49,7 @@ test_libappindicator_fallback_item_init (TestLibappindicatorFallbackItem *self) } GMainLoop * mainloop = NULL; +gboolean passed = FALSE; static GtkStatusIcon * fallback (AppIndicator * indicator) @@ -64,6 +65,14 @@ unfallback (AppIndicator * indicator, GtkStatusIcon * status_icon) return; } +gboolean +kill_func (gpointer data) +{ + g_debug("Kill Function"); + g_main_loop_quit(mainloop); + return FALSE; +} + int main (int argc, char ** argv) { @@ -75,10 +84,16 @@ main (int argc, char ** argv) "icon-name", "bob", NULL); + g_timeout_add_seconds(1, kill_func, NULL); + mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); g_object_unref(G_OBJECT(item)); - return 0; + if (passed) { + return 0; + } else { + return 1; + } } -- cgit v1.2.3