return 0;
}
-void test_mime(void) {
+static void test_mime(void) {
char *t, *n, *v;
struct vector parts[1];
struct kvp *k;
const char *s, *cs, *enc;
hash *h;
- fprintf(stderr, "test_mime\n");
-
t = 0;
k = 0;
insist(!mime_content_type("text/plain", &t, &k));
"Content-Description: jpeg-1\r\n"
"\r\n"
"<jpeg data>");
-
+
+ /* Bogus inputs to mime_multipart() */
+ fprintf(stderr, "expect two mime_multipart errors:\n");
+ insist(mime_multipart("--inner\r\n"
+ "Content-Type: text/plain\r\n"
+ "Content-Disposition: inline\r\n"
+ "Content-Description: text-part-2\r\n"
+ "\r\n"
+ "Some more text here.\r\n"
+ "\r\n"
+ "--inner\r\n"
+ "Content-Type: image/jpeg\r\n"
+ "Content-Disposition: attachment\r\n"
+ "Content-Description: jpeg-1\r\n"
+ "\r\n"
+ "<jpeg data>\r\n",
+ test_multipart_callback,
+ "inner",
+ parts) == -1);
+ insist(mime_multipart("--wrong\r\n"
+ "Content-Type: text/plain\r\n"
+ "Content-Disposition: inline\r\n"
+ "Content-Description: text-part-2\r\n"
+ "\r\n"
+ "Some more text here.\r\n"
+ "\r\n"
+ "--inner--\r\n",
+ test_multipart_callback,
+ "inner",
+ parts) == -1);
+
/* XXX mime_parse */
check_string(mime_qp(""), "");
check_string(enc, "quoted-printable");
}
+TEST(mime);
+
/*
Local Variables:
c-basic-offset:2