Commit a5d0ad10 authored by Sandro Knauß's avatar Sandro Knauß 🐝
Browse files

enable TemplateParserJobTest::test_replyPlain again.

Summary:
processWithTemplate does modify `msg` so we endup with invalid pointers,
if there are related images added for the reply.

Reviewers: #kde_pim

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D20753
parent d7f78cc2
......@@ -190,27 +190,19 @@ void TemplateParserJobTest::test_replyPlain()
const QByteArray mailData = KMime::CRLFtoLF(mailFile.readAll());
QVERIFY(!mailData.isEmpty());
KMime::Message::Ptr msg(new KMime::Message);
msg->setContent(mailData);
msg->parse();
KMime::Message::Ptr origMsg(new KMime::Message);
origMsg->setContent(mailData);
origMsg->parse();
// load expected result
QFile referenceFile(referenceFileName);
QVERIFY(referenceFile.open(QIODevice::ReadOnly));
const QByteArray referenceRawData = KMime::CRLFtoLF(referenceFile.readAll());
const QString referenceData = QString::fromLatin1(referenceRawData);
// QVERIFY(!referenceData.isEmpty());
// QCOMPARE(msg->subject()->as7BitString(false).constData(), "Plain Message Test");
// QCOMPARE(msg->contents().size(), 0);
QVERIFY(!referenceData.isEmpty());
TemplateParser::TemplateParserJob *parser = new TemplateParser::TemplateParserJob(msg, TemplateParser::TemplateParserJob::Reply);
//KIdentityManagement::IdentityManager *identMan = new KIdentityManagement::IdentityManager;
//parser->setIdentityManager(identMan);
parser->d->mOtp->parseObjectTree(msg.data());
parser->d->mOrigMsg = msg;
//QVERIFY(parser->mOtp->htmlContent().isEmpty());
//QVERIFY(!parser->mOtp->plainTextContent().isEmpty());
parser->d->mOrigMsg = origMsg;
QSignalSpy spy(parser, &TemplateParser::TemplateParserJob::parsingDone);
parser->processWithTemplate(QString());
......
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