aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check-empathy-helpers.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-10-13 15:55:25 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-10-13 15:55:25 +0800
commita5f068db869d99cd7b3423cc0110e2e69b6ec4f5 (patch)
treed2f5a465ad15e91208d16f5d629ef7b1df2e06eb /tests/check-empathy-helpers.c
parent063c6dbfe2fb57ab251fcd51060e4e326a96105f (diff)
downloadgsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.tar
gsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.tar.gz
gsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.tar.bz2
gsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.tar.lz
gsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.tar.xz
gsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.tar.zst
gsoc2013-empathy-a5f068db869d99cd7b3423cc0110e2e69b6ec4f5.zip
reuse test account instead of creating one at each test to avoid to pollute gconf DB with loooooot of unremovable accounts
svn path=/trunk/; revision=1573
Diffstat (limited to 'tests/check-empathy-helpers.c')
-rw-r--r--tests/check-empathy-helpers.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/check-empathy-helpers.c b/tests/check-empathy-helpers.c
index 370fb2922..2e808c0e7 100644
--- a/tests/check-empathy-helpers.c
+++ b/tests/check-empathy-helpers.c
@@ -64,19 +64,32 @@ copy_xml_file (const gchar *orig,
}
McAccount *
-create_test_account (void)
+get_test_account (void)
{
McProfile *profile;
McAccount *account;
+ GList *accounts;
profile = mc_profile_lookup ("test");
- account = mc_account_create (profile);
+ accounts = mc_accounts_list_by_profile (profile);
+ if (g_list_length (accounts) == 0)
+ {
+ /* need to create a test account */
+ account = mc_account_create (profile);
+ }
+ else
+ {
+ /* reuse an existing test account */
+ account = accounts->data;
+ }
g_object_unref (profile);
return account;
}
+/* Not used for now as there is no API to remove completely gconf keys.
+ * So we reuse existing accounts instead of creating new ones */
void
destroy_test_account (McAccount *account)
{