1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 19:42:04 +02:00

basically switch to the new hashed headers

This commit is contained in:
B. Petersen 2017-12-07 18:19:35 +01:00
parent 6b8180d1ef
commit 37c448a7d7
3 changed files with 101 additions and 27 deletions

View file

@ -69,7 +69,7 @@ void stress_functions(mrmailbox_t* mailbox)
mrsimplify_unref(simplify);
}
/* test mime
/* test mailmime
**************************************************************************/
{
@ -96,12 +96,46 @@ void stress_functions(mrmailbox_t* mailbox)
assert( of_b && of_b->fld_value );
assert( strcmp(of_b->fld_value, "ValueB")==0 );
mailmime_free(mime);
}
/* test mrmimeparser_t
**************************************************************************/
{
mrmimeparser_t* mimeparser = mrmimeparser_new(mailbox->m_blobdir, mailbox);
const char* raw =
"Content-Type: multipart/mixed; boundary=\"JoqEHZIyZ4BKBT56msbYSSWPeG0mEPTNj\"; protected-headers=\"v1\"\n"
"From: qm4 <user4@b44t.com>\n"
"To: =?UTF-8?B?QmrDtnJu?= <user@domain.com>\n"
"Message-ID: <f539200b-35f1-0da0-939c-26c7b21a19e1@b44t.com>\n"
"Subject: test1\n"
"\n"
"--JoqEHZIyZ4BKBT56msbYSSWPeG0mEPTNj\n"
"Content-Type: text/rfc822-headers; protected-headers=\"v1\"\n"
"Content-Disposition: inline\n"
"\n"
"From: qm4 <user4@b44t.com>\n"
"To: =?UTF-8?B?QmrDtnJu?= <user@domain.com>\n"
"Subject: test1\n"
"\n"
"--JoqEHZIyZ4BKBT56msbYSSWPeG0mEPTNj\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: quoted-printable\n"
"\n"
"test1\n"
"\n"
"--JoqEHZIyZ4BKBT56msbYSSWPeG0mEPTNj--\n"
"\n";
mrmimeparser_parse(mimeparser, raw, strlen(raw));
assert( strcmp(mimeparser->m_subject, "test1")==0 );
mrmimeparser_unref(mimeparser);
}
/* test some string functions
**************************************************************************/