aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test1.c7
-rw-r--r--tests/test11.c5
-rw-r--r--tests/test13.c12
-rw-r--r--tests/test2.c5
4 files changed, 11 insertions, 18 deletions
diff --git a/tests/test1.c b/tests/test1.c
index 8e70dfc792..f59439e9a7 100644
--- a/tests/test1.c
+++ b/tests/test1.c
@@ -7,7 +7,6 @@
#include "camel-multipart.h"
#include "camel-stream.h"
#include "camel-stream-fs.h"
-#include "camel-stream-data-wrapper.h"
#include "camel.h"
int
@@ -30,7 +29,7 @@ main (int argc, char**argv)
} else {
if (argc == 2) {
attachment_stream = camel_stream_fs_new_with_name
- (argv[1], CAMEL_STREAM_FS_READ);
+ (argv[1], O_RDONLY, 0600);
if (attachment_stream == NULL) {
fprintf (stderr, "Cannot open `%s'\n",
argv[1]);
@@ -93,7 +92,7 @@ main (int argc, char**argv)
gtk_object_unref (GTK_OBJECT (stream_wrapper));*/
- attachment_wrapper = CAMEL_DATA_WRAPPER (camel_simple_data_wrapper_new ());
+ attachment_wrapper = camel_data_wrapper_new ();
camel_data_wrapper_construct_from_stream (attachment_wrapper,
attachment_stream);
@@ -110,7 +109,7 @@ main (int argc, char**argv)
camel_medium_set_content_object (CAMEL_MEDIUM (message), CAMEL_DATA_WRAPPER (multipart));
- stream = camel_stream_fs_new_with_name ("mail1.test", CAMEL_STREAM_FS_WRITE );
+ stream = camel_stream_fs_new_with_name ("mail1.test", O_WRONLY, 0600);
if (!stream) {
printf ("could not open output file");
exit(2);
diff --git a/tests/test11.c b/tests/test11.c
index ea6d7fcc49..c7a8a5c1b5 100644
--- a/tests/test11.c
+++ b/tests/test11.c
@@ -73,9 +73,6 @@ main (int argc, char**argv)
CamelStore *store;
gchar *store_url = "mbox:///tmp/evmail";
CamelFolder *folder, *outbox;
- CamelMimeMessage *message;
- GList *uid_list;
- GList *matches;
struct search_data *sd;
gtk_init (&argc, &argv);
@@ -127,7 +124,7 @@ main (int argc, char**argv)
camel_folder_search_by_expression (folder,
"(match-all (header-contains \"subject\" \"gnome\"))",
- search_cb,
+ (CamelSearchFunc*)search_cb,
sd,
ex);
diff --git a/tests/test13.c b/tests/test13.c
index 05277ae0ea..a1978e7fb0 100644
--- a/tests/test13.c
+++ b/tests/test13.c
@@ -37,8 +37,6 @@ dump_message_content(CamelDataWrapper *object)
} else if (CAMEL_IS_MIME_MESSAGE(containee)) {
dump_message_content((CamelDataWrapper *)containee);
} else {
- int total=0;
-
stream = camel_data_wrapper_get_output_stream(containee);
left = 0;
@@ -61,7 +59,6 @@ dump_message_content(CamelDataWrapper *object)
int
main (int argc, char**argv)
{
- GHashTable *header_table;
CamelMimeMessage *message;
CamelStream *input_stream, *output_stream;
CamelMimeParser *parser;
@@ -99,7 +96,7 @@ main (int argc, char**argv)
message = camel_mime_message_new ();
- input_stream = camel_stream_fs_new_with_name ("mail.test", CAMEL_STREAM_FS_READ);
+ input_stream = camel_stream_fs_new_with_name ("mail.test", O_RDONLY, 0600);
if (!input_stream) {
perror ("could not open input file\n");
printf ("You must create the file mail.test before running this test\n");
@@ -109,14 +106,15 @@ main (int argc, char**argv)
printf("creating parser to create message\n");
parser = camel_mime_parser_new();
camel_mime_parser_init_with_stream(parser, input_stream);
- camel_mime_part_construct_from_parser(message, parser);
+ camel_mime_part_construct_from_parser(CAMEL_MIME_PART (message),
+ parser);
- dump_message_content(message);
+ dump_message_content(CAMEL_DATA_WRAPPER (message));
camel_stream_close (input_stream);
gtk_object_unref (GTK_OBJECT (input_stream));
- output_stream = camel_stream_fs_new_with_name ("mail2.test", CAMEL_STREAM_FS_WRITE);
+ output_stream = camel_stream_fs_new_with_name ("mail2.test", O_WRONLY, 0600);
camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), output_stream);
camel_stream_close (output_stream);
gtk_object_unref (GTK_OBJECT (output_stream));
diff --git a/tests/test2.c b/tests/test2.c
index d71e73e701..0424d1464e 100644
--- a/tests/test2.c
+++ b/tests/test2.c
@@ -11,9 +11,8 @@
int
main (int argc, char**argv)
{
- GHashTable *header_table;
CamelMimeMessage *message;
- CamelStream *input_stream, *output_stream;
+ CamelStream *input_stream;
gtk_init (&argc, &argv);
camel_init ();
@@ -21,7 +20,7 @@ main (int argc, char**argv)
message = camel_mime_message_new ();
- input_stream = camel_stream_fs_new_with_name ("mail.test", CAMEL_STREAM_FS_READ);
+ input_stream = camel_stream_fs_new_with_name ("mail.test", O_RDONLY, 06000);
if (!input_stream) {
perror ("could not open input file\n");
printf ("You must create the file mail.test before running this test\n");