aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-03-03 15:05:08 +0000
committerConor Curran <conor.curran@canonical.com>2010-03-03 15:05:08 +0000
commit259f58ec21be89f22f478243f4c8acf9a44231f9 (patch)
tree5bd8e50cdbe31544a4277cb74b4c764d0f86eee4
parent4bde209ef0f8ad381d70b2ade7eb3cf834eed074 (diff)
downloadayatana-indicator-sound-259f58ec21be89f22f478243f4c8acf9a44231f9.tar.gz
ayatana-indicator-sound-259f58ec21be89f22f478243f4c8acf9a44231f9.tar.bz2
ayatana-indicator-sound-259f58ec21be89f22f478243f4c8acf9a44231f9.zip
tests compiling
-rw-r--r--src/dbus-menu-manager.c1
-rw-r--r--src/indicator-sound.c1
-rw-r--r--src/sound-service-dbus.c10
-rw-r--r--tests/Makefile.am70
-rw-r--r--tests/test-indicator-sound-dbus-client.c9
5 files changed, 43 insertions, 48 deletions
diff --git a/src/dbus-menu-manager.c b/src/dbus-menu-manager.c
index 652e6b2..3e33932 100644
--- a/src/dbus-menu-manager.c
+++ b/src/dbus-menu-manager.c
@@ -113,7 +113,6 @@ void dbus_menu_manager_update_mute_ui(gboolean incoming_mute_value)
dbusmenu_menuitem_property_set(mute_all_menuitem,
DBUSMENU_MENUITEM_PROP_LABEL,
(b_all_muted == FALSE ? "Mute All" : "Unmute"));
- //dbusmenu_menuitem_property_set(mute_all_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, (b_all_muted == FALSE ? _("Mute All") : _("Unmute")));
}
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 3aca517..4bdfbb7 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -238,6 +238,7 @@ static gboolean new_slider_item(DbusmenuMenuitem * newitem, DbusmenuMenuitem * p
static void
connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer userdata)
{
+ // TODO: This could be safer.
if (connected) {
if (sound_dbus_proxy == NULL) {
GError * error = NULL;
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 99a9d34..952a2d3 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -29,8 +29,7 @@
#include "sound-service-marshal.h"
#include "pulse-manager.h"
-// DBUS methods -
-// TODO - other should be static and moved from the header to here
+// DBUS methods
static gboolean sound_service_dbus_get_sink_volume(SoundServiceDbus* service, gdouble* volume_percent_input, GError** gerror);
static gboolean sound_service_dbus_get_sink_mute(SoundServiceDbus* service, gboolean* mute_input, GError** gerror);
static void sound_service_dbus_set_sink_volume(SoundServiceDbus* service, const guint volume_percent, GError** gerror);
@@ -41,7 +40,6 @@ typedef struct _SoundServiceDbusPrivate SoundServiceDbusPrivate;
struct _SoundServiceDbusPrivate
{
- DBusGConnection *system_bus;
DBusGConnection *connection;
gdouble volume_percent;
gboolean mute;
@@ -116,13 +114,10 @@ sound_service_dbus_init (SoundServiceDbus *self)
GError *error = NULL;
SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
- priv->system_bus = NULL;
priv->connection = NULL;
priv->volume_percent = 0;
- /* Get the system bus */
- priv->system_bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- /* Put the object on DBus */
+ /* Fetch the session bus */
priv->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
if (error != NULL) {
@@ -130,6 +125,7 @@ sound_service_dbus_init (SoundServiceDbus *self)
g_error_free(error);
return;
}
+ /* register the service on it */
dbus_g_connection_register_g_object(priv->connection,
"/org/ayatana/indicator/sound/service",
G_OBJECT(self));
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ad985f4..a0b990b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,8 +1,8 @@
check_PROGRAMS = \
test-indicator-sound \
- test-indicator-sound-dbus-client
-# test-indicator-sound-dbus-server
+ test-indicator-sound-dbus-client \
+ test-indicator-sound-dbus-server
TESTS =
DISTCLEANFILES = $(TESTS)
@@ -27,53 +27,49 @@ test_indicator_sound_LDADD = \
#########################################
## test-indicator-sound-dbus-client
#########################################
-
test_indicator_sound_dbus_client_SOURCES = \
test-defines.h \
- test-indicator-sound-dbus-client.c
+ test-indicator-sound-dbus-client.c
test_indicator_sound_dbus_client_CFLAGS = \
$(SOUNDSERVICE_CFLAGS) \
-Wall -Werror \
- -I$(srcdir) \
- -I$(SOUNDSERVICE_CFLAGS)
+ -I$(srcdir)
test_indicator_sound_dbus_client_LDADD = \
$(SOUNDSERVICE_LIBS)
-#########################################
-## test-indicator-sound-dbus-server
-#########################################
-#test_indicator_sound_dbus_server_SOURCES = \
-# test-defines.h
-
-#test_indicator_sound_dbus_server_CFLAGS = \
-# $(SOUNDSERVICE_CFLAGS) \
-# -Wall -Werror \
-# -I$(srcdir) \
-# -I$(SOUNDSERVICE_CFLAGS)
-
-#test_indicator_sound_dbus_server_LDADD = \
-# $(SOUNDSERVICE_LIBS) \
-# $(top_builddir)/src/indicator_sound_service-sound-service.o \
-# $(top_builddir)/src/indicator_sound_service-pulse-manager.o \
-# $(top_builddir)/src/indicator_sound_service-slider-menu-item.o \
-# $(top_builddir)/src/indicator_sound_service-sound-service-dbus.o
-
+########################################
+# test-indicator-sound-dbus-server
+########################################
+test_indicator_sound_dbus_server_SOURCES = \
+ test-defines.h \
+ test-indicator-sound-dbus-server.c \
+ $(top_builddir)/src/sound-service-dbus.c \
+ $(top_builddir)/src/pulse-manager.c \
+ $(top_builddir)/src/slider-menu-item.c \
+ $(top_builddir)/src/dbus-menu-manager.c
+
+test_indicator_sound_dbus_server_CFLAGS = \
+ $(SOUNDSERVICE_CFLAGS) \
+ -Wall -Werror \
+ -I$(srcdir)
+test_indicator_sound_dbus_server_LDADD = \
+ $(SOUNDSERVICE_LIBS)
#########################################
## Actual tests
#########################################
-#XML_REPORT = indicator-sound-check-results.xml
-#HTML_REPORT = indicator-sound-check-results.html
+XML_REPORT = indicator-sound-check-results.xml
+HTML_REPORT = indicator-sound-check-results.html
-#indicator-sound-tests: indicator-sound-tests-gtester Makefile.am
-# @echo "#!/bin/sh" > $@
-# @echo $(DBUS_RUNNER) --task ./indicator-sound-tests-gtester >> $@
-# @chmod +x $@
+indicator-sound-tests: indicator-sound-tests-gtester Makefile.am
+ @echo "#!/bin/sh" > $@
+ @echo $(DBUS_RUNNER) --task ./indicator-sound-tests-gtester >> $@
+ @chmod +x $@
indicator-sound-tests-gtester: test-indicator-sound Makefile.am
@echo "#!/bin/sh" > $@
@@ -84,14 +80,14 @@ TESTS += indicator-sound-tests
DISTCLEANFILES += $(XML_REPORT) $(HTML_REPORT) indicator-sound-tests-gtester
-#DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf
+DBUS_RUNNER=dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf
-#test-indicator-sound-dbus: test-indicator-sound-dbus-client test-indicator-sound-dbus-server Makefile.am
-# @echo "#!/bin/sh" > test-indicator-sound-dbus
-# @echo $(DBUS_RUNNER) --task ./test-indicator-sound-dbus-client --task-name Client --task ./test-indicator-sound-dbus-server --task-name Server --ignore-return >> test-indicator-sound-dbus
-# @chmod +x test-indicator-sound-dbus
+test-indicator-sound-dbus: test-indicator-sound-dbus-client test-indicator-sound-dbus-server Makefile.am
+ @echo "#!/bin/sh" > test-indicator-sound-dbus
+ @echo $(DBUS_RUNNER) --task ./test-indicator-sound-dbus-client --task-name Client --task ./test-indicator-sound-dbus-server --task-name Server --ignore-return >> test-indicator-sound-dbus
+ @chmod +x test-indicator-sound-dbus
-#TESTS += test-indicator-sound-dbus
+TESTS += test-indicator-sound-dbus
diff --git a/tests/test-indicator-sound-dbus-client.c b/tests/test-indicator-sound-dbus-client.c
index dc36ae3..08ce93e 100644
--- a/tests/test-indicator-sound-dbus-client.c
+++ b/tests/test-indicator-sound-dbus-client.c
@@ -25,7 +25,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib.h>
#include <dbus/dbus-glib.h>
#include "../src/dbus-shared-names.h"
-/*#include "../src/indicator-sound.c"*/
#include "test-defines.h"
static GMainLoop * mainloop = NULL;
@@ -78,10 +77,14 @@ main (gint argc, gchar * argv[])
}
DBusGProxy * props = dbus_g_proxy_new_for_name_owner(session_bus,
- INDICATOR_SOUND_DBUS_NAME,
+ INDICATOR_SOUND_DBUS_NAME,
INDICATOR_SOUND_SERVICE_DBUS_OBJECT,
INDICATOR_SOUND_SERVICE_DBUS_INTERFACE,
- &error);
+ &error);
+/* ":1.0",*/
+/* "/need/a/path",*/
+/* DBUS_INTERFACE_PROPERTIES,*/
+/* &error);*/
if (error != NULL) {
g_error("Unable to get property proxy: %s", error->message);
return 1;