X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=tests%2Fcheck_account-mgr.c;h=5d79976b53f7d2a09b8f417dd4adbaaebba78841;hp=369ac3b27265c5019d5ef3715b8ad8372db7ff51;hb=2e629db997bbb18f04f12ba67315c552b8dfc65e;hpb=c5a5b586adace0a0a65316ea89ecbf52e5b08430 diff --git a/tests/check_account-mgr.c b/tests/check_account-mgr.c index 369ac3b..5d79976 100644 --- a/tests/check_account-mgr.c +++ b/tests/check_account-mgr.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -128,6 +129,19 @@ START_TEST (test_add_exists_remove_account_regular) fail_unless (result, "modest_account_mgr_account_exists failed: " \ "Account with name \"%s\" should exist.\n", name); + + /* Test 2b */ + gchar *account_name_from_recipient; + account_name_from_recipient = modest_utils_get_account_name_from_recipient ("user@email.com", NULL); + fail_unless (account_name_from_recipient != NULL, + "modest_utils_get_account_name_from_recipient failed: "\ + "From user@email.com should match account"); + + /* Test 2c */ + account_name_from_recipient = modest_utils_get_account_name_from_recipient ("egg@egg.com", NULL); + fail_unless (account_name_from_recipient == NULL, + "modest_utils_get_account_name_from_recipient failed: "\ + "From egg@egg.com shouldn't match account"); /* Test 3 */ @@ -367,7 +381,7 @@ account_mgr_suite (void) /* Tests case for "add/exists/remove account" */ tc = tcase_create ("add_exists_remove_account"); - tcase_add_unchecked_fixture (tc, + tcase_add_checked_fixture (tc, fx_setup_default_account_mgr, NULL); tcase_add_test (tc, test_add_exists_remove_account_regular); tcase_add_test (tc, test_add_exists_remove_account_invalid);