aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-04-28 11:07:30 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-04-28 11:07:30 +0800
commit02ed4a60f394f53de32b10459c959ad6a1f7b887 (patch)
treec0cd115a959208af9df0033263095316f2251202 /tests
parent19e94482677c45f538c716e1d4604fd5f0b3682e (diff)
downloadgsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.tar
gsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.tar.gz
gsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.tar.bz2
gsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.tar.lz
gsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.tar.xz
gsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.tar.zst
gsoc2013-evolution-02ed4a60f394f53de32b10459c959ad6a1f7b887.zip
Fix for removal of camelmimebodypart, and changes to recipient stuff.
2000-04-27 NotZed <NotZed@HelixCode.com> * tests/test10.c: Fix for removal of camelmimebodypart, and changes to recipient stuff. * tests/test1.c: Fix for removal of camelmimebodypart, and changes to recipient stuff. svn path=/trunk/; revision=2672
Diffstat (limited to 'tests')
-rw-r--r--tests/test1.c27
-rw-r--r--tests/test10.c25
2 files changed, 25 insertions, 27 deletions
diff --git a/tests/test1.c b/tests/test1.c
index 29e5f1dac1..97c6b3ebed 100644
--- a/tests/test1.c
+++ b/tests/test1.c
@@ -3,7 +3,6 @@
#include <stdio.h>
#include "camel-mime-message.h"
-#include "camel-mime-body-part.h"
#include "camel-multipart.h"
#include "camel-stream.h"
#include "camel-stream-fs.h"
@@ -15,8 +14,8 @@ main (int argc, char**argv)
{
CamelMimeMessage *message;
CamelMultipart *multipart;
- CamelMimeBodyPart *body_part;
- CamelMimeBodyPart *attachment_part;
+ CamelMimePart *body_part;
+ CamelMimePart *attachment_part;
CamelStream *attachment_stream;
/* FILE *output_file; */
@@ -56,21 +55,22 @@ main (int argc, char**argv)
camel_mime_message_set_from (message, g_strdup ("Bertrand.Guiheneuf@aful.org"));
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_TO,
- g_strdup ("franck.dechamps@alseve.fr"));
+ "Franck DeChamps", "franck.dechamps@alseve.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_TO,
- g_strdup ("mc@alseve.fr"));
+ NULL, "mc@alseve.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_TO,
- g_strdup ("richard.lengagne@inria.fr"));
+ "Richo", "richard.lengagne@inria.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_CC,
- g_strdup ("Francois.fleuret@inria.fr"));
+ "Frank", "Francois.fleuret@inria.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_CC,
- g_strdup ("maury@justmagic.com"));
+ NULL, "maury@justmagic.com");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_BCC,
- g_strdup ("Bertrand.Guiheneuf@aful.org"));
+ "Bertie", "Bertrand.Guiheneuf@aful.org");
multipart = camel_multipart_new ();
- body_part = camel_mime_body_part_new ();
- camel_mime_part_set_text (CAMEL_MIME_PART (body_part), "This is a test.\nThis is only a test.\n");
+ body_part = camel_mime_part_new ();
+ camel_mime_part_set_content (CAMEL_MIME_PART (body_part), "This is a test.\nThis is only a test.\n",
+ strlen("This is a test.\nThis is only a test.\n"), "text/plain");
camel_multipart_add_part (multipart, body_part);
if (attachment_stream == NULL) {
@@ -96,15 +96,12 @@ main (int argc, char**argv)
camel_data_wrapper_construct_from_stream (attachment_wrapper,
attachment_stream);
- attachment_part = camel_mime_body_part_new ();
+ attachment_part = camel_mime_part_new ();
camel_mime_part_set_encoding (CAMEL_MIME_PART (attachment_part),
CAMEL_MIME_PART_ENCODING_BASE64);
camel_medium_set_content_object (CAMEL_MEDIUM (attachment_part),
attachment_wrapper);
camel_multipart_add_part (multipart, attachment_part);
-
-
-
}
camel_medium_set_content_object (CAMEL_MEDIUM (message), CAMEL_DATA_WRAPPER (multipart));
diff --git a/tests/test10.c b/tests/test10.c
index 0beecb598e..5e20d2f6db 100644
--- a/tests/test10.c
+++ b/tests/test10.c
@@ -18,7 +18,7 @@ static CamelMimeMessage *
create_sample_mime_message ()
{
CamelMimeMessage *message;
- CamelMimeBodyPart *body_part;
+ CamelMimePart *body_part;
CamelMultipart *multipart;
@@ -30,26 +30,27 @@ create_sample_mime_message ()
camel_medium_add_header (CAMEL_MEDIUM (message), "X-test2", "the value of another test");
camel_mime_message_set_date (message, time(0), 200);
- camel_mime_message_set_subject (message, g_strdup ("A test message"));
- camel_mime_message_set_reply_to (message, g_strdup ("toto@toto.com"));
- camel_mime_message_set_from (message, g_strdup ("Bertrand.Guiheneuf@aful.org"));
+ camel_mime_message_set_subject (message, "A test message");
+ camel_mime_message_set_reply_to (message, "toto@toto.com");
+ camel_mime_message_set_from (message, "Bertrand.Guiheneuf@aful.org");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_TO,
- g_strdup ("franck.dechamps@alseve.fr"));
+ "Franck DeChamps", "franck.dechamps@alseve.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_TO,
- g_strdup ("mc@alseve.fr"));
+ NULL, "mc@alseve.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_TO,
- g_strdup ("richard.lengagne@inria.fr"));
+ "Richo", "richard.lengagne@inria.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_CC,
- g_strdup ("Francois.fleuret@inria.fr"));
+ "Frank", "Francois.fleuret@inria.fr");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_CC,
- g_strdup ("maury@justmagic.com"));
+ NULL, "maury@justmagic.com");
camel_mime_message_add_recipient (message, CAMEL_RECIPIENT_TYPE_BCC,
- g_strdup ("Bertrand.Guiheneuf@aful.org"));
+ "Bertie", "Bertrand.Guiheneuf@aful.org");
multipart = camel_multipart_new ();
- body_part = camel_mime_body_part_new ();
- camel_mime_part_set_text (CAMEL_MIME_PART (body_part), "This is a test.\nThis is only a test.\n");
+ body_part = camel_mime_part_new ();
+ camel_mime_part_set_content (CAMEL_MIME_PART (body_part), "This is a test.\nThis is only a test.\n",
+ strlen("This is a test.\nThis is only a test.\n"), "text/plain");
camel_multipart_add_part (multipart, body_part);
camel_medium_set_content_object (CAMEL_MEDIUM (message), CAMEL_DATA_WRAPPER (multipart));