aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-02-12 13:39:53 -0600
committerTed Gould <ted@gould.cx>2014-02-12 13:39:53 -0600
commit691f7056cc888444b55ad1a6a6949926162cffe4 (patch)
tree8339af12fe3573b25e5883b105eb6b8fcc59f807
parent7035341609179f1d646b3c48df79c15d4fa5a72f (diff)
downloadayatana-indicator-sound-691f7056cc888444b55ad1a6a6949926162cffe4.tar.gz
ayatana-indicator-sound-691f7056cc888444b55ad1a6a6949926162cffe4.tar.bz2
ayatana-indicator-sound-691f7056cc888444b55ad1a6a6949926162cffe4.zip
Ensuring we can allocate the player, add it to an object, and woot!
-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);
+}