aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-08-08 10:05:24 +0200
committerRobert Tari <robert@tari.in>2020-08-08 10:05:24 +0200
commit7ceee62eb53671e2dd5211ca693e47877b55f2dd (patch)
treeaa576074b553be2a26e7027f5ab661840ede0671 /tests
parenta5b13749745f729216c42697d7dea961fa6c7f99 (diff)
downloadlibayatana-indicator-7ceee62eb53671e2dd5211ca693e47877b55f2dd.tar.gz
libayatana-indicator-7ceee62eb53671e2dd5211ca693e47877b55f2dd.tar.bz2
libayatana-indicator-7ceee62eb53671e2dd5211ca693e47877b55f2dd.zip
Fix tests and deprecations (fixes #1)
Diffstat (limited to 'tests')
-rw-r--r--tests/indicator-test-service.c2
-rw-r--r--tests/service-manager-connect-service.c46
-rw-r--r--tests/service-manager-connect.c76
-rw-r--r--tests/service-manager-no-connect.c46
-rw-r--r--tests/service-manager-nostart-connect.c78
-rw-r--r--tests/service-shutdown-timeout.c44
-rw-r--r--tests/service-version-bad-service.c44
-rw-r--r--tests/service-version-good-service.c60
-rw-r--r--tests/service-version-manager.c62
-rw-r--r--tests/service-version-multiwatch-manager-impolite.c56
-rw-r--r--tests/service-version-multiwatch-manager.c58
-rw-r--r--tests/service-version-multiwatch-service.c46
-rw-r--r--tests/test-desktop-shortcuts.c126
-rw-r--r--tests/test-indicator-ng.c2
14 files changed, 373 insertions, 373 deletions
diff --git a/tests/indicator-test-service.c b/tests/indicator-test-service.c
index 2aa973e..39e7ea6 100644
--- a/tests/indicator-test-service.c
+++ b/tests/indicator-test-service.c
@@ -78,7 +78,7 @@ main (int argc, char **argv)
GMainLoop *loop;
indicator.actions = g_simple_action_group_new ();
- g_simple_action_group_add_entries (indicator.actions, entries, G_N_ELEMENTS (entries), NULL);
+ g_action_map_add_action_entries(G_ACTION_MAP(indicator.actions), entries, G_N_ELEMENTS (entries), NULL);
submenu = g_menu_new ();
g_menu_append (submenu, "Show", "indicator.show");
diff --git a/tests/service-manager-connect-service.c b/tests/service-manager-connect-service.c
index e56060a..fb00712 100644
--- a/tests/service-manager-connect-service.c
+++ b/tests/service-manager-connect-service.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service.h"
+#include "libayatana-indicator/indicator-service.h"
static GMainLoop * mainloop = NULL;
static gboolean passed = FALSE;
@@ -30,39 +30,39 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_debug("Timeout with no shutdown.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ 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;
+ g_debug("Shutdown");
+ passed = TRUE;
+ g_main_loop_quit(mainloop);
+ return;
}
int
main (int argc, char ** argv)
{
- g_debug("Starting service");
+ g_debug("Starting service");
- IndicatorService * is = indicator_service_new("org.ayatana.test");
- g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
+ IndicatorService * is = indicator_service_new("org.ayatana.test");
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
- g_timeout_add_seconds(5, timeout, NULL);
+ g_timeout_add_seconds(5, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-manager-connect.c b/tests/service-manager-connect.c
index 5b07972..d4774f7 100644
--- a/tests/service-manager-connect.c
+++ b/tests/service-manager-connect.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service-manager.h"
+#include "libayatana-indicator/indicator-service-manager.h"
static GMainLoop * mainloop = NULL;
static gboolean passed = FALSE;
@@ -30,55 +30,55 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_error("Timeout with no connection.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ passed = FALSE;
+ g_error("Timeout with no connection.");
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
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);
- return;
+ 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);
+ return;
}
int
main (int argc, char ** argv)
{
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ 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, G_CALLBACK(connection), NULL);
+ IndicatorServiceManager * is = indicator_service_manager_new("org.ayatana.test");
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection), NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ mainloop = g_main_loop_new(NULL, FALSE);
+ g_main_loop_run(mainloop);
- g_object_unref(is);
+ g_object_unref(is);
- g_debug("Quiting");
- if (passed) {
- g_debug("Passed");
- return 0;
- }
- g_debug("Failed");
- return 1;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-manager-no-connect.c b/tests/service-manager-no-connect.c
index ad28507..7aeffc2 100644
--- a/tests/service-manager-no-connect.c
+++ b/tests/service-manager-no-connect.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service-manager.h"
+#include "libayatana-indicator/indicator-service-manager.h"
static GMainLoop * mainloop = NULL;
static gboolean passed = FALSE;
@@ -30,39 +30,39 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = TRUE;
- g_debug("Timeout with no connection.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ passed = TRUE;
+ g_debug("Timeout with no connection.");
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
void
connection (void)
{
- g_debug("Connection");
- passed = FALSE;
- g_main_loop_quit(mainloop);
- return;
+ g_debug("Connection");
+ passed = FALSE;
+ g_main_loop_quit(mainloop);
+ return;
}
int
main (int argc, char ** argv)
{
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
- IndicatorServiceManager * is = indicator_service_manager_new("my.test.name");
- g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL);
+ IndicatorServiceManager * is = indicator_service_manager_new("my.test.name");
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, connection, NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-manager-nostart-connect.c b/tests/service-manager-nostart-connect.c
index 48f4997..36d1bdd 100644
--- a/tests/service-manager-nostart-connect.c
+++ b/tests/service-manager-nostart-connect.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service-manager.h"
+#include "libayatana-indicator/indicator-service-manager.h"
static GMainLoop * mainloop = NULL;
static gboolean passed = FALSE;
@@ -30,57 +30,57 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_error("Timeout with no connection.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ passed = FALSE;
+ g_error("Timeout with no connection.");
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
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);
- return;
+ 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);
+ return;
}
int
main (int argc, char ** argv)
{
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
- g_usleep(150000);
+ g_usleep(150000);
- IndicatorServiceManager * is = indicator_service_manager_new("org.ayatana.test");
- g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection), NULL);
+ IndicatorServiceManager * is = indicator_service_manager_new("org.ayatana.test");
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection), NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ mainloop = g_main_loop_new(NULL, FALSE);
+ g_main_loop_run(mainloop);
- g_object_unref(is);
+ g_object_unref(is);
- g_debug("Quiting");
- if (passed) {
- g_debug("Passed");
- return 0;
- }
- g_debug("Failed");
- return 1;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-shutdown-timeout.c b/tests/service-shutdown-timeout.c
index b909077..e044216 100644
--- a/tests/service-shutdown-timeout.c
+++ b/tests/service-shutdown-timeout.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service.h"
+#include "libayatana-indicator/indicator-service.h"
static GMainLoop * mainloop = NULL;
static gboolean passed = FALSE;
@@ -30,37 +30,37 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_error("Timeout with no shutdown.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ passed = FALSE;
+ g_error("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;
+ g_debug("Shutdown");
+ passed = TRUE;
+ g_main_loop_quit(mainloop);
+ return;
}
int
main (int argc, char ** argv)
{
- IndicatorService * is = indicator_service_new("my.test.name");
- g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
+ IndicatorService * is = indicator_service_new("my.test.name");
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
- g_timeout_add_seconds(2, timeout, NULL);
+ g_timeout_add_seconds(2, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-version-bad-service.c b/tests/service-version-bad-service.c
index 556575e..f78f6e1 100644
--- a/tests/service-version-bad-service.c
+++ b/tests/service-version-bad-service.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service.h"
+#include "libayatana-indicator/indicator-service.h"
#include "service-version-values.h"
static GMainLoop * mainloop = NULL;
@@ -31,37 +31,37 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_debug("Timeout with no shutdown.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ 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;
+ g_debug("Shutdown");
+ passed = TRUE;
+ g_main_loop_quit(mainloop);
+ return;
}
int
main (int argc, char ** argv)
{
- 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);
+ 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);
+ g_timeout_add_seconds(1, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-version-good-service.c b/tests/service-version-good-service.c
index 9c0dde7..a811d96 100644
--- a/tests/service-version-good-service.c
+++ b/tests/service-version-good-service.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service.h"
+#include "libayatana-indicator/indicator-service.h"
#include "service-version-values.h"
static GMainLoop * mainloop = NULL;
@@ -32,49 +32,49 @@ static IndicatorService * is = NULL;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_debug("Timeout with no shutdown.");
+ passed = FALSE;
+ g_debug("Timeout with no shutdown.");
- if (is != NULL) {
- g_object_unref(is);
- is = NULL;
- }
+ if (is != NULL) {
+ g_object_unref(is);
+ is = NULL;
+ }
- g_main_loop_quit(mainloop);
- return FALSE;
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
void
shutdown (void)
{
- g_debug("Shutdown");
- passed = TRUE;
+ g_debug("Shutdown");
+ passed = TRUE;
- if (is != NULL) {
- g_object_unref(is);
- is = NULL;
- }
+ if (is != NULL) {
+ g_object_unref(is);
+ is = NULL;
+ }
- g_main_loop_quit(mainloop);
- return;
+ g_main_loop_quit(mainloop);
+ return;
}
int
main (int argc, char ** argv)
{
- is = indicator_service_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
+ is = indicator_service_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-version-manager.c b/tests/service-version-manager.c
index 63bd6b0..370dbd0 100644
--- a/tests/service-version-manager.c
+++ b/tests/service-version-manager.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service-manager.h"
+#include "libayatana-indicator/indicator-service-manager.h"
#include "service-version-values.h"
static GMainLoop * mainloop = NULL;
@@ -32,54 +32,54 @@ static gboolean con_bad = FALSE;
gboolean
timeout (gpointer data)
{
- g_debug("Timeout.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ g_debug("Timeout.");
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
void
connection_bad (IndicatorServiceManager * sm, gboolean connected, gpointer user_data)
{
- if (!connected) return;
- g_debug("Connection From Bad!");
- con_bad = TRUE;
- return;
+ if (!connected) return;
+ g_debug("Connection From Bad!");
+ con_bad = TRUE;
+ return;
}
void
connection_good (IndicatorServiceManager * sm, gboolean connected, gpointer user_data)
{
- if (!connected) return;
- g_debug("Connection From Good.");
- con_good = TRUE;
- return;
+ if (!connected) return;
+ g_debug("Connection From Good.");
+ con_good = TRUE;
+ return;
}
int
main (int argc, char ** argv)
{
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
- g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
+ g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
- IndicatorServiceManager * goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
+ IndicatorServiceManager * goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
- IndicatorServiceManager * badis = indicator_service_manager_new_version("org.ayatana.version.bad", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(badis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_bad), NULL);
+ IndicatorServiceManager * badis = indicator_service_manager_new_version("org.ayatana.version.bad", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(badis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_bad), NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ mainloop = g_main_loop_new(NULL, FALSE);
+ g_main_loop_run(mainloop);
- g_object_unref(goodis);
- g_object_unref(badis);
+ g_object_unref(goodis);
+ g_object_unref(badis);
- g_debug("Quiting");
- if (con_good && !con_bad) {
- g_debug("Passed");
- return 0;
- }
- g_debug("Failed");
- return 1;
+ g_debug("Quiting");
+ if (con_good && !con_bad) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-version-multiwatch-manager-impolite.c b/tests/service-version-multiwatch-manager-impolite.c
index 68788b9..4e3a5a9 100644
--- a/tests/service-version-multiwatch-manager-impolite.c
+++ b/tests/service-version-multiwatch-manager-impolite.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service-manager.h"
+#include "libayatana-indicator/indicator-service-manager.h"
#include "service-version-values.h"
static GMainLoop * mainloop = NULL;
@@ -32,51 +32,51 @@ static IndicatorServiceManager * goodis = NULL;
gboolean
timeout (gpointer data)
{
- g_debug("Timeout.");
- passed = FALSE;
- g_main_loop_quit(mainloop);
- return FALSE;
+ g_debug("Timeout.");
+ passed = FALSE;
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
void
connection_good (IndicatorServiceManager * sm, gboolean connected, gpointer user_data)
{
- if (!connected) return;
- g_debug("Connection From Service.");
- passed = TRUE;
- g_main_loop_quit(mainloop);
- return;
+ if (!connected) return;
+ g_debug("Connection From Service.");
+ passed = TRUE;
+ g_main_loop_quit(mainloop);
+ return;
}
gboolean
delay_start (gpointer data)
{
- g_debug("Starting Manager");
+ g_debug("Starting Manager");
- goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
+ goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- return FALSE;
+ return FALSE;
}
int
main (int argc, char ** argv)
{
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
- g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
+ g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
- g_timeout_add(500, delay_start, NULL);
+ g_timeout_add(500, delay_start, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-version-multiwatch-manager.c b/tests/service-version-multiwatch-manager.c
index 633ee59..c24b41d 100644
--- a/tests/service-version-multiwatch-manager.c
+++ b/tests/service-version-multiwatch-manager.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service-manager.h"
+#include "libayatana-indicator/indicator-service-manager.h"
#include "service-version-values.h"
static GMainLoop * mainloop = NULL;
@@ -32,53 +32,53 @@ static IndicatorServiceManager * goodis = NULL;
gboolean
timeout (gpointer data)
{
- g_debug("Timeout.");
- passed = FALSE;
- g_main_loop_quit(mainloop);
- return FALSE;
+ g_debug("Timeout.");
+ passed = FALSE;
+ g_main_loop_quit(mainloop);
+ return FALSE;
}
void
connection_good (IndicatorServiceManager * sm, gboolean connected, gpointer user_data)
{
- if (!connected) return;
- g_debug("Connection From Service.");
- passed = TRUE;
- g_main_loop_quit(mainloop);
- return;
+ if (!connected) return;
+ g_debug("Connection From Service.");
+ passed = TRUE;
+ g_main_loop_quit(mainloop);
+ return;
}
gboolean
delay_start (gpointer data)
{
- g_debug("Starting Manager");
+ g_debug("Starting Manager");
- goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
+ goodis = indicator_service_manager_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(goodis), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connection_good), NULL);
- g_timeout_add_seconds(1, timeout, NULL);
+ g_timeout_add_seconds(1, timeout, NULL);
- return FALSE;
+ return FALSE;
}
int
main (int argc, char ** argv)
{
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
- g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
+ g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_print("Manager: DBUS_SESSION_BUS_ADDRESS = %s\n", g_getenv("DBUS_SESSION_BUS_ADDRESS"));
- g_timeout_add(500, delay_start, NULL);
+ g_timeout_add(500, delay_start, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ mainloop = g_main_loop_new(NULL, FALSE);
+ g_main_loop_run(mainloop);
- g_object_unref(goodis);
+ g_object_unref(goodis);
- g_debug("Quiting");
- if (passed) {
- g_debug("Passed");
- return 0;
- }
- g_debug("Failed");
- return 1;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/service-version-multiwatch-service.c b/tests/service-version-multiwatch-service.c
index 1333d7a..1a43414 100644
--- a/tests/service-version-multiwatch-service.c
+++ b/tests/service-version-multiwatch-service.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -22,7 +22,7 @@ License along with this library. If not, see
#include <glib.h>
-#include "libindicator/indicator-service.h"
+#include "libayatana-indicator/indicator-service.h"
#include "service-version-values.h"
static GMainLoop * mainloop = NULL;
@@ -31,39 +31,39 @@ static gboolean passed = FALSE;
gboolean
timeout (gpointer data)
{
- passed = FALSE;
- g_debug("Timeout with no shutdown.");
- g_main_loop_quit(mainloop);
- return FALSE;
+ 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;
+ g_debug("Shutdown");
+ passed = TRUE;
+ g_main_loop_quit(mainloop);
+ return;
}
int
main (int argc, char ** argv)
{
- g_debug("Service starting");
+ g_debug("Service starting");
- IndicatorService * is = indicator_service_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
- g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
+ IndicatorService * is = indicator_service_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
+ g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);
- g_timeout_add_seconds(2, timeout, NULL);
+ g_timeout_add_seconds(2, timeout, NULL);
- mainloop = g_main_loop_new(NULL, FALSE);
- g_main_loop_run(mainloop);
+ 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;
+ g_debug("Quiting");
+ if (passed) {
+ g_debug("Passed");
+ return 0;
+ }
+ g_debug("Failed");
+ return 1;
}
diff --git a/tests/test-desktop-shortcuts.c b/tests/test-desktop-shortcuts.c
index 4f20d3e..59084dd 100644
--- a/tests/test-desktop-shortcuts.c
+++ b/tests/test-desktop-shortcuts.c
@@ -1,5 +1,5 @@
/*
-Test for libindicator
+Test for libayatana-indicator
Copyright 2009 Canonical Ltd.
@@ -21,7 +21,7 @@ License along with this library. If not, see
*/
#include <gtk/gtk.h>
-#include "libindicator/indicator-desktop-shortcuts.h"
+#include "libayatana-indicator/indicator-desktop-shortcuts.h"
/* Basic object creation and destruction. Stop big
f*** ups here. */
@@ -29,14 +29,14 @@ void
test_desktop_shortcuts_creation (void)
{
- IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France");
- g_assert(ids != NULL);
+ IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France");
+ g_assert(ids != NULL);
- g_object_add_weak_pointer(G_OBJECT(ids), (gpointer *)&ids);
- g_object_unref(G_OBJECT(ids));
+ g_object_add_weak_pointer(G_OBJECT(ids), (gpointer *)&ids);
+ g_object_unref(G_OBJECT(ids));
- g_assert(ids == NULL);
- return;
+ g_assert(ids == NULL);
+ return;
}
/* Tests that the NotShowIn the desktop group is watched
@@ -45,116 +45,116 @@ void
test_desktop_shortcuts_globalnoshow (void)
{
- IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "Germany");
- g_assert(ids != NULL);
+ IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "Germany");
+ g_assert(ids != NULL);
- const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
- g_assert(nicks[0] == NULL);
+ const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
+ g_assert(nicks[0] == NULL);
- g_object_unref(ids);
+ g_object_unref(ids);
- return;
+ return;
}
gboolean
nicks_contains (const gchar ** nicks, const gchar * search)
{
- if (nicks[0] == NULL)
- return FALSE;
- if (g_strcmp0(nicks[0], search) == 0)
- return TRUE;
- return nicks_contains(&nicks[1], search);
+ if (nicks[0] == NULL)
+ return FALSE;
+ if (g_strcmp0(nicks[0], search) == 0)
+ return TRUE;
+ return nicks_contains(&nicks[1], search);
}
/* Checking that the local show OnlyIn works. */
void
test_desktop_shortcuts_localfilter (void)
{
- IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France");
- g_assert(ids != NULL);
+ IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France");
+ g_assert(ids != NULL);
- const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
+ const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
- g_assert(nicks_contains(nicks, "bob"));
- g_assert(nicks_contains(nicks, "alvin"));
- g_assert(!nicks_contains(nicks, "jim"));
+ g_assert(nicks_contains(nicks, "bob"));
+ g_assert(nicks_contains(nicks, "alvin"));
+ g_assert(!nicks_contains(nicks, "jim"));
- g_object_unref(ids);
+ g_object_unref(ids);
- return;
+ return;
}
/* Nick names -- checks to see they all have names */
void
test_desktop_shortcuts_nicknames (void)
{
- IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France");
- g_assert(ids != NULL);
+ IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France");
+ g_assert(ids != NULL);
- const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
- gint i = 0;
- while (nicks[i] != NULL) {
- gchar * expectedstr = g_strdup_printf("%s's shortcut", nicks[i]);
- gchar * name = indicator_desktop_shortcuts_nick_get_name(ids, nicks[i]);
- g_assert(name != NULL);
+ const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
+ gint i = 0;
+ while (nicks[i] != NULL) {
+ gchar * expectedstr = g_strdup_printf("%s's shortcut", nicks[i]);
+ gchar * name = indicator_desktop_shortcuts_nick_get_name(ids, nicks[i]);
+ g_assert(name != NULL);
- gboolean same = (g_strcmp0(expectedstr, name) == 0);
+ gboolean same = (g_strcmp0(expectedstr, name) == 0);
- g_free(name);
- g_free(expectedstr);
+ g_free(name);
+ g_free(expectedstr);
- g_assert(same);
+ g_assert(same);
- i++;
- }
+ i++;
+ }
- g_object_unref(ids);
+ g_object_unref(ids);
- return;
+ return;
}
/* Try executing a shortcut which will touch a file */
void
test_desktop_shortcuts_launch (void)
{
- return;
- IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "TouchTest");
- g_assert(ids != NULL);
+ return;
+ IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "TouchTest");
+ g_assert(ids != NULL);
- const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
- g_assert(nicks_contains(nicks, "touch"));
+ const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids);
+ g_assert(nicks_contains(nicks, "touch"));
- g_assert(indicator_desktop_shortcuts_nick_exec_with_context(ids, "touch", NULL));
- g_usleep(100000);
- g_assert(g_file_test(BUILD_DIR "/test-desktop-shortcuts-touch-test", G_FILE_TEST_EXISTS));
+ g_assert(indicator_desktop_shortcuts_nick_exec_with_context(ids, "touch", NULL));
+ g_usleep(100000);
+ g_assert(g_file_test(BUILD_DIR "/test-desktop-shortcuts-touch-test", G_FILE_TEST_EXISTS));
- g_object_unref(ids);
+ g_object_unref(ids);
- return;
+ return;
}
/* Build our test suite */
void
test_desktop_shortcuts_suite (void)
{
- g_test_add_func ("/libindicator/desktopshortcuts/creation", test_desktop_shortcuts_creation);
- g_test_add_func ("/libindicator/desktopshortcuts/globalnosho", test_desktop_shortcuts_globalnoshow);
- g_test_add_func ("/libindicator/desktopshortcuts/nicknames", test_desktop_shortcuts_nicknames);
- g_test_add_func ("/libindicator/desktopshortcuts/launch", test_desktop_shortcuts_launch);
+ g_test_add_func ("/libayatana-indicator/desktopshortcuts/creation", test_desktop_shortcuts_creation);
+ g_test_add_func ("/libayatana-indicator/desktopshortcuts/globalnosho", test_desktop_shortcuts_globalnoshow);
+ g_test_add_func ("/libayatana-indicator/desktopshortcuts/nicknames", test_desktop_shortcuts_nicknames);
+ g_test_add_func ("/libayatana-indicator/desktopshortcuts/launch", test_desktop_shortcuts_launch);
- return;
+ return;
}
int
main (int argc, char ** argv)
{
- g_test_init (&argc, &argv, NULL);
- gtk_init(&argc, &argv);
+ g_test_init (&argc, &argv, NULL);
+ gtk_init(&argc, &argv);
- test_desktop_shortcuts_suite();
+ test_desktop_shortcuts_suite();
- g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
- return g_test_run();
+ return g_test_run();
}
diff --git a/tests/test-indicator-ng.c b/tests/test-indicator-ng.c
index 4e38c6e..0844334 100644
--- a/tests/test-indicator-ng.c
+++ b/tests/test-indicator-ng.c
@@ -1,5 +1,5 @@
-#include <libindicator/indicator-ng.h>
+#include <libayatana-indicator/indicator-ng.h>
static void
indicator_ng_test_func (gconstpointer user_data)