6 #include <ccan/tap/tap.h>
7 #include <ccan/array_size/array_size.h>
9 #define CCAN_RFC822_DEBUG
11 #include <ccan/rfc822/rfc822.h>
12 #include <ccan/rfc822/rfc822.c>
16 /* Test some of the test infrastructure */
18 static const char test_msg_1_cmp[] =
19 "Date:Tue, 22 Feb 2011 00:15:59 +1100\n"
20 "From:Mister From <from@example.com>\n"
21 "To:Mizz To <to@example.org>\n"
22 "Subject:Some subject\n"
23 "Message-ID:<20110221131559.GA28327@example>\n"
25 "Content-Type:text/plain; charset=us-ascii\n"
26 "Content-Disposition:inline\n"
30 static void test_assemble(const struct aexample *e, int crlf,
31 const char *cmp, size_t cmplen)
36 msg = assemble_msg(e, &len, crlf);
38 fprintf(stderr, "Assembled message %zd bytes (versus %zd bytes)\n",
41 ok1(memcmp(msg, cmp, cmplen) == 0);
45 int main(int argc, char *argv[])
49 test_assemble(&test_msg_1, 0, test_msg_1_cmp, sizeof(test_msg_1_cmp) - 1);