aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/accounts-service-user.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/accounts-service-user.cc b/tests/accounts-service-user.cc
index 2a83ee5..e36686b 100644
--- a/tests/accounts-service-user.cc
+++ b/tests/accounts-service-user.cc
@@ -24,6 +24,7 @@
extern "C" {
#include "indicator-sound-service.h"
+#include "vala-mocks.h"
}
class AccountsServiceUserTest : public ::testing::Test
@@ -107,7 +108,7 @@ class AccountsServiceUserTest : public ::testing::Test
virtual void TearDown() {
/* These are the things that libaccountservice0 doesn't clean up :-( */
g_object_unref(act_user_manager_get_default());
- for (int i = 0; i < 11; i++) {
+ for (int i = 0; i < 11 && system != NULL; i++) {
g_object_unref(system);
}
/* End shitty untested library cleanup */
@@ -116,7 +117,8 @@ class AccountsServiceUserTest : public ::testing::Test
g_clear_object(&service);
g_object_unref(session);
- g_object_unref(system);
+ if (system != NULL)
+ g_object_unref(system);
unsigned int cleartry = 0;
while ((session != NULL || system != NULL) && cleartry < 100) {
@@ -147,3 +149,15 @@ TEST_F(AccountsServiceUserTest, BasicObject) {
loop(50);
g_object_unref(srv);
}
+
+TEST_F(AccountsServiceUserTest, SetMediaPlayer) {
+ AccountsServiceUser * srv = accounts_service_user_new();
+ MediaPlayerMock * media = media_player_mock_new();
+
+ accounts_service_user_set_player(srv, MEDIA_PLAYER(media));
+
+ loop(50);
+
+ g_object_unref(media);
+ g_object_unref(srv);
+}