diff options
-rw-r--r-- | tests/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tests/accounts-service-user.cc | 15 |
2 files changed, 19 insertions, 4 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e6a5f34..b25b20a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -26,6 +26,12 @@ add_test(name-watch-test name-watch-test) include_directories(${CMAKE_SOURCE_DIR}/src) add_executable (accounts-service-user-test accounts-service-user.cc) -target_link_libraries (accounts-service-user-test gtest ${SOUNDSERVICE_LIBRARIES} ${TEST_LIBRARIES}) +target_link_libraries ( + accounts-service-user-test + indicator-sound-service-lib + gtest + ${SOUNDSERVICE_LIBRARIES} + ${TEST_LIBRARIES} +) add_test(accounts-service-user-test accounts-service-user-test) 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); } |