diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-08-20 04:14:15 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-08-20 04:14:15 +0800 |
commit | 5fb3a28aba18266a1cfc3759e6fc271a86531cb8 (patch) | |
tree | e39511d1d99ab08b529ea61f43df690b1f3b0b2a /camel/tests/lib | |
parent | 520d7194c4837f288733b29fa69f9cdde524fe38 (diff) | |
download | gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.gz gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.bz2 gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.lz gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.xz gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.tar.zst gsoc2013-evolution-5fb3a28aba18266a1cfc3759e6fc271a86531cb8.zip |
Updated to pass the needed arguments to camel_init() and to init gthreads
2002-08-19 Jeffrey Stedfast <fejj@ximian.com>
* tests/lib/camel-test.c (camel_test_init): Updated to pass the
needed arguments to camel_init() and to init gthreads before camel
(since camel expectes it to be initialised already).
* tests/lib/session.c: #include <config.h> needed for
ENABLE_THREADS so that sizeof (CamelSessionClass) gives the
correct size.
* tests/*: Updated to work with camel API changes.
svn path=/trunk/; revision=17805
Diffstat (limited to 'camel/tests/lib')
-rw-r--r-- | camel/tests/lib/Makefile.am | 10 | ||||
-rw-r--r-- | camel/tests/lib/addresses.c | 3 | ||||
-rw-r--r-- | camel/tests/lib/camel-test.c | 41 | ||||
-rw-r--r-- | camel/tests/lib/folders.c | 2 | ||||
-rw-r--r-- | camel/tests/lib/session.c | 6 |
5 files changed, 46 insertions, 16 deletions
diff --git a/camel/tests/lib/Makefile.am b/camel/tests/lib/Makefile.am index f3a92899b2..93ec07abd5 100644 --- a/camel/tests/lib/Makefile.am +++ b/camel/tests/lib/Makefile.am @@ -1,5 +1,11 @@ -INCLUDES = -I$(includedir) -I$(top_srcdir) -I$(top_srcdir)/camel +INCLUDES = \ + -I$(includedir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/intl \ + -I$(top_srcdir)/e-util \ + -I$(top_srcdir)/camel \ + $(CAMEL_CFLAGS) check_LIBRARIES = libcameltest.a @@ -12,3 +18,5 @@ libcameltest_a_SOURCES = \ streams.c streams.h \ address-data.h +libcameltest_a_LIBADD = \ + $(top_builddir)/e-util/libeutil.la diff --git a/camel/tests/lib/addresses.c b/camel/tests/lib/addresses.c index a97ac5e4f9..57275511c4 100644 --- a/camel/tests/lib/addresses.c +++ b/camel/tests/lib/addresses.c @@ -1,3 +1,6 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +#include <string.h> #include "addresses.h" #include "camel-test.h" diff --git a/camel/tests/lib/camel-test.c b/camel/tests/lib/camel-test.c index a61f949f0a..76385ec696 100644 --- a/camel/tests/lib/camel-test.c +++ b/camel/tests/lib/camel-test.c @@ -3,13 +3,18 @@ #include <stdio.h> #include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> #include <signal.h> +#include <errno.h> #ifdef ENABLE_THREADS #include <pthread.h> -#include <unistd.h> #endif +#include <camel/camel.h> + #ifdef ENABLE_THREADS /* well i dunno, doesn't seem to be in the headers but hte manpage mentions it */ /* a nonportable checking mutex for glibc, not really needed, just validates @@ -106,20 +111,32 @@ current_state(void) void camel_test_init(int argc, char **argv) { - void camel_init(void); + struct stat st; + char *path; int i; - + setup = 1; - -#ifndef ENABLE_THREADS - camel_init(); -#endif - - info_table = g_hash_table_new(0, 0); - + /* yeah, we do need ot thread init, even though camel isn't compiled with enable threads */ - g_thread_init(NULL); - + g_thread_init (NULL); + + path = g_strdup_printf ("/tmp/camel-test"); + if (mkdir (path, 0700) == -1 && errno != EEXIST) + abort (); + + if (stat (path, &st) == -1) + abort (); + + if (!S_ISDIR (st.st_mode) || access (path, R_OK | W_OK | X_OK) == -1) + abort (); + + camel_init (path, FALSE); + g_free (path); + + camel_type_init (); + + info_table = g_hash_table_new(0, 0); + signal(SIGSEGV, die); signal(SIGABRT, die); diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c index 86d9a1f3ff..e7de6b2397 100644 --- a/camel/tests/lib/folders.c +++ b/camel/tests/lib/folders.c @@ -358,7 +358,7 @@ test_folder_message_ops(CamelSession *session, const char *name, int local, int pull(); push("appending simple message %d", j); - camel_folder_append_message(folder, msg, NULL, ex); + camel_folder_append_message(folder, msg, NULL, NULL, ex); check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex)); /* sigh, this shouldn't be required, but the imap code is too dumb to do it itself */ diff --git a/camel/tests/lib/session.c b/camel/tests/lib/session.c index 2ebf6e2d7f..a1f8df3ea0 100644 --- a/camel/tests/lib/session.c +++ b/camel/tests/lib/session.c @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "session.h" static guint @@ -55,5 +59,3 @@ camel_test_session_new (const char *path) return session; } - - |