diff options
author | Ted Gould <ted@gould.cx> | 2009-12-02 15:58:52 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-12-02 15:58:52 -0600 |
commit | bc803c5df180ab73e129060c64982a637ae6048d (patch) | |
tree | 9ed4a914ab7db514e7be23ebab23524695327ddb /tests/service-manager-connect.c | |
parent | 1696a679089c71f23557ad8c3ec4d1da2d9f6b73 (diff) | |
parent | de38fc85d228bb2de6de86f31805ad0de748318e (diff) | |
download | libayatana-indicator-bc803c5df180ab73e129060c64982a637ae6048d.tar.gz libayatana-indicator-bc803c5df180ab73e129060c64982a637ae6048d.tar.bz2 libayatana-indicator-bc803c5df180ab73e129060c64982a637ae6048d.zip |
Merge in from trunk, now two failing tests.
Diffstat (limited to 'tests/service-manager-connect.c')
-rw-r--r-- | tests/service-manager-connect.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/service-manager-connect.c b/tests/service-manager-connect.c index c252542..91d2bad 100644 --- a/tests/service-manager-connect.c +++ b/tests/service-manager-connect.c @@ -15,8 +15,22 @@ timeout (gpointer data) } void -connection (void) +connection (IndicatorServiceManager * sm, gboolean connected, gpointer user_data) { + static gboolean has_connected = FALSE; + + if (has_connected && connected) { + g_warning("We got two connected signals. FAIL."); + passed = FALSE; + return; + } + + if (!connected) { + g_debug("Not connected"); + return; + } + + has_connected = TRUE; g_debug("Connection"); passed = TRUE; g_main_loop_quit(mainloop); @@ -30,13 +44,15 @@ main (int argc, char ** argv) g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); IndicatorServiceManager * is = indicator_service_manager_new("org.ayatana.test"); - g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL); + g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection), NULL); g_timeout_add_seconds(1, timeout, NULL); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); + g_object_unref(is); + g_debug("Quiting"); if (passed) { g_debug("Passed"); |