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/camel-test.c | |
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/camel-test.c')
-rw-r--r-- | camel/tests/lib/camel-test.c | 41 |
1 files changed, 29 insertions, 12 deletions
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); |