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

Improve autotest

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