2002-09-04 Not Zed <NotZed@Ximian.com> * tests/folder/test4.c (main): clear nonfatal stuff. * tests/folder/test6.c (main): check inbox and 'another folder' because some servers do different things w/ inbox. * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_get): Dont try to open the directory instead of an empty "" uid. * providers/imap/camel-imap-folder.c (imap_get_message): we dont want to g_return_if_fail, we need to set an exception and always handle the case. (get_message_simple): Set an exception if we get a construct failure. (imap_refresh_info): if we're refreshing inbox, force a reselect. this is required for at least cryus. CHECK doesnt work either :( * tests/lib/folders.c (test_folder_basic): for non-local stores, the folder will have an extra ref for selection, take this into account when checking ref leaks. (test_folder_message_ops): Dont try to delete folder with messages in it, it works generally with imap. also, change params so we can test different mailbox types. (test_folder_message_ops): disconnect remote services before finishing off. doesn't need to stricly but makes ref count checking more accurate. (test_folder_message_ops): removed explicit remote sync, imap does it itself now ... * providers/imap/camel-imap-store.c: (camel_imap_store_finalize): call service_disconnect, so it isn't called later in the finalise chain, to properly cleanup on exit. svn path=/trunk/; revision=17962
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
/* store testing, for remote folders */
|
|
|
|
#include "camel-test.h"
|
|
#include "folders.h"
|
|
#include "session.h"
|
|
|
|
#include <camel/camel-exception.h>
|
|
#include <camel/camel-service.h>
|
|
#include <camel/camel-store.h>
|
|
|
|
#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
|
|
|
|
static char *remote_providers[] = {
|
|
"IMAP_TEST_URL",
|
|
};
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
CamelSession *session;
|
|
CamelException *ex;
|
|
int i;
|
|
char *path;
|
|
|
|
camel_test_init(argc, argv);
|
|
|
|
ex = camel_exception_new();
|
|
|
|
/* clear out any camel-test data */
|
|
system("/bin/rm -rf /tmp/camel-test");
|
|
|
|
session = camel_test_session_new ("/tmp/camel-test");
|
|
|
|
/* todo: cross-check everything with folder_info checks as well */
|
|
/* todo: subscriptions? */
|
|
for (i=0;i<ARRAY_LEN(remote_providers);i++) {
|
|
path = getenv(remote_providers[i]);
|
|
|
|
if (path == NULL) {
|
|
printf("Aborted (ignored).\n");
|
|
printf("Set '%s', to re-run test.\n", remote_providers[i]);
|
|
/* tells make check to ignore us in the total count */
|
|
_exit(77);
|
|
}
|
|
/*camel_test_nonfatal("The IMAP code is just rooted");*/
|
|
test_folder_basic(session, path, FALSE, FALSE);
|
|
/*camel_test_fatal();*/
|
|
}
|
|
|
|
camel_object_unref((CamelObject *)session);
|
|
camel_exception_free(ex);
|
|
|
|
return 0;
|
|
}
|