From c83477345fa5dceb62b85efd0a76a54f94a78858 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 3 Dec 2004 03:36:57 +0000 Subject: have our own so we don't need to link with glib. * camel-lock-helper.c (g_strerror): have our own so we don't need to link with glib. * providers/*/Makefile.am: Do not install ANY provider header files. No providers are subclassable. No providers are directly linkable. * camel.pc.in: create package config file. * tests/lib/folders.c (test_folder_message_ops): updated counts for delete also marking unread. * tests/lib/camel-test.c (camel_test_provider_init): new api for initialising test system 'in-build'. * camel-provider.c: remove the assertions, init if we need to,k use pthread_once stuff to serialise it. * tests/folder/test3.c (main): remove gtk stuff (???). * tests/*: Fix all the makefiles. Made make-check work 'in-build'. * tests/lib/folders.c (test_folder_counts): update for api changes. (test_message_info): similar. * providers/Makefile.am: removed groupwise from the build, this can't go in here anymore, not in its current state. * camel-net-utils.c (camel_gethostbyaddr_r) (camel_gethostbyname_r): the old e_gethost* calls from e-host-utils.c. 2004-11-15 Not Zed * providers/imap/camel-imap-utils.c (imap_path_to_physical): copied from e-path.c. (imap_path_find_folders): copied from e-path.c. * camel.h: remove the provider stuff from the header. * camel-provider.c: globalise provider_init variable, and asserton it in all functions that rely on it. * camel-service.c: removed getaddrinfo/etc. * camel-net-utils.[ch]: separate out camel_getaddrinfo etc. * Makefile.am: split camel into 2 libraries, libcamel and libcamel-store. * camel-multipart-signed.c (camel_multipart_signed_sign) (camel_multipart_signed_verify, prepare_sign): remove old deprecated api. * camel-multipart-encrypted.c (camel_multipart_encrypted_encrypt) (camel_multipart_encrypted_decrypt): remove old deprecated api. svn path=/trunk/; revision=28046 --- camel/tests/lib/Makefile.am | 14 ++++++++++++-- camel/tests/lib/folders.c | 18 ++++++++++-------- camel/tests/lib/messages.h | 3 +++ camel/tests/lib/streams.c | 2 -- 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'camel/tests/lib') diff --git a/camel/tests/lib/Makefile.am b/camel/tests/lib/Makefile.am index 93ec07abd5..4b9613e66d 100644 --- a/camel/tests/lib/Makefile.am +++ b/camel/tests/lib/Makefile.am @@ -5,9 +5,10 @@ INCLUDES = \ -I$(top_srcdir)/intl \ -I$(top_srcdir)/e-util \ -I$(top_srcdir)/camel \ + -DCAMEL_BUILD_DIR=\"$(top_builddir)/camel\" \ $(CAMEL_CFLAGS) -check_LIBRARIES = libcameltest.a +check_LIBRARIES = libcameltest.a libcameltest-provider.a libcameltest_a_SOURCES = \ camel-test.c camel-test.h \ @@ -18,5 +19,14 @@ libcameltest_a_SOURCES = \ streams.c streams.h \ address-data.h +libcameltest_provider_a_SOURCES = \ + camel-test-provider.c camel-test-provider.h + libcameltest_a_LIBADD = \ - $(top_builddir)/e-util/libeutil.la + $(top_builddir)/camel/libcamel.la \ + $(top_builddir)/libedataserver/libedataserver-${BASE_VERSION}.la + +libcameltest_provider_a_LIBADD = \ + $(top_builddir)/camel/libcamel-provider.la \ + $(top_builddir)/camel/libcamel.la \ + $(top_builddir)/libedataserver/libedataserver-${BASE_VERSION}.la diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c index e93d8caf2e..5104da6c12 100644 --- a/camel/tests/lib/folders.c +++ b/camel/tests/lib/folders.c @@ -12,13 +12,15 @@ test_folder_counts(CamelFolder *folder, int total, int unread) { GPtrArray *s; int i, myunread; + int gettotal, getunread; CamelMessageInfo *info; push("test folder counts %d total %d unread", total, unread); /* first, use the standard functions */ - check(camel_folder_get_message_count(folder) == total); - check(camel_folder_get_unread_message_count(folder) == total); + camel_object_get(folder, NULL, CAMEL_FOLDER_TOTAL, &gettotal, CAMEL_FOLDER_UNREAD, &getunread, 0); + check(gettotal == total); + check(getunread == unread); /* next, use the summary */ s = camel_folder_get_summary(folder); @@ -27,7 +29,7 @@ test_folder_counts(CamelFolder *folder, int total, int unread) myunread = s->len; for (i=0;ilen;i++) { info = s->pdata[i]; - if (info->flags & CAMEL_MESSAGE_SEEN) + if (camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) myunread--; } check(unread == myunread); @@ -40,7 +42,7 @@ test_folder_counts(CamelFolder *folder, int total, int unread) myunread = s->len; for (i=0;ilen;i++) { info = camel_folder_get_message_info(folder, s->pdata[i]); - if (info->flags & CAMEL_MESSAGE_SEEN) + if (camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) myunread--; camel_folder_free_message_info(folder, info); } @@ -70,7 +72,7 @@ test_message_info(CamelMimeMessage *msg, const CamelMessageInfo *info) /* FIXME: testing from/cc/to, etc is more tricky */ - check(info->date_sent == camel_mime_message_get_date(msg, NULL)); + check(camel_message_info_date_sent(info) == camel_mime_message_get_date(msg, NULL)); /* date received isn't set for messages that haven't been sent anywhere ... */ /*check(info->date_received == camel_mime_message_get_date_received(msg, NULL));*/ @@ -469,7 +471,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons push("deleting first message & expunging"); camel_folder_delete_message(folder, uids->pdata[0]); - test_folder_counts(folder, 10, 10); + test_folder_counts(folder, 10, 9); camel_folder_expunge(folder, ex); check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex)); test_folder_not_message(folder, uids->pdata[0]); @@ -498,7 +500,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons push("deleting last message & expunging"); camel_folder_delete_message(folder, uids->pdata[8]); /* sync? */ - test_folder_counts(folder, 9, 9); + test_folder_counts(folder, 9, 8); camel_folder_expunge(folder, ex); check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex)); test_folder_not_message(folder, uids->pdata[8]); @@ -529,7 +531,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, cons camel_folder_delete_message(folder, uids->pdata[j]); } /* sync? */ - test_folder_counts(folder, 8, 8); + test_folder_counts(folder, 8, 0); camel_folder_expunge(folder, ex); check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex)); for (j=0;j<8;j++) { diff --git a/camel/tests/lib/messages.h b/camel/tests/lib/messages.h index 1f892c3cc8..24e0407af0 100644 --- a/camel/tests/lib/messages.h +++ b/camel/tests/lib/messages.h @@ -13,3 +13,6 @@ int test_message_compare_content(CamelDataWrapper *dw, const char *text, int len int test_message_compare (CamelMimeMessage *msg); void test_message_dump_structure(CamelMimeMessage *m); + +int test_message_compare_header(CamelMimeMessage *m1, CamelMimeMessage *m2); +int test_message_compare_messages(CamelMimeMessage *m1, CamelMimeMessage *m2); diff --git a/camel/tests/lib/streams.c b/camel/tests/lib/streams.c index e4dc006363..d62db50938 100644 --- a/camel/tests/lib/streams.c +++ b/camel/tests/lib/streams.c @@ -126,7 +126,6 @@ test_seekable_substream_writepart(CamelStream *s, int type) CamelSeekableSubstream *sus = (CamelSeekableSubstream *)s; CamelSeekableStream *sp = sus->parent_stream; int i, len; - off_t end; push("writing substream, type %d", type); @@ -177,7 +176,6 @@ test_seekable_substream_readpart(CamelStream *s) CamelSeekableSubstream *sus = (CamelSeekableSubstream *)s; CamelSeekableStream *sp = sus->parent_stream; int i, len; - off_t end; push("reading substream"); -- cgit v1.2.3