From 3bdd857a4a69e83841c2fbae83d96101912ebf69 Mon Sep 17 00:00:00 2001 From: bertrand Date: Mon, 17 Jan 2000 08:40:11 +0000 Subject: test for the mbox utils. (copy_file_chunk): fixed a nasty bug. 2000-01-17 bertrand * tests/test9.c (main): test for the mbox utils. (copy_file_chunk): fixed a nasty bug. (camel_mbox_write_xev): create the copy file descriptor with the proper arguments. Exceptions implememnted. (camel_mbox_write_xev): changed the way bytes are counted. No more uses the message size cause it did not take into account the message separators characters. (camel_mbox_write_xev): hopefully fixed the last bugs. works ok now. Summary information / X-Evolution header generation should all work ok now. svn path=/trunk/; revision=1579 --- tests/Makefile.am | 12 ++++++++++-- tests/test9.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 tests/test9.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 432c39a953..a7f0cb1883 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,8 @@ # process this file with automake to create Makefile.in INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir) -I$(top_srcdir)/camel \ - -I$(includedir) -I$(top_srcdir)/camel/providers/MH + -I$(includedir) -I$(top_srcdir)/camel/providers/MH \ + -I$(top_srcdir)/camel/providers/mbox LDADD = \ $(top_builddir)/camel/libcamel.la \ $(GNOME_LIBDIR) \ @@ -17,10 +18,17 @@ LDADD = \ # $(GNOME_LIBDIR) \ # $(GNOMEUI_LIBS) $(INTLLIBS) $(PTHREAD_LIB) +test9_LDADD = \ + $(top_builddir)/camel/libcamel.la \ + $(top_builddir)/camel/providers/mbox/libcamelmbox.la \ + $(GNOME_LIBDIR) \ + $(GNOMEUI_LIBS) $(INTLLIBS) $(PTHREAD_LIB) $(EXTRA_GNOME_LIBS_THREADS) + noinst_PROGRAMS = \ test1 \ test2 \ test3 \ test7 \ - test8 + test8 \ + test9 diff --git a/tests/test9.c b/tests/test9.c new file mode 100644 index 0000000000..6356bad41f --- /dev/null +++ b/tests/test9.c @@ -0,0 +1,51 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + + +#include "camel-mbox-folder.h" +#include "camel-mbox-parser.h" +#include "camel-mbox-utils.h" +#include "camel.h" +#include "camel-log.h" +#include "camel-exception.h" +#include +#include +#include +#include +#include +#include +#include + +int +main (int argc, char**argv) +{ + GArray *message_info_array; + gint test_file_fd; + CamelException *ex; + + camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG; + + gtk_init (&argc, &argv); + camel_init (); + + ex = camel_exception_new (); + test_file_fd = open (argv[1], O_RDONLY); + message_info_array = camel_mbox_parse_file (test_file_fd, + "From ", + 0, + TRUE, + NULL, + 0, + ex); + + close (test_file_fd); + camel_mbox_write_xev (argv[1], message_info_array, 0, ex); + if (camel_exception_get_id (ex)) { + printf ("Exception caught in camel_mbox_write_xev : %s\n", camel_exception_get_description (ex)); + } + + + +} + + + -- cgit v1.2.3