aboutsummaryrefslogtreecommitdiff
path: root/tests/accounts-service-user.cc
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-02-11 21:29:30 -0600
committerTed Gould <ted@gould.cx>2014-02-11 21:29:30 -0600
commit3dceea54230f478ca188b4987ef352e13ea09f69 (patch)
treee22e6fe6bd007a6f98db9c11a35eafcb372952e0 /tests/accounts-service-user.cc
parent66edc177867c09e696552a73862c29485194e704 (diff)
downloadayatana-indicator-sound-3dceea54230f478ca188b4987ef352e13ea09f69.tar.gz
ayatana-indicator-sound-3dceea54230f478ca188b4987ef352e13ea09f69.tar.bz2
ayatana-indicator-sound-3dceea54230f478ca188b4987ef352e13ea09f69.zip
Allocating an object and working around libaccountsservice0
Diffstat (limited to 'tests/accounts-service-user.cc')
-rw-r--r--tests/accounts-service-user.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/accounts-service-user.cc b/tests/accounts-service-user.cc
index db79d14..ff1debc 100644
--- a/tests/accounts-service-user.cc
+++ b/tests/accounts-service-user.cc
@@ -20,6 +20,7 @@
#include <gtest/gtest.h>
#include <gio/gio.h>
#include <libdbustest/dbus-test.h>
+#include <act/act.h>
extern "C" {
#include "indicator-sound-service.h"
@@ -50,13 +51,20 @@ 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());
+ g_object_unref(system);
+ g_object_unref(system);
+ g_object_unref(system);
+ /* End shitty untested library cleanup */
+
g_clear_object(&service);
g_object_unref(session);
g_object_unref(system);
unsigned int cleartry = 0;
- while (session != NULL && system != NULL && cleartry < 100) {
+ while ((session != NULL || system != NULL) && cleartry < 100) {
loop(100);
cleartry++;
}
@@ -80,6 +88,7 @@ class AccountsServiceUserTest : public ::testing::Test
};
TEST_F(AccountsServiceUserTest, BasicObject) {
-
-
+ AccountsServiceUser * srv = accounts_service_user_new();
+ loop(50);
+ g_object_unref(srv);
}