diff options
author | Ted Gould <ted@canonical.com> | 2009-04-28 15:52:40 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-04-28 15:52:40 -0500 |
commit | a10757b066e0291cde11136c2b33b5b6ebcccad5 (patch) | |
tree | b608149503b5f2c6736f74f6c5d37e606761ea6d /tests/test-glib-layout-client.c | |
parent | f7c32c45fc4c9dff6822b10698c7b4d740c92ca0 (diff) | |
download | libdbusmenu-a10757b066e0291cde11136c2b33b5b6ebcccad5.tar.gz libdbusmenu-a10757b066e0291cde11136c2b33b5b6ebcccad5.tar.bz2 libdbusmenu-a10757b066e0291cde11136c2b33b5b6ebcccad5.zip |
Adding a little flesh to the client
Diffstat (limited to 'tests/test-glib-layout-client.c')
-rw-r--r-- | tests/test-glib-layout-client.c | 42 |
1 files changed, 42 insertions, 0 deletions
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 <glib.h> + +#include <libdbusmenu-glib/client.h> +#include <libdbusmenu-glib/menuitem.h> + +#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; + } +} |