diff options
Diffstat (limited to 'tests/test1.c')
-rw-r--r-- | tests/test1.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/test1.c b/tests/test1.c index 9a483d0ca9..65d3b046c7 100644 --- a/tests/test1.c +++ b/tests/test1.c @@ -1,13 +1,16 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #include "camel-mime-message.h" #include "stdio.h" -#include <bonobo/gnome-stream.h> +#include "camel-stream.h" +#include "camel-stream-fs.h" +#include "camel-log.h" void main (int argc, char**argv) { CamelMimeMessage *message; - FILE *output_file; + /* FILE *output_file; */ + CamelStream *stream; gtk_init (&argc, &argv); message = camel_mime_message_new_with_session( (CamelSession *)NULL); @@ -28,15 +31,13 @@ main (int argc, char**argv) camel_mime_message_add_recipient (message, g_string_new (RECIPIENT_TYPE_CC), g_string_new ("maury@justmagic.com")); camel_mime_message_add_recipient (message, g_string_new (RECIPIENT_TYPE_BCC), g_string_new ("guiheneu@aful.org")); - output_file = fopen ("mail.test", "w"); - if (!output_file) { - perror("could not open output file"); + + stream = camel_stream_fs_new_with_name (g_string_new ("mail1.test"), CAMEL_STREAM_FS_WRITE ); + if (!stream) { + CAMEL_LOG(WARNING, "could not open output file"); exit(2); } - camel_data_wrapper_write_to_file (CAMEL_DATA_WRAPPER (message), output_file); - fclose (output_file); - - - - + + camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream); + camel_stream_close (stream); } |