aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-09 16:10:22 -0600
committerTed Gould <ted@gould.cx>2015-02-09 16:10:22 -0600
commit99ccf6fa240695e7b5f22bcc2637d5f72c96d241 (patch)
tree5191db0e1f1f1e600d2829a16ebf15d5142883d8 /tests
parente1f522fc6d3cb172df021be150454bbeb5602ac7 (diff)
downloadayatana-indicator-sound-99ccf6fa240695e7b5f22bcc2637d5f72c96d241.tar.gz
ayatana-indicator-sound-99ccf6fa240695e7b5f22bcc2637d5f72c96d241.tar.bz2
ayatana-indicator-sound-99ccf6fa240695e7b5f22bcc2637d5f72c96d241.zip
Connect the tests together.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/notifications-test.cc9
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4e3cdfa..6e30bf5 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -201,6 +201,7 @@ target_link_libraries (
notifications-test
indicator-sound-service-lib
vala-mocks-lib
+ pulse-mock
gtest
${SOUNDSERVICE_LIBRARIES}
${TEST_LIBRARIES}
diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc
index 05a5da5..6e531fd 100644
--- a/tests/notifications-test.cc
+++ b/tests/notifications-test.cc
@@ -17,6 +17,8 @@
* Ted Gould <ted@canonical.com>
*/
+#include <memory>
+
#include <gtest/gtest.h>
#include <gio/gio.h>
#include <libdbustest/dbus-test.h>
@@ -39,7 +41,7 @@ class NotificationsTest : public ::testing::Test
virtual void SetUp() {
service = dbus_test_service_new(NULL);
- dbus_test_service_set_bus(service, DBUS_TEST_SERVICE_BUS_BOTH);
+ dbus_test_service_set_bus(service, DBUS_TEST_SERVICE_BUS_SESSION);
notifications = std::make_shared<NotificationsMock>();
@@ -87,5 +89,10 @@ class NotificationsTest : public ::testing::Test
};
TEST_F(NotificationsTest, BasicObject) {
+ auto playerList = std::shared_ptr<MediaPlayerList>(MEDIA_PLAYER_LIST(media_player_list_mock_new()), [](MediaPlayerList * list){g_clear_object(&list);});
+ auto volumeControl = std::shared_ptr<VolumeControl>(VOLUME_CONTROL(volume_control_mock_new()), [](VolumeControl * control){g_clear_object(&control);});
+ auto soundService = std::shared_ptr<IndicatorSoundService>(indicator_sound_service_new(playerList.get(), volumeControl.get()), [](IndicatorSoundService * service){g_clear_object(&service);});
+ /* Give some time settle */
+ loop(50);
}