aboutsummaryrefslogtreecommitdiffstats
path: root/camel/tests/lib
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-06-12 22:29:28 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-06-12 22:29:28 +0800
commitf14e85f771600855dedae6d29301d656ea86185b (patch)
tree2a2dd4e515e0398c3f737c800c966f55acae6a38 /camel/tests/lib
parent8131304fd121b4c3b4df98a17b3a376c1bffaada (diff)
downloadgsoc2013-evolution-f14e85f771600855dedae6d29301d656ea86185b.tar.gz
gsoc2013-evolution-f14e85f771600855dedae6d29301d656ea86185b.tar.zst
gsoc2013-evolution-f14e85f771600855dedae6d29301d656ea86185b.zip
A new provider, for spool mailboxes. Mostly a cut and paste of the mbox
2001-06-12 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-*.[ch]: A new provider, for spool mailboxes. Mostly a cut and paste of the mbox code, but not a subclass CamelLocal*. Not tested a lot, doesn't lock yet, use with extreme caution. * tests/lib/folders.c (test_folder_message_ops): Added spool arg, spool folders can't be deleted, renamed, etc. (test_folder_basic): Same. * tests/folder/test2.c (main): Added checks for spool type. * tests/[message|stream|folder|misc|smime]/Makefile.am (LDADD): Added db3 flags, so make check compiles, doesn't run though. 2001-05-24 Not Zed <NotZed@Ximian.com> * providers/local/camel-local-provider.c (camel_provider_module_init): Added spool provider. svn path=/trunk/; revision=10198
Diffstat (limited to 'camel/tests/lib')
-rw-r--r--camel/tests/lib/folders.c92
-rw-r--r--camel/tests/lib/folders.h4
2 files changed, 51 insertions, 45 deletions
diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c
index 31d242070d..2e9638a25f 100644
--- a/camel/tests/lib/folders.c
+++ b/camel/tests/lib/folders.c
@@ -189,7 +189,7 @@ test_folder_not_message(CamelFolder *folder, const char *uid)
/* test basic store operations on folders */
/* TODO: Add subscription stuff */
void
-test_folder_basic(CamelSession *session, const char *storename, int local)
+test_folder_basic(CamelSession *session, const char *storename, int local, int spool)
{
CamelStore *store;
CamelException *ex = camel_exception_new();
@@ -226,44 +226,46 @@ test_folder_basic(CamelSession *session, const char *storename, int local)
camel_exception_clear(ex);
pull();
- push("getting a non-existant folder, with create");
- folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- check_unref(folder, 1);
- pull();
+ if (!spool) {
+ push("getting a non-existant folder, with create");
+ folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
+ check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
+ check(folder != NULL);
+ check_unref(folder, 1);
+ pull();
- push("getting an existing folder");
- folder = camel_store_get_folder(store, "testbox", 0, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- check_unref(folder, 1);
- pull();
+ push("getting an existing folder");
+ folder = camel_store_get_folder(store, "testbox", 0, ex);
+ check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
+ check(folder != NULL);
+ check_unref(folder, 1);
+ pull();
- push("renaming a non-existant folder");
- camel_store_rename_folder(store, "unknown1", "unknown2", ex);
- check(camel_exception_is_set(ex));
- camel_exception_clear(ex);
- pull();
+ push("renaming a non-existant folder");
+ camel_store_rename_folder(store, "unknown1", "unknown2", ex);
+ check(camel_exception_is_set(ex));
+ camel_exception_clear(ex);
+ pull();
- push("renaming an existing folder");
- camel_store_rename_folder(store, "testbox", "testbox2", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
+ push("renaming an existing folder");
+ camel_store_rename_folder(store, "testbox", "testbox2", ex);
+ check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
+ pull();
- push("opening the old name of a renamed folder");
- folder = camel_store_get_folder(store, "testbox", 0, ex);
- check(camel_exception_is_set(ex));
- check(folder == NULL);
- camel_exception_clear(ex);
- pull();
+ push("opening the old name of a renamed folder");
+ folder = camel_store_get_folder(store, "testbox", 0, ex);
+ check(camel_exception_is_set(ex));
+ check(folder == NULL);
+ camel_exception_clear(ex);
+ pull();
- push("opening the new name of a renamed folder");
- folder = camel_store_get_folder(store, "testbox2", 0, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- check_unref(folder, 1);
- pull();
+ push("opening the new name of a renamed folder");
+ folder = camel_store_get_folder(store, "testbox2", 0, ex);
+ check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
+ check(folder != NULL);
+ check_unref(folder, 1);
+ pull();
+ }
push("deleting a non-existant folder");
camel_store_delete_folder(store, "unknown", ex);
@@ -271,10 +273,12 @@ test_folder_basic(CamelSession *session, const char *storename, int local)
camel_exception_clear(ex);
pull();
- push("deleting an existing folder");
- camel_store_delete_folder(store, "testbox2", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
+ if (!spool) {
+ push("deleting an existing folder");
+ camel_store_delete_folder(store, "testbox2", ex);
+ check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
+ pull();
+ }
push("opening a folder that has been deleted");
folder = camel_store_get_folder(store, "testbox2", 0, ex);
@@ -294,7 +298,7 @@ test_folder_basic(CamelSession *session, const char *storename, int local)
/* todo: cross-check everything with folder_info checks as well */
/* this should probably take a folder instead of a session ... */
void
-test_folder_message_ops(CamelSession *session, const char *name, int local)
+test_folder_message_ops(CamelSession *session, const char *name, int local, int spool)
{
CamelStore *store;
CamelException *ex = camel_exception_new();
@@ -499,10 +503,12 @@ test_folder_message_ops(CamelSession *session, const char *name, int local)
check_unref(folder, 1);
pull(); /* re-opening folder */
- push("deleting test folder, with no messages in it");
- camel_store_delete_folder(store, "testbox", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
+ if (!spool) {
+ push("deleting test folder, with no messages in it");
+ camel_store_delete_folder(store, "testbox", ex);
+ check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
+ pull();
+ }
check_unref(store, 1);
camel_test_end();
diff --git a/camel/tests/lib/folders.h b/camel/tests/lib/folders.h
index 2cb2d97028..d3c9686dc2 100644
--- a/camel/tests/lib/folders.h
+++ b/camel/tests/lib/folders.h
@@ -15,6 +15,6 @@ void test_folder_message(CamelFolder *folder, const char *uid);
/* check message not present everywhere it shouldn't be */
void test_folder_not_message(CamelFolder *folder, const char *uid);
/* test basic folder ops on a store */
-void test_folder_basic(CamelSession *session, const char *storename, int local);
+void test_folder_basic(CamelSession *session, const char *storename, int local, int spool);
/* test basic message operations on a folder */
-void test_folder_message_ops(CamelSession *session, const char *storename, int local);
+void test_folder_message_ops(CamelSession *session, const char *storename, int local, int spool);