aboutsummaryrefslogtreecommitdiff
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
parenta5b13749745f729216c42697d7dea961fa6c7f99 (diff)
downloadlibayatana-indicator-7ceee62eb53671e2dd5211ca693e47877b55f2dd.tar.gz
libayatana-indicator-7ceee62eb53671e2dd5211ca693e47877b55f2dd.tar.bz2
libayatana-indicator-7ceee62eb53671e2dd5211ca693e47877b55f2dd.zip
Fix tests and deprecations (fixes #1)
-rw-r--r--libayatana-indicator/indicator-desktop-shortcuts.c73
-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
15 files changed, 397 insertions, 422 deletions
diff --git a/libayatana-indicator/indicator-desktop-shortcuts.c b/libayatana-indicator/indicator-desktop-shortcuts.c
index b380145..bbac612 100644
--- a/libayatana-indicator/indicator-desktop-shortcuts.c
+++ b/libayatana-indicator/indicator-desktop-shortcuts.c
@@ -45,14 +45,13 @@ enum _actions_t {
ACTIONS_DESKTOP_SPEC
};
-typedef struct _IndicatorDesktopShortcutsPrivate IndicatorDesktopShortcutsPrivate;
-struct _IndicatorDesktopShortcutsPrivate {
+typedef struct {
actions_t actions;
GKeyFile * keyfile;
gchar * identity;
GArray * nicks;
gchar * domain;
-};
+} IndicatorDesktopShortcutsPrivate;
enum {
PROP_0,
@@ -60,9 +59,6 @@ enum {
PROP_IDENTITY
};
-#define INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsPrivate))
-
static void indicator_desktop_shortcuts_class_init (IndicatorDesktopShortcutsClass *klass);
static void indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self);
static void indicator_desktop_shortcuts_dispose (GObject *object);
@@ -72,7 +68,7 @@ static void get_property (GObject * object, guint prop_id, GValue * value, GPara
static void parse_keyfile (IndicatorDesktopShortcuts * ids);
static gboolean should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity, gboolean should_have_target);
-G_DEFINE_TYPE (IndicatorDesktopShortcuts, indicator_desktop_shortcuts, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (IndicatorDesktopShortcuts, indicator_desktop_shortcuts, G_TYPE_OBJECT);
/* Build up the class */
static void
@@ -122,8 +118,8 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self)
static void
indicator_desktop_shortcuts_dispose (GObject *object)
{
- IndicatorDesktopShortcuts * desktop_shortcuts = INDICATOR_DESKTOP_SHORTCUTS(object);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(desktop_shortcuts);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
if (priv->keyfile) {
g_key_file_free(priv->keyfile);
@@ -138,8 +134,8 @@ indicator_desktop_shortcuts_dispose (GObject *object)
static void
indicator_desktop_shortcuts_finalize (GObject *object)
{
- IndicatorDesktopShortcuts * desktop_shortcuts = INDICATOR_DESKTOP_SHORTCUTS(object);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(desktop_shortcuts);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
if (priv->identity != NULL) {
g_free(priv->identity);
@@ -170,8 +166,8 @@ static void
set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)
{
g_return_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(object));
- IndicatorDesktopShortcuts * desktop_shortcuts = INDICATOR_DESKTOP_SHORTCUTS(object);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(desktop_shortcuts);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
switch(prop_id) {
case PROP_DESKTOP_FILE: {
@@ -209,7 +205,7 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
}
priv->keyfile = keyfile;
- parse_keyfile(desktop_shortcuts);
+ parse_keyfile(INDICATOR_DESKTOP_SHORTCUTS(object));
break;
}
case PROP_IDENTITY:
@@ -218,7 +214,7 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
return;
}
priv->identity = g_value_dup_string(value);
- parse_keyfile(desktop_shortcuts);
+ parse_keyfile(INDICATOR_DESKTOP_SHORTCUTS(object));
break;
/* *********************** */
default:
@@ -234,8 +230,8 @@ static void
get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec)
{
g_return_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(object));
- IndicatorDesktopShortcuts * desktop_shortcuts = INDICATOR_DESKTOP_SHORTCUTS(object);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(desktop_shortcuts);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
switch(prop_id) {
case PROP_IDENTITY:
@@ -255,7 +251,8 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe
static void
parse_keyfile (IndicatorDesktopShortcuts * ids)
{
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(ids);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(ids);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
if (priv->keyfile == NULL) {
return;
@@ -477,7 +474,8 @@ const gchar **
indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids)
{
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(ids);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(ids);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
return (const gchar **)priv->nicks->data;
}
@@ -499,7 +497,8 @@ gchar *
indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, const gchar * nick)
{
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(ids);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(ids);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
g_return_val_if_fail(priv->actions != ACTIONS_NONE, NULL);
g_return_val_if_fail(priv->keyfile != NULL, NULL);
@@ -573,10 +572,10 @@ gboolean
indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, const gchar * nick, GAppLaunchContext * launch_context)
{
GError * error = NULL;
- gchar * current_dir = NULL;
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), FALSE);
- IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(ids);
+ IndicatorDesktopShortcuts * self = INDICATOR_DESKTOP_SHORTCUTS(ids);
+ IndicatorDesktopShortcutsPrivate * priv = indicator_desktop_shortcuts_get_instance_private(self);
g_return_val_if_fail(priv->actions != ACTIONS_NONE, FALSE);
g_return_val_if_fail(priv->keyfile != NULL, FALSE);
@@ -615,22 +614,6 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts *
return FALSE;
}
- /* If possible move to the proper launch path */
- gchar * path = g_key_file_get_string(priv->keyfile, groupheader,
- G_KEY_FILE_DESKTOP_KEY_PATH, NULL);
-
- if (path && *path != '\0') {
- current_dir = g_get_current_dir();
-
- if (chdir(path) < 0) {
- g_warning("Impossible to run action '%s' from path '%s'", nick, path);
- g_free(current_dir);
- g_free(groupheader);
- g_free(path);
- return FALSE;
- }
- }
-
/* Grab the name and the exec entries out of our current group */
gchar * name = g_key_file_get_locale_string(priv->keyfile,
groupheader,
@@ -644,6 +627,8 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts *
NULL,
NULL);
+ g_free(groupheader);
+
GAppInfoCreateFlags flags = G_APP_INFO_CREATE_NONE;
if (launch_context) {
@@ -651,36 +636,26 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts *
}
GAppInfo * appinfo = g_app_info_create_from_commandline(exec, name, flags, &error);
- g_free(groupheader);
- g_free(path);
- g_free(name);
- g_free(exec);
+ g_free(name); g_free(exec);
if (error != NULL) {
g_warning("Unable to build Command line App info: %s", error->message);
- g_free(current_dir);
g_error_free(error);
return FALSE;
}
if (appinfo == NULL) {
g_warning("Unable to build Command line App info (unknown)");
- g_free(current_dir);
return FALSE;
}
gboolean launched = g_app_info_launch(appinfo, NULL, launch_context, &error);
- if (current_dir && chdir(current_dir) < 0)
- g_warning("Impossible to switch back to default work dir");
-
-
if (error != NULL) {
g_warning("Unable to launch file from nick '%s': %s", nick, error->message);
g_clear_error(&error);
}
- g_free(current_dir);
g_object_unref(appinfo);
return launched;
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)