* update for ModestProtocolInfo stuff, and yes, checks pass
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 15 Jan 2007 10:51:46 +0000 (10:51 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 15 Jan 2007 10:51:46 +0000 (10:51 +0000)
pmo-trunk-r627

tests/Makefile.am
tests/check_account-mgr.c

index 2c54691..48d9d23 100644 (file)
@@ -43,8 +43,7 @@ objects=\
         ${top_srcdir}/src/modest-account-mgr.o \
         ${top_srcdir}/src/modest-tny-platform-factory.o \
         ${top_srcdir}/src/modest-conf.o \
         ${top_srcdir}/src/modest-account-mgr.o \
         ${top_srcdir}/src/modest-tny-platform-factory.o \
         ${top_srcdir}/src/modest-conf.o \
-        ${top_srcdir}/src/modest-protocol-mgr.o \
-        ${top_srcdir}/src/modest-proto.o \
+        ${top_srcdir}/src/modest-protocol-info.o \
         ${top_srcdir}/src/modest-formatter.o \
         ${top_srcdir}/src/modest-presets.o \
         ${top_srcdir}/src/modest-pair.o \
         ${top_srcdir}/src/modest-formatter.o \
         ${top_srcdir}/src/modest-presets.o \
         ${top_srcdir}/src/modest-pair.o \
index ffb052d..dd4e6e1 100644 (file)
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <modest-conf.h>
 #include <modest-account-mgr.h>
 #include <string.h>
 #include <modest-conf.h>
 #include <modest-account-mgr.h>
+#include <modest-protocol-info.h>
 
 /* ----------------------- Defines ---------------------- */
 
 
 /* ----------------------- Defines ---------------------- */
 
@@ -105,7 +106,7 @@ START_TEST (test_add_exists_remove_account_regular)
        gchar *hostname = NULL;
        gchar *username = NULL;
        gchar *password = NULL;
        gchar *hostname = NULL;
        gchar *username = NULL;
        gchar *password = NULL;
-       gchar *proto = NULL;
+       ModestProtocol proto;
        GError *error = NULL;
        gboolean result;
        
        GError *error = NULL;
        gboolean result;
        
@@ -152,7 +153,7 @@ START_TEST (test_add_exists_remove_account_regular)
        hostname = g_strdup ("myhostname.mydomain.com");
        username = g_strdup ("myusername");
        password = g_strdup ("mypassword");
        hostname = g_strdup ("myhostname.mydomain.com");
        username = g_strdup ("myusername");
        password = g_strdup ("mypassword");
-       proto = g_strdup ("smtp");
+       proto = MODEST_PROTOCOL_TRANSPORT_SMTP;
        result = modest_account_mgr_add_server_account (account_mgr,
                                                        name,
                                                        hostname,
        result = modest_account_mgr_add_server_account (account_mgr,
                                                        name,
                                                        hostname,
@@ -167,7 +168,6 @@ START_TEST (test_add_exists_remove_account_regular)
        g_free (hostname);
        g_free (username);
        g_free (password);
        g_free (hostname);
        g_free (username);
        g_free (password);
-       g_free (proto);
        
        /* Test 5 */
        result = modest_account_mgr_account_exists (account_mgr,
        
        /* Test 5 */
        result = modest_account_mgr_account_exists (account_mgr,
@@ -273,7 +273,7 @@ START_TEST (test_add_exists_remove_account_invalid)
                                                        "hostname",
                                                        "username",
                                                        "password",
                                                        "hostname",
                                                        "username",
                                                        "password",
-                                                       "proto");
+                                                       MODEST_PROTOCOL_STORE_IMAP);
        fail_unless (!result,
                     "modest_account_mgr_add_server_account does not return " \
                     "FALSE when passing a NULL ModestAccountMgr");
        fail_unless (!result,
                     "modest_account_mgr_add_server_account does not return " \
                     "FALSE when passing a NULL ModestAccountMgr");
@@ -284,7 +284,7 @@ START_TEST (test_add_exists_remove_account_invalid)
                                                        "hostname",
                                                        "username",
                                                        "password",
                                                        "hostname",
                                                        "username",
                                                        "password",
-                                                       "proto");
+                                                       MODEST_PROTOCOL_STORE_IMAP);
        fail_unless (!result,
                     "modest_account_mgr_add_server_account does not return " \
                     "FALSE when passing a NULL account name");
        fail_unless (!result,
                     "modest_account_mgr_add_server_account does not return " \
                     "FALSE when passing a NULL account name");
@@ -295,7 +295,7 @@ START_TEST (test_add_exists_remove_account_invalid)
                                                        "hostname", 
                                                        "username", 
                                                        "password", 
                                                        "hostname", 
                                                        "username", 
                                                        "password", 
-                                                       "proto"); 
+                                                       MODEST_PROTOCOL_STORE_IMAP); 
        fail_unless (!result, 
                     "modest_account_mgr_add_server_account does not return " \
                     "FALSE when passing an invalid account name"); 
        fail_unless (!result, 
                     "modest_account_mgr_add_server_account does not return " \
                     "FALSE when passing an invalid account name");