aboutsummaryrefslogtreecommitdiff
path: root/tests/test-glib-layout-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-glib-layout-client.c')
-rw-r--r--tests/test-glib-layout-client.c42
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;
+ }
+}