Commit 80152cb3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add autotest for 387423

CCBUG: 387423
parent 4ade24bc
From XXXXXXXXXXX@XXXXXXX.com Sun Jul 01 00:00:00 2020
From: XXXXXXXXXXXXXXXXX <XXXXXXXXXXXXXXXXXXXX@XXXXXXXX.com>
To: XXXXXXXXXXX <XXXX@XXXXXXXXXXXXX.uk>
Subject: XXXXXXXXXXXXXXXXXXXXX
Date: Sun, 1 Jul 2020 00:00:00 +0000
Message-ID: <XXXXXXXXXXXXXXXXXXXXXXXX.EURP189.PROD.OUTLOOK.COM>
Content-Type: multipart/related;
boundary="_004_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_";
type="multipart/alternative"
MIME-Version: 1.0
--_004_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_
Content-Type: multipart/alternative;
boundary="_000_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_"
--_000_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Plain text message body
--_000_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
</head>
<body>
HTML message body
</body>
</html>
--_000_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_--
--_004_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_
Content-Disposition: attachment; filename="new.gif"
Content-Transfer-Encoding: base64
Content-Type: image/gif; name="new.gif"
R0lGODlhOgAWAKEAAPj8+AAAAPi4AAAAACH5BAEAAAAALAAAAAA6ABYAAAKzhI95ktzqlJwzGhGx
1Yh3CjaMRpbmyWFhpaLu6wLeepVBgN35ze+a7jPROjacAMjrHY3LH3M2rDmDQFL1+lStYEhjdRps
wlioXtekw2Ff25PZm22qmV8SCLZM7pRysT9GxJUEx5fmV4dCUTYHhzZIF6cV4pJ2VjQIdnL3Yon4
FgnYBmZpVQkqGSVFRai0FoYa5biqdwgpFKuFp5soA4W7sAsIm/oADLwBi2pBnLosA8EMUAAAOw==
--_004_AM7P189MB067853FA71865A9E5CD65DB3BA680AM7P189MB0678EURP_--
......@@ -677,3 +677,21 @@ void MessageTest::testCRtoLF()
data = "Subject: Test\r\n";
QCOMPARE(CRtoLF(data), "Subject: Test\r\n");
}
void MessageTest::testBugAttachment387423()
{
auto msg = readAndParseMail(QStringLiteral("kmail-attachmentstatus.mbox"));
QCOMPARE(msg->subject()->as7BitString().data(), "Subject: XXXXXXXXXXXXXXXXXXXXX");
qDebug() << "msg->attachments() "<< msg->attachments();
QEXPECT_FAIL("", "Problem with searching attachment", Continue);
QVERIFY(msg->attachments().count() == 1);
KMime::Content *attachment = msg->contents()[1];
QCOMPARE(attachment->contentType(false)->mediaType().data(), "image");
QCOMPARE(attachment->contentType(false)->subType().data(), "gif");
QCOMPARE(attachment->contentType(false)->subType().data(), "gif");
QCOMPARE(attachment->contentDisposition(false)->filename(), QStringLiteral("new.gif"));
QCOMPARE(attachment->contentDisposition(false)->disposition(), Headers::CDattachment);
}
......@@ -51,6 +51,7 @@ private Q_SLOTS:
void testBug392239();
void testCRtoLF();
void testBugAttachment387423();
private:
KMime::Message::Ptr readAndParseMail(const QString &mailFile) const;
};
......
Markdown is supported
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