From 3dceea54230f478ca188b4987ef352e13ea09f69 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 11 Feb 2014 21:29:30 -0600 Subject: Allocating an object and working around libaccountsservice0 --- tests/accounts-service-user.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tests/accounts-service-user.cc') 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 #include #include +#include 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); } -- cgit v1.2.3