summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dbus/test-log-manager.c8
-rw-r--r--tests/dbus/test-tpl-log-store-pidgin.c8
-rw-r--r--tests/dbus/test-tpl-log-store-sqlite.c8
-rw-r--r--tests/dbus/test-tpl-log-store-xml.c41
4 files changed, 43 insertions, 22 deletions
diff --git a/tests/dbus/test-log-manager.c b/tests/dbus/test-log-manager.c
index 768419c..f345c8b 100644
--- a/tests/dbus/test-log-manager.c
+++ b/tests/dbus/test-log-manager.c
@@ -156,6 +156,7 @@ setup_service (TestCaseFixture* fixture,
GValue *boxed_params;
GHashTable *params = (GHashTable *) user_data;
GError *error = NULL;
+ TpClientFactory *factory;
g_assert (params != NULL);
@@ -184,7 +185,10 @@ setup_service (TestCaseFixture* fixture,
tp_dbus_daemon_register_object (fixture->dbus, account_path,
fixture->account_service);
- fixture->account = tp_account_new (fixture->dbus, account_path, NULL);
+ factory = tp_automatic_client_factory_new (fixture->dbus);
+
+ fixture->account = tp_client_factory_ensure_account (factory, account_path,
+ NULL, NULL);
g_assert (fixture->account != NULL);
tp_proxy_prepare_async (fixture->account, account_features,
account_prepare_cb, fixture);
@@ -194,6 +198,8 @@ setup_service (TestCaseFixture* fixture,
TP_ACCOUNT_FEATURE_CORE));
tp_g_value_slice_free (boxed_params);
+
+ g_object_unref (factory);
}
diff --git a/tests/dbus/test-tpl-log-store-pidgin.c b/tests/dbus/test-tpl-log-store-pidgin.c
index 3760cc5..2af5323 100644
--- a/tests/dbus/test-tpl-log-store-pidgin.c
+++ b/tests/dbus/test-tpl-log-store-pidgin.c
@@ -118,6 +118,7 @@ setup_service (PidginTestCaseFixture* fixture,
GValue *boxed_params;
GHashTable *params = (GHashTable *) user_data;
GError *error = NULL;
+ TpClientFactory *factory;
g_assert (params != NULL);
@@ -146,7 +147,10 @@ setup_service (PidginTestCaseFixture* fixture,
tp_dbus_daemon_register_object (fixture->dbus, account_path,
fixture->account_service);
- fixture->account = tp_account_new (fixture->dbus, account_path, NULL);
+ factory = tp_automatic_client_factory_new (fixture->dbus);
+
+ fixture->account = tp_client_factory_ensure_account (factory, account_path,
+ NULL, NULL);
g_assert (fixture->account != NULL);
tp_proxy_prepare_async (fixture->account, account_features,
account_prepare_cb, fixture);
@@ -156,6 +160,8 @@ setup_service (PidginTestCaseFixture* fixture,
TP_ACCOUNT_FEATURE_CORE));
tp_g_value_slice_free (boxed_params);
+
+ g_object_unref (factory);
}
static void
diff --git a/tests/dbus/test-tpl-log-store-sqlite.c b/tests/dbus/test-tpl-log-store-sqlite.c
index f23e832..b531d96 100644
--- a/tests/dbus/test-tpl-log-store-sqlite.c
+++ b/tests/dbus/test-tpl-log-store-sqlite.c
@@ -12,6 +12,7 @@ main (int argc, char **argv)
TpDBusDaemon *bus;
TpAccount *account;
GError *error = NULL;
+ TpClientFactory *factory;
g_type_init ();
@@ -20,9 +21,11 @@ main (int argc, char **argv)
bus = tp_dbus_daemon_dup (&error);
g_assert_no_error (error);
- account = tp_account_new (bus,
+ factory = tp_automatic_client_factory_new (bus);
+
+ account = tp_client_factory_ensure_account (factory,
TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/danielle_2emadeley_40collabora_2eco_2euk0",
- &error);
+ NULL, &error);
g_assert_no_error (error);
store = _tpl_log_store_sqlite_dup ();
@@ -33,5 +36,6 @@ main (int argc, char **argv)
g_object_unref (store);
g_object_unref (account);
+ g_object_unref (factory);
g_object_unref (bus);
}
diff --git a/tests/dbus/test-tpl-log-store-xml.c b/tests/dbus/test-tpl-log-store-xml.c
index ead136a..070709c 100644
--- a/tests/dbus/test-tpl-log-store-xml.c
+++ b/tests/dbus/test-tpl-log-store-xml.c
@@ -20,6 +20,7 @@ typedef struct
gchar *tmp_basedir;
TplLogStore *store;
TpDBusDaemon *bus;
+ TpClientFactory *factory;
} XmlTestCaseFixture;
@@ -60,6 +61,9 @@ setup (XmlTestCaseFixture* fixture,
fixture->bus = tp_tests_dbus_daemon_dup_or_die ();
g_assert (fixture->bus != NULL);
+ fixture->factory = tp_automatic_client_factory_new (fixture->bus);
+ g_assert (fixture->factory != NULL);
+
tp_debug_divert_messages (g_getenv ("TPL_LOGFILE"));
#ifdef ENABLE_DEBUG
@@ -104,8 +108,9 @@ teardown (XmlTestCaseFixture *fixture,
g_free (fixture->tmp_basedir);
}
- if (fixture->store == NULL)
- g_object_unref (fixture->store);
+ tp_clear_object (&fixture->store);
+ tp_clear_object (&fixture->factory);
+ tp_clear_object (&fixture->bus);
}
@@ -157,9 +162,9 @@ test_clear_account (XmlTestCaseFixture *fixture,
tpl_log_manager_search_free (hits);
- account = tp_account_new (fixture->bus,
+ account = tp_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);
@@ -224,9 +229,9 @@ test_clear_entity (XmlTestCaseFixture *fixture,
tpl_log_manager_search_free (hits);
- account = tp_account_new (fixture->bus,
+ account = tp_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);
@@ -312,9 +317,9 @@ test_add_text_event (XmlTestCaseFixture *fixture,
GList *events;
gint64 timestamp = time (NULL);
- account = tp_account_new (fixture->bus,
+ account = tp_client_factory_ensure_account (fixture->factory,
TP_ACCOUNT_OBJECT_PATH_BASE "idle/irc/me",
- &error);
+ NULL, &error);
g_assert_no_error (error);
g_assert (account != NULL);
@@ -483,9 +488,9 @@ test_add_superseding_event (XmlTestCaseFixture *fixture,
GList *superseded;
gint64 timestamp = time (NULL);
- account = tp_account_new (fixture->bus,
+ account = tp_client_factory_ensure_account (fixture->factory,
TP_ACCOUNT_OBJECT_PATH_BASE "idle/irc/me",
- &error);
+ NULL, &error);
g_assert_no_error (error);
g_assert (account != NULL);
@@ -735,9 +740,9 @@ test_add_call_event (XmlTestCaseFixture *fixture,
GList *events;
gint64 timestamp = time (NULL);
- account = tp_account_new (fixture->bus,
+ account = tp_client_factory_ensure_account (fixture->factory,
TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/me",
- &error);
+ NULL, &error);
g_assert_no_error (error);
g_assert (account != NULL);
@@ -871,15 +876,15 @@ test_exists (XmlTestCaseFixture *fixture,
TplEntity *user2, *user3;
GError *error = NULL;
- account1 = tp_account_new (fixture->bus,
+ account1 = tp_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_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);
@@ -928,9 +933,9 @@ test_get_events_for_date (XmlTestCaseFixture *fixture,
GError *error = NULL;
gint idx;
- account = tp_account_new (fixture->bus,
+ account = tp_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);