Commit ada4b403 authored by Laurent Montel's avatar Laurent Montel 😁

Improve autotest

parent cdfd44e6
......@@ -743,10 +743,10 @@ void ContentTest::testFreezing()
delete msg;
}
void ContentTest::testContentTypeMimetype()
void ContentTest::testContentTypeMimetype_data()
{
//TODO improve test
QTest::addColumn<QByteArray>("data");
QTest::addColumn<QByteArray>("mimetype");
QByteArray data =
"From: Nathaniel Borenstein <nsb@bellcore.com>\n"
"To: Ned Freed <ned@innosoft.com>\n"
......@@ -773,10 +773,19 @@ void ContentTest::testContentTypeMimetype()
"\n"
"This is the epilogue. It is also to be ignored.\n";
QTest::newRow("multipart") << data << QByteArrayLiteral("multipart/mixed");
}
void ContentTest::testContentTypeMimetype()
{
QFETCH(QByteArray, data);
QFETCH(QByteArray, mimetype);
// test parsing
Message *msg = new Message();
msg->setContent(data);
msg->parse();
QVERIFY(msg->contentType()->isMultipart());
QCOMPARE(msg->contentType(false)->mimeType(), QByteArrayLiteral("multipart/mixed"));
QCOMPARE(msg->contentType(false)->mimeType(), mimetype);
}
......@@ -44,6 +44,7 @@ private Q_SLOTS:
// TODO: grab samples from http://www.yenc.org/develop.htm and make a Yenc test
void testParent();
void testFreezing();
void testContentTypeMimetype_data();
void testContentTypeMimetype();
};
......
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