aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-12-08 15:19:44 -0600
committerTed Gould <ted@gould.cx>2010-12-08 15:19:44 -0600
commit0d8a2c601b50a1d9ce6ccd1140f624c84558cf9d (patch)
treeba70d1960abc1fbf7892f1f870f47416cf13e3ee /tests
parent6d73d549745eddea81b38c7effa0f48509fcbb8d (diff)
parent5b8d8f97aa46c2d56e7c4bbc244dafe378b60e8d (diff)
downloadlibayatana-appindicator-0d8a2c601b50a1d9ce6ccd1140f624c84558cf9d.tar.gz
libayatana-appindicator-0d8a2c601b50a1d9ce6ccd1140f624c84558cf9d.tar.bz2
libayatana-appindicator-0d8a2c601b50a1d9ce6ccd1140f624c84558cf9d.zip
Switching the library over to using GDBus
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am32
-rw-r--r--tests/test-libappindicator-dbus-client.c16
-rw-r--r--tests/test-libappindicator-dbus-server.c4
3 files changed, 24 insertions, 28 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 15e477e..5040b77 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -24,13 +24,13 @@ test_libappindicator_SOURCES = \
test-libappindicator.c
test_libappindicator_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-DSRCDIR="\"$(srcdir)\"" \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
#########################################
@@ -42,12 +42,12 @@ test_libappindicator_dbus_client_SOURCES = \
test-libappindicator-dbus-client.c
test_libappindicator_dbus_client_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_dbus_client_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
#########################################
@@ -59,12 +59,12 @@ test_libappindicator_dbus_server_SOURCES = \
test-libappindicator-dbus-server.c
test_libappindicator_dbus_server_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_dbus_server_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
#########################################
@@ -76,12 +76,12 @@ test_libappindicator_status_client_SOURCES = \
test-libappindicator-status-client.c
test_libappindicator_status_client_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_status_client_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
#########################################
@@ -93,12 +93,12 @@ test_libappindicator_status_server_SOURCES = \
test-libappindicator-status-server.c
test_libappindicator_status_server_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_status_server_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
#########################################
@@ -109,24 +109,24 @@ test_libappindicator_fallback_watcher_SOURCES = \
test-libappindicator-fallback-watcher.c
test_libappindicator_fallback_watcher_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_fallback_watcher_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
test_libappindicator_fallback_item_SOURCES = \
test-libappindicator-fallback-item.c
test_libappindicator_fallback_item_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_libappindicator_fallback_item_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
test-libappindicator-fallback: test-libappindicator-fallback-watcher test-libappindicator-fallback-item Makefile.am
@@ -185,11 +185,11 @@ test_simple_app_SOURCES = \
test-simple-app.c
test_simple_app_CFLAGS = \
- $(LIBRARY_CFLAGS) \
+ $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \
-Wall -Werror \
-I$(top_srcdir)/src
test_simple_app_LDADD = \
- $(LIBRARY_LIBS) \
+ $(TESTDEPS_LIBS) $(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
diff --git a/tests/test-libappindicator-dbus-client.c b/tests/test-libappindicator-dbus-client.c
index 1500213..9a51792 100644
--- a/tests/test-libappindicator-dbus-client.c
+++ b/tests/test-libappindicator-dbus-client.c
@@ -206,8 +206,6 @@ main (gint argc, gchar * argv[])
{
g_type_init();
- g_usleep(500000);
-
GError * error = NULL;
DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
if (error != NULL) {
@@ -230,8 +228,10 @@ main (gint argc, gchar * argv[])
dbus_connection_add_filter(dbus_g_connection_get_connection(session_bus), dbus_filter, NULL, NULL);
+ g_usleep(500000);
+
DBusGProxy * props = dbus_g_proxy_new_for_name_owner(session_bus,
- ":1.0",
+ ":1.2",
"/org/ayatana/NotificationItem/my_id",
DBUS_INTERFACE_PROPERTIES,
&error);
@@ -244,35 +244,35 @@ main (gint argc, gchar * argv[])
"Get",
prop_id_cb,
NULL, NULL,
- G_TYPE_STRING, "org.ayatana.indicator.application.NotificationItem",
+ G_TYPE_STRING, NOTIFICATION_ITEM_DBUS_IFACE,
G_TYPE_STRING, "Id",
G_TYPE_INVALID);
dbus_g_proxy_begin_call (props,
"Get",
prop_category_cb,
NULL, NULL,
- G_TYPE_STRING, "org.ayatana.indicator.application.NotificationItem",
+ G_TYPE_STRING, NOTIFICATION_ITEM_DBUS_IFACE,
G_TYPE_STRING, "Category",
G_TYPE_INVALID);
dbus_g_proxy_begin_call (props,
"Get",
prop_status_cb,
NULL, NULL,
- G_TYPE_STRING, "org.ayatana.indicator.application.NotificationItem",
+ G_TYPE_STRING, NOTIFICATION_ITEM_DBUS_IFACE,
G_TYPE_STRING, "Status",
G_TYPE_INVALID);
dbus_g_proxy_begin_call (props,
"Get",
prop_icon_name_cb,
NULL, NULL,
- G_TYPE_STRING, "org.ayatana.indicator.application.NotificationItem",
+ G_TYPE_STRING, NOTIFICATION_ITEM_DBUS_IFACE,
G_TYPE_STRING, "IconName",
G_TYPE_INVALID);
dbus_g_proxy_begin_call (props,
"Get",
prop_attention_icon_name_cb,
NULL, NULL,
- G_TYPE_STRING, "org.ayatana.indicator.application.NotificationItem",
+ G_TYPE_STRING, NOTIFICATION_ITEM_DBUS_IFACE,
G_TYPE_STRING, "AttentionIconName",
G_TYPE_INVALID);
diff --git a/tests/test-libappindicator-dbus-server.c b/tests/test-libappindicator-dbus-server.c
index 995d49b..744ac0e 100644
--- a/tests/test-libappindicator-dbus-server.c
+++ b/tests/test-libappindicator-dbus-server.c
@@ -21,8 +21,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <gtk/gtk.h>
#include <app-indicator.h>
#include "test-defines.h"
@@ -41,8 +39,6 @@ main (gint argc, gchar * argv[])
{
gtk_init(&argc, &argv);
- g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL))));
-
AppIndicator * ci = app_indicator_new (TEST_ID, TEST_ICON_NAME, TEST_CATEGORY);
app_indicator_set_status (ci, TEST_STATE);