diff options
-rw-r--r-- | tests/Makefile.am | 34 | ||||
-rw-r--r-- | tests/mockpulse.h | 24 | ||||
-rw-r--r-- | tests/test-indicator-sound.c | 7 | ||||
-rw-r--r-- | tests/test-pulse-manager.c | 25 |
4 files changed, 75 insertions, 15 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index bbae7fe..7573ea5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,11 +4,13 @@ check_PROGRAMS = \ test-indicator-sound-dbus-client \ test-indicator-sound-dbus-server -TESTS = test-indicator-sound +TESTS = \ + test-indicator-sound \ + test-pulse-manager DISTCLEANFILES = $(TESTS) noinst_LTLIBRARIES = libmockpulse.la -libmockpulse_la_SOURCES = mockpulse.c +libmockpulse_la_SOURCES = mockpulse.c mockpulse.h libmockpulse_la_CFLAGS = $(PULSEAUDIO_CFLAGS) @@ -45,10 +47,9 @@ test_indicator_sound_dbus_client_CFLAGS = \ $(SOUNDSERVICE_CFLAGS) \ -Wall -Werror \ -I$(srcdir) \ - -I$(SOUNDSERVICE_CFLAGS) + -I$(SOUNDSERVICE_CFLAGS) test_indicator_sound_dbus_client_LDADD = \ - libmockpulse.la \ $(PULSEAUDIO_LIBS) \ $(SOUNDSERVICE_LIBS) @@ -69,9 +70,32 @@ test_indicator_sound_dbus_server_CFLAGS = \ -I$(srcdir) test_indicator_sound_dbus_server_LDADD = \ - $(SOUNDSERVICE_LIBS) \ + $(SOUNDSERVICE_LIBS) \ $(PULSEAUDIO_LIBS) +######################################### +## test-pulse-manager +######################################### + +check_PROGRAMS += test-pulse-manager + +test_pulse_manager_SOURCES = \ + test-pulse-manager.c + +test_pulse_manager_CFLAGS = \ + $(PULSEAUDIO_CFLAGS) \ + $(SOUNDSERVICE_CFLAGS) \ + $(GCONF_CFLAGS) \ + -Wall -Werror \ + -I$(srcdir) \ + -I$(SOUNDSERVICE_CFLAGS) + +test_pulse_manager_LDADD = \ + libmockpulse.la \ + $(PULSEAUDIO_LIBS) \ + $(SOUNDSERVICE_LIBS) \ + $(GCONF_LIBS) + ######################################### ## Actual tests diff --git a/tests/mockpulse.h b/tests/mockpulse.h new file mode 100644 index 0000000..521ba2b --- /dev/null +++ b/tests/mockpulse.h @@ -0,0 +1,24 @@ +/* +Copyright 2010 Canonical Ltd. + +Authors: + Robert Collins <robert.collins@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +/** + * Control interface for the mocked pa-glib-mainloop test library + */ +#include <pulse/glib-mainloop.h> + diff --git a/tests/test-indicator-sound.c b/tests/test-indicator-sound.c index 1d3569a..35d950c 100644 --- a/tests/test-indicator-sound.c +++ b/tests/test-indicator-sound.c @@ -20,7 +20,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <string.h> #include <gtk/gtk.h> #include <libindicator/indicator-object.h> -#include <pulse/glib-mainloop.h> #include "../src/indicator-sound.h" static const gint STATE_MUTED = 0; @@ -86,11 +85,6 @@ void test_libindicator_image_names() tidy_up_hash(); } -void test_libindicator_pa_mocked() -{ g_assert(pa_glib_mainloop_new(NULL) == NULL); -} - - gint main (gint argc, gchar * argv[]) { @@ -100,7 +94,6 @@ gint main (gint argc, gchar * argv[]) g_test_add_func("/indicator-sound/indicator-sound/init", test_libindicator_sound_init); g_test_add_func("/indicator-sound/indicator-sound/state_machine", test_libindicator_determine_state); g_test_add_func("/indicator-sound/indicator-sound/image_names", test_libindicator_image_names); - g_test_add_func("/indicator-sound/indicator-sound/pa_is_mocked", test_libindicator_pa_mocked); return g_test_run (); } diff --git a/tests/test-pulse-manager.c b/tests/test-pulse-manager.c index f05bccb..2bc1c51 100644 --- a/tests/test-pulse-manager.c +++ b/tests/test-pulse-manager.c @@ -1,6 +1,25 @@ -#include "defintions.h" -// I know this is not nice but I would rather not make everything public ? -#include "pulse-manager.c" +/* +Copyright 2010 Canonical Ltd. + +Authors: + Robert Collins <robert.collins@canonical.com> + Conor Curran <conor.curran@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +/* we test static functions */ +#include "../src/pulse-manager.c" pa_context* context; |