diff options
author | Ted Gould <ted@gould.cx> | 2009-12-07 13:10:34 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-12-07 13:10:34 -0600 |
commit | 53bd4b5dc62b36dc4858bc0c4025994534a3e94d (patch) | |
tree | 2d7c5e35e4e4b64494ec8efe27292c3cc96a89d4 /tests/service-version-bad-service.c | |
parent | 6db57d8ca2ce6222358ef5151f522eb6bc8a53c3 (diff) | |
parent | 483992f7d3656a103b1a152a6526507479e8f5b0 (diff) | |
download | libayatana-indicator-53bd4b5dc62b36dc4858bc0c4025994534a3e94d.tar.gz libayatana-indicator-53bd4b5dc62b36dc4858bc0c4025994534a3e94d.tar.bz2 libayatana-indicator-53bd4b5dc62b36dc4858bc0c4025994534a3e94d.zip |
Adding in a service API version number.
Diffstat (limited to 'tests/service-version-bad-service.c')
-rw-r--r-- | tests/service-version-bad-service.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/service-version-bad-service.c b/tests/service-version-bad-service.c new file mode 100644 index 0000000..6057e74 --- /dev/null +++ b/tests/service-version-bad-service.c @@ -0,0 +1,47 @@ + +#include <glib.h> +#include "libindicator/indicator-service.h" +#include "service-version-values.h" + +static GMainLoop * mainloop = NULL; +static gboolean passed = FALSE; + +gboolean +timeout (gpointer data) +{ + passed = FALSE; + g_debug("Timeout with no shutdown."); + g_main_loop_quit(mainloop); + return FALSE; +} + +void +shutdown (void) +{ + g_debug("Shutdown"); + passed = TRUE; + g_main_loop_quit(mainloop); + return; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + + IndicatorService * is = indicator_service_new_version("org.ayatana.version.bad", SERVICE_VERSION_BAD); + g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL); + + g_timeout_add_seconds(1, timeout, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + if (passed) { + g_debug("Passed"); + return 0; + } + g_debug("Failed"); + return 1; +} |