static void
fx_setup_default_account_mgr ()
{
- ModestConf *conf = NULL;
-
- g_type_init ();
-
- conf = modest_conf_new ();
- fail_unless (MODEST_IS_CONF (conf),
- "modest_conf_new failed");
-
- account_mgr = modest_account_mgr_new (conf);
- fail_unless (MODEST_IS_ACCOUNT_MGR (account_mgr),
- "modest_account_mgr_new failed");
+ ModestConf *conf = NULL;
+
+ g_type_init ();
+
+ conf = modest_conf_new ();
+ fail_unless (MODEST_IS_CONF (conf),
+ "modest_conf_new failed");
+
+ account_mgr = modest_account_mgr_new (conf);
+ fail_unless (MODEST_IS_ACCOUNT_MGR (account_mgr),
+ "modest_account_mgr_new failed");
+
+ /* cleanup old garbage (from previous runs)*/
+ if (modest_account_mgr_account_exists(account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ FALSE, NULL))
+ modest_account_mgr_remove_account (account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ FALSE,
+ NULL);
+ if (modest_account_mgr_account_exists(account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ TRUE, NULL))
+ modest_account_mgr_remove_account (account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ TRUE,
+ NULL);
}
static void
gchar *proto = NULL;
GError *error = NULL;
gboolean result;
-
+
name = g_strdup (TEST_MODEST_ACCOUNT_NAME);
-
/* Test 1 */
store_account = g_strdup ("imap://me@myserver");
transport_account = g_strdup ("local-smtp");
"modest_account_mgr_remove_account failed:\nname: %s\nerror: %s",
name, error ? error->message : "");
+
/* Test 4 */
hostname = g_strdup ("myhostname.mydomain.com");
username = g_strdup ("myusername");
g_free (username);
g_free (password);
g_free (proto);
-
+
/* Test 5 */
result = modest_account_mgr_account_exists (account_mgr,
name,