Commit 450eaf62 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve autotest. The problem is contenttype is empty

parent 4649ab93
Pipeline #28637 passed with stage
in 15 minutes and 3 seconds
...@@ -157,7 +157,7 @@ void MessageTest::testHeaderFieldWithoutSpace() ...@@ -157,7 +157,7 @@ void MessageTest::testHeaderFieldWithoutSpace()
{ {
// Headers without a space, like the CC header here, are allowed according to // Headers without a space, like the CC header here, are allowed according to
// the examples in RFC2822, Appendix A5 // the examples in RFC2822, Appendix A5
QString mail = QStringLiteral("From:\n" const QString mail = QStringLiteral("From:\n"
"To: heinz@test.de\n" "To: heinz@test.de\n"
"Cc:moritz@test.de\n" "Cc:moritz@test.de\n"
"Subject: Test\n" "Subject: Test\n"
...@@ -178,7 +178,7 @@ void MessageTest::testWronglyFoldedHeaders() ...@@ -178,7 +178,7 @@ void MessageTest::testWronglyFoldedHeaders()
{ {
// The first subject line here doesn't contain anything. This is invalid, // The first subject line here doesn't contain anything. This is invalid,
// however there are some mailers out there that produce those messages. // however there are some mailers out there that produce those messages.
QString mail = QStringLiteral("Subject:\n" const QString mail = QStringLiteral("Subject:\n"
" Hello\n" " Hello\n"
" World\n" " World\n"
"To: \n" "To: \n"
...@@ -197,8 +197,8 @@ void MessageTest::missingHeadersTest() ...@@ -197,8 +197,8 @@ void MessageTest::missingHeadersTest()
{ {
// Test that the message body is OK even though some headers are missing // Test that the message body is OK even though some headers are missing
KMime::Message msg; KMime::Message msg;
QString body = QStringLiteral("Hi Donald, look at those nice pictures I found!\n"); const QString body = QStringLiteral("Hi Donald, look at those nice pictures I found!\n");
QString content = QLatin1String("From: georgebush@whitehouse.org\n" const QString content = QLatin1String("From: georgebush@whitehouse.org\n"
"To: donaldrumsfeld@whitehouse.org\n" "To: donaldrumsfeld@whitehouse.org\n"
"Subject: Cute Kittens\n" "Subject: Cute Kittens\n"
"\n") + body; "\n") + body;
...@@ -365,7 +365,7 @@ void MessageTest::testDecodedText() ...@@ -365,7 +365,7 @@ void MessageTest::testDecodedText()
void MessageTest::testInlineImages() void MessageTest::testInlineImages()
{ {
QByteArray data = const QByteArray data =
"From: <kde@kde.org>\n" "From: <kde@kde.org>\n"
"To: kde@kde.org\n" "To: kde@kde.org\n"
"Subject: Inline Image (unsigned)\n" "Subject: Inline Image (unsigned)\n"
...@@ -698,8 +698,11 @@ void MessageTest::testBugAttachment387423() ...@@ -698,8 +698,11 @@ void MessageTest::testBugAttachment387423()
void MessageTest::testCrashReplyInvalidEmail() void MessageTest::testCrashReplyInvalidEmail()
{ {
KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("crash-invalid-email-reply.mbox")); KMime::Message::Ptr msg = readAndParseMail(QStringLiteral("crash-invalid-email-reply.mbox"));
QCOMPARE(msg->subject()->as7BitString().data(), "Subject: Re: Authorization required to post to gmane.network.wireguard (b96565298414a43aabcf9fbedf5e7e27)"); QCOMPARE(msg->subject()->as7BitString().data(), "Subject: Re: Authorization required to post to gmane.network.wireguard (b96565298414a43aabcf9fbedf5e7e27)");
//FIXME contenttype is empty
QCOMPARE(msg->contentType()->mimeType().data(), "");
QVERIFY(msg->isTopLevel());
QEXPECT_FAIL("", "Problem with content type", Continue); QEXPECT_FAIL("", "Problem with content type", Continue);
QCOMPARE(msg->contents().size(), 2); QCOMPARE(msg->contents().size(), 2);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment