From 03d9bee69ca5dc45c59e5083bbc521459b8b0c03 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 24 Sep 2013 11:36:31 +0200 Subject: stop using tp_account_new() https://bugs.freedesktop.org/show_bug.cgi?id=69797 --- tests/dbus/test-tpl-log-store-xml.c | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'tests/dbus/test-tpl-log-store-xml.c') diff --git a/tests/dbus/test-tpl-log-store-xml.c b/tests/dbus/test-tpl-log-store-xml.c index 4351f73..132d302 100644 --- a/tests/dbus/test-tpl-log-store-xml.c +++ b/tests/dbus/test-tpl-log-store-xml.c @@ -7,6 +7,7 @@ #include "telepathy-logger/debug-internal.h" #include "telepathy-logger/log-manager-internal.h" #include "telepathy-logger/log-store-internal.h" +#include #include #include @@ -21,6 +22,7 @@ typedef struct gchar *tmp_basedir; TplLogStore *store; TpDBusDaemon *bus; + TpSimpleClientFactory *factory; } XmlTestCaseFixture; @@ -39,6 +41,8 @@ setup (XmlTestCaseFixture* fixture, fixture->bus = tp_tests_dbus_daemon_dup_or_die (); g_assert (fixture->bus != NULL); + fixture->factory = _tpl_client_factory_dup (fixture->bus); + tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); #ifdef ENABLE_DEBUG @@ -85,6 +89,8 @@ teardown (XmlTestCaseFixture *fixture, if (fixture->store == NULL) g_object_unref (fixture->store); + + g_clear_object (&fixture->factory); } @@ -136,9 +142,9 @@ test_clear_account (XmlTestCaseFixture *fixture, tpl_log_manager_search_free (hits); - account = tp_account_new (fixture->bus, + account = tp_simple_client_factory_ensure_account (fixture->factory, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/test2_40collabora_2eco_2euk0", - &error); + NULL, &error); g_assert_no_error (error); g_assert (account != NULL); @@ -203,9 +209,9 @@ test_clear_entity (XmlTestCaseFixture *fixture, tpl_log_manager_search_free (hits); - account = tp_account_new (fixture->bus, + account = tp_simple_client_factory_ensure_account (fixture->factory, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/test2_40collabora_2eco_2euk0", - &error); + NULL, &error); g_assert_no_error (error); g_assert (account != NULL); @@ -291,9 +297,8 @@ test_add_text_event (XmlTestCaseFixture *fixture, GList *events; gint64 timestamp = time (NULL); - account = tp_account_new (fixture->bus, - TP_ACCOUNT_OBJECT_PATH_BASE "idle/irc/me", - &error); + account = tp_simple_client_factory_ensure_account (fixture->factory, + TP_ACCOUNT_OBJECT_PATH_BASE "idle/irc/me", NULL, &error); g_assert_no_error (error); g_assert (account != NULL); @@ -462,9 +467,8 @@ test_add_superseding_event (XmlTestCaseFixture *fixture, GList *superseded; gint64 timestamp = time (NULL); - account = tp_account_new (fixture->bus, - TP_ACCOUNT_OBJECT_PATH_BASE "idle/irc/me", - &error); + account = tp_simple_client_factory_ensure_account (fixture->factory, + TP_ACCOUNT_OBJECT_PATH_BASE "idle/irc/me", NULL, &error); g_assert_no_error (error); g_assert (account != NULL); @@ -714,9 +718,8 @@ test_add_call_event (XmlTestCaseFixture *fixture, GList *events; gint64 timestamp = time (NULL); - account = tp_account_new (fixture->bus, - TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/me", - &error); + account = tp_simple_client_factory_ensure_account (fixture->factory, + TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/me", NULL, &error); g_assert_no_error (error); g_assert (account != NULL); @@ -850,15 +853,15 @@ test_exists (XmlTestCaseFixture *fixture, TplEntity *user2, *user3; GError *error = NULL; - account1 = tp_account_new (fixture->bus, + account1 = tp_simple_client_factory_ensure_account (fixture->factory, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/test2_40collabora_2eco_2euk0", - &error); + NULL, &error); g_assert_no_error (error); g_assert (account1 != NULL); - account2 = tp_account_new (fixture->bus, + account2 = tp_simple_client_factory_ensure_account (fixture->factory, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/user_40collabora_2eco_2euk", - &error); + NULL, &error); g_assert_no_error (error); g_assert (account1 != NULL); @@ -907,9 +910,9 @@ test_get_events_for_date (XmlTestCaseFixture *fixture, GError *error = NULL; gint idx; - account = tp_account_new (fixture->bus, + account = tp_simple_client_factory_ensure_account (fixture->factory, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/user_40collabora_2eco_2euk", - &error); + NULL, &error); g_assert_no_error (error); g_assert (account != NULL); -- cgit v1.2.1