* tests/<all>:
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 29 Jan 2007 14:49:04 +0000 (14:49 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Mon, 29 Jan 2007 14:49:04 +0000 (14:49 +0000)
  - make unit tests work again after modest_runtime changes

pmo-trunk-r755

tests/Makefile.am
tests/check_folder-transfer.c
tests/check_update-account.c

index bc4b7a5..71d06e4 100644 (file)
@@ -45,10 +45,15 @@ objects=\
         ${top_srcdir}/src/modest-cache-mgr.o \
         ${top_srcdir}/src/modest-protocol-info.o \
         ${top_srcdir}/src/modest-formatter.o \
+       ${top_srcdir}/src/modest-runtime.o \
+       ${top_srcdir}/src/modest-singletons.o \
         ${top_srcdir}/src/modest-pair.o \
         ${top_srcdir}/src/modest-marshal.o \
+       ${top_srcdir}/src/modest-widget-memory.o \
+       ${top_srcdir}/src/modest-icon-factory.o \
         ${top_srcdir}/src/modest-tny-account-store.o \
         ${top_srcdir}/src/modest-tny-platform-factory.o \
+       ${top_srcdir}/src/modest-widget-factory.o \
         ${top_srcdir}/src/modest-mail-operation-queue.o \
         ${top_srcdir}/src/modest-mail-operation.o \
         ${top_srcdir}/src/modest-tny-msg-actions.o \
index 18fd3da..4709676 100644 (file)
@@ -38,7 +38,8 @@
 #include <tny-folder.h>
 #include <tny-folder-store.h>
 #include <modest-tny-platform-factory.h>
-
+#include <modest-widget-factory.h>
+#include <modest-runtime.h>
 
 #include <modest-account-mgr.h>
 #include <modest-mail-operation.h>
@@ -106,10 +107,9 @@ main (int argc, char **argv)
        TnyStoreAccount *account;
        TnyIterator *iter;
        TnyFolder *folder_src = NULL, *folder_dst = NULL;
-       TnyPlatformFactory *fact = NULL;
        ModestAccountMgr *acc_mgr = NULL;
        ModestMailOperation *mail_op = NULL;
-       TnyAccountStore *account_store = NULL;
+       ModestTnyAccountStore *account_store = NULL;
        guint src_num_headers = 0, dst_num_headers = 0;
        GError *err;
     
@@ -125,9 +125,8 @@ main (int argc, char **argv)
        }
        g_option_context_free (context);
 
-       fact = TNY_PLATFORM_FACTORY (modest_tny_platform_factory_get_instance ());
-       acc_mgr = MODEST_ACCOUNT_MGR (modest_tny_platform_factory_get_account_mgr_instance (MODEST_TNY_PLATFORM_FACTORY (fact)));
-       account_store = tny_platform_factory_new_account_store (fact);  
+       acc_mgr = modest_runtime_get_account_mgr ();
+       account_store = modest_runtime_get_account_store();
 
        if (cachedir)
                g_print ("Using %s as cache directory\n", cachedir);
@@ -140,8 +139,9 @@ main (int argc, char **argv)
        /* Get accounts */
        accounts = tny_simple_list_new ();
 
-       tny_account_store_get_accounts (account_store, accounts,
-             TNY_ACCOUNT_STORE_STORE_ACCOUNTS);
+       tny_account_store_get_accounts (TNY_ACCOUNT_STORE(account_store),
+                                       accounts,
+                                       TNY_ACCOUNT_STORE_STORE_ACCOUNTS);
     
        iter = tny_list_create_iterator (accounts);
        account = (TnyStoreAccount*) tny_iterator_get_current (iter);
index 31a60d9..70191d0 100644 (file)
@@ -39,7 +39,7 @@
 #include <tny-folder.h>
 #include <tny-folder-store.h>
 
-#include "modest-tny-platform-factory.h"
+#include <modest-runtime.h>
 #include "modest-account-mgr.h"
 #include "modest-mail-operation.h"
 #include "modest-mail-operation-queue.h"
@@ -67,21 +67,18 @@ func (gpointer_data)
 {
        TnyStoreAccount *account;
        TnyIterator *iter;
-       TnyPlatformFactory *fact = NULL;
        ModestAccountMgr *acc_mgr = NULL;
        ModestMailOperation *mail_op = NULL;
        ModestMailOperationQueue *queue = NULL;
-       TnyAccountStore *account_store = NULL;
+       ModestTnyAccountStore *account_store = NULL;
        TnyList *accounts;
 
-       fact = TNY_PLATFORM_FACTORY (modest_tny_platform_factory_get_instance ());
-       acc_mgr = MODEST_ACCOUNT_MGR (modest_tny_platform_factory_get_account_mgr_instance (MODEST_TNY_PLATFORM_FACTORY (fact)));
-       account_store = tny_platform_factory_new_account_store (fact);  
+       acc_mgr       = modest_runtime_get_account_mgr();
+       account_store = modest_runtime_get_account_store();
 
        /* Get accounts */
        accounts = tny_simple_list_new ();
-
-       tny_account_store_get_accounts (account_store, accounts,
+       tny_account_store_get_accounts (TNY_ACCOUNT_STORE(account_store), accounts,
                                        TNY_ACCOUNT_STORE_STORE_ACCOUNTS);
     
        iter = tny_list_create_iterator (accounts);
@@ -90,7 +87,7 @@ func (gpointer_data)
        g_object_unref (G_OBJECT (iter));
        g_object_unref (G_OBJECT (accounts));
 
-       queue = modest_tny_platform_factory_get_mail_operation_queue_instance (MODEST_TNY_PLATFORM_FACTORY (fact));
+       queue   = modest_runtime_get_mail_operation_queue ();
        mail_op = modest_mail_operation_new ();
        
        g_signal_connect (G_OBJECT (mail_op), "progress_changed",