- 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))
+ modest_account_mgr_remove_account (account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ FALSE);
+ if (modest_account_mgr_account_exists(account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ TRUE))
+ modest_account_mgr_remove_account (account_mgr,
+ TEST_MODEST_ACCOUNT_NAME,
+ TRUE);