From a10757b066e0291cde11136c2b33b5b6ebcccad5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 28 Apr 2009 15:52:40 -0500 Subject: Adding a little flesh to the client --- tests/test-glib-layout-client.c | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'tests/test-glib-layout-client.c') diff --git a/tests/test-glib-layout-client.c b/tests/test-glib-layout-client.c index e69de29..814f019 100644 --- a/tests/test-glib-layout-client.c +++ b/tests/test-glib-layout-client.c @@ -0,0 +1,42 @@ +#include + +#include +#include + +#include "test-glib-layout.h" + +static guint layouton = 0; +static GMainLoop * mainloop = NULL; +static gboolean passed = TRUE; + +static gboolean +timer_func (gpointer data) +{ + g_debug("Death timer. Oops. Got to: %d", layouton); + passed = FALSE; + g_main_loop_quit(mainloop); + return FALSE; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + + DbusmenuClient * client = dbusmenu_client_new(":1", "/org/test"); + dbusmenu_client_get_root(client); + + timer_func(NULL); + g_timeout_add_seconds(2, timer_func, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + if (passed) { + g_debug("Quiting"); + return 0; + } else { + g_debug("Quiting as we're a failure"); + return 0; + } +} -- cgit v1.2.3