diff options
author | Ted Gould <ted@gould.cx> | 2014-02-11 21:29:30 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-02-11 21:29:30 -0600 |
commit | 3dceea54230f478ca188b4987ef352e13ea09f69 (patch) | |
tree | e22e6fe6bd007a6f98db9c11a35eafcb372952e0 /tests | |
parent | 66edc177867c09e696552a73862c29485194e704 (diff) | |
download | ayatana-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')
-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); } |