aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-01-19 12:33:14 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-01-19 12:33:14 +0800
commitd44875ac5f2dfc7753cc33281c5fc8a866edd0b7 (patch)
tree8387b2fee5cb9f041f4fedeb2b76ab800d8929e9 /tests
parentbd4e64bd780fc0e39832f5c5abf1a15522fa6076 (diff)
downloadgsoc2013-evolution-d44875ac5f2dfc7753cc33281c5fc8a866edd0b7.tar.gz
gsoc2013-evolution-d44875ac5f2dfc7753cc33281c5fc8a866edd0b7.tar.zst
gsoc2013-evolution-d44875ac5f2dfc7753cc33281c5fc8a866edd0b7.zip
tests for summary and parsing process of mbox files.
2000-01-18 bertrand <bertrand@helixcode.com> * tests/test9.c: tests for summary and parsing process of mbox files. * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): do not use case insensitive comp to detect message separators. Kill some nasty bugs in netscape file parsing, * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary): don't use g_array_append but write directly inside the array data instead. Better performance and bug fix. * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_load_summary): fix the name and bugs. * camel/camel-folder-summary.h: update the class method definition to match the public defs. svn path=/trunk/; revision=1592
Diffstat (limited to 'tests')
-rw-r--r--tests/test9.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/tests/test9.c b/tests/test9.c
index c7a1626458..66a48b3f0f 100644
--- a/tests/test9.c
+++ b/tests/test9.c
@@ -4,9 +4,10 @@
#include "camel-mbox-folder.h"
#include "camel-mbox-parser.h"
#include "camel-mbox-utils.h"
-#include "camel.h"
+#include "camel-mbox-summary.h"
#include "camel-log.h"
#include "camel-exception.h"
+#include "md5-utils.h"
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
@@ -21,6 +22,10 @@ main (int argc, char**argv)
GArray *message_info_array;
gint test_file_fd;
CamelException *ex;
+ CamelMboxSummary *sum1, *sum2;
+ GArray *mbox_summary_info;
+ CamelMboxSummaryInformation *msg_info;
+ int i;
camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG;
@@ -38,14 +43,33 @@ main (int argc, char**argv)
ex);
close (test_file_fd);
- camel_mbox_write_xev (argv[1], message_info_array, 0, ex);
+ camel_mbox_write_xev (argv[1], message_info_array, 1, ex);
if (camel_exception_get_id (ex)) {
printf ("Exception caught in camel_mbox_write_xev : %s\n", camel_exception_get_description (ex));
}
-
-
+ mbox_summary_info =
+ parsed_information_to_mbox_summary (message_info_array);
+ sum1 = g_new (CamelMboxSummary, 1);
+
+ md5_get_digest_from_file (argv[1], sum1->md5_digest);
+ sum1->nb_message = mbox_summary_info->len;
+
+ sum1->message_info = mbox_summary_info;
+
+ camel_mbox_save_summary (sum1, "ev-summary.mbox", ex);
+
+ sum2 = camel_mbox_load_summary ("ev-summary.mbox", ex);
+
+ for (i=0; i<sum1->nb_message; i++) {
+
+ msg_info = (CamelMboxSummaryInformation *)(sum1->message_info->data) + i;
+ printf ("Message %d :\n"
+ " From : %s\n", i, msg_info->sender);
+ }
+
+ return 1;
}
>1-14/+11 * - Switch to USES=libtool, drop .la filesamdmi32014-06-282-2/+2 * - Convert USE_BZIP2 to USESamdmi32014-06-282-3/+3 * Use print/indexinfo to generate index of info pagesantoine2014-06-282-18/+7 * - Update to version 1.4.6.21mva2014-06-283-4/+6 * Remove non default dependency on expiring www/mod_wsgi2antoine2014-06-281-4/+1 * Update to 20140505a.delphij2014-06-282-1/+64 * Support staging.nobutaka2014-06-288-1034/+45 * - Remove easy_install dependencymva2014-06-281-3/+15 * Mark BROKEN: Depends on conflicting py-sqlalchemy and py-sqlalchemy06antoine2014-06-281-0/+2 * Mark BROKEN: Fails to compileantoine2014-06-281-0/+2 * Update to 6.8.9-4.kwm2014-06-2810-16/+22 * - Support STAGEDIRtota2014-06-281-11/+12 * Mark BROKEN: Fails to configureantoine2014-06-281-0/+4 * Mark BROKEN: Fails to install/package with new rexx-reginaantoine2014-06-281-0/+2 * Reset maintainer, email bouncesantoine2014-06-28