aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-12 16:39:27 -0600
committerTed Gould <ted@gould.cx>2010-01-12 16:39:27 -0600
commita216db21dd72d491edaca5c7746d3a2a23b17dd1 (patch)
treef0201939e1d00dcc9dbc32dacf6e00a89be8f391 /tests
parentd0abe1ebd34409a7074a39c6af017b2cfb49abf4 (diff)
downloadayatana-indicator-application-a216db21dd72d491edaca5c7746d3a2a23b17dd1.tar.gz
ayatana-indicator-application-a216db21dd72d491edaca5c7746d3a2a23b17dd1.tar.bz2
ayatana-indicator-application-a216db21dd72d491edaca5c7746d3a2a23b17dd1.zip
Adding a kill function and letting the test fail over it.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-libappindicator-fallback-item.c17
1 files changed, 16 insertions, 1 deletions
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;
+ }
}