Commit 3c1606d3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: coding style

parent 2007b7e0
......@@ -36,7 +36,7 @@ using namespace MessageComposer;
#include <MessageCore/AttachmentPart>
using namespace MessageCore;
#define PATH_ATTACHMENTS QLatin1String( KDESRCDIR "/attachments/" )
#define PATH_ATTACHMENTS QLatin1String(KDESRCDIR "/attachments/")
QTEST_MAIN(AttachmentJobTest)
......@@ -112,5 +112,5 @@ void AttachmentJobTest::testTextCharsetAutodetect()
QCOMPARE(result->contentType(false)->charset(), charset);
}
#endif
#endif
......@@ -26,12 +26,10 @@
AttachmentVcardFromAddressBookJobTest::AttachmentVcardFromAddressBookJobTest(QObject *parent)
: QObject(parent)
{
}
AttachmentVcardFromAddressBookJobTest::~AttachmentVcardFromAddressBookJobTest()
{
}
void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithInvalidItem()
......
......@@ -90,7 +90,6 @@ void ComposerTest::testAutoSave()
QCOMPARE(composer->resultMessages().size(), 1);
delete composer;
composer = nullptr;
}
void ComposerTest::testNonAsciiHeaders()
......@@ -158,4 +157,3 @@ void ComposerTest::fillComposerData(Composer *composer)
composer->infoPart()->setTo(QStringList(QStringLiteral("you@you.you")));
composer->textPart()->setWrappedPlainText(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
}
......@@ -23,8 +23,7 @@
#include <QObject>
namespace MessageComposer
{
namespace MessageComposer {
class Composer;
}
......
......@@ -22,12 +22,10 @@
ComposerViewBaseTest::ComposerViewBaseTest(QObject *parent)
: QObject(parent)
{
}
ComposerViewBaseTest::~ComposerViewBaseTest()
{
}
void ComposerViewBaseTest::shouldHaveDefaultValue()
......
......@@ -115,7 +115,7 @@ void CryptoComposerTest::testEncryptSameAttachments_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int) Kleo::OpenPGPMIMEFormat;
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
//TODO: fix Inline PGP with encrypted attachments
//QTest::newRow( "InlineOpenPGP" ) << (int) Kleo::InlineOpenPGPFormat;
}
......@@ -137,7 +137,7 @@ void CryptoComposerTest::testEncryptSameAttachments()
composer->addAttachmentPart(attachment);
composer->setSignAndEncrypt(false, true);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat) format);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat)format);
VERIFYEXEC(composer);
QCOMPARE(composer->resultMessages().size(), 1);
......@@ -148,7 +148,7 @@ void CryptoComposerTest::testEncryptSameAttachments()
//qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verifyEncryption(message.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat) format, true);
(Kleo::CryptoMessageFormat)format, true);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
......@@ -162,19 +162,18 @@ void CryptoComposerTest::testEncryptSameAttachments()
MimeTreeParser::ProcessResult pResult(nh);
otp.parseObjectTree(message.data());
KMime::Message::Ptr unencrypted = nh->unencryptedMessage(message);
KMime::Message::Ptr unencrypted = nh->unencryptedMessage(message);
KMime::Content *testAttachment = Util::findTypeInMessage(unencrypted.data(), "x-some", "x-type");
QCOMPARE(testAttachment->body(), QString::fromLatin1("abc").toUtf8());
QCOMPARE(testAttachment->contentDisposition()->filename(), QString::fromLatin1("anattachment.txt"));
}
void CryptoComposerTest::testEditEncryptAttachments_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int) Kleo::OpenPGPMIMEFormat;
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
//TODO: SMIME should also be tested
}
......@@ -197,7 +196,7 @@ void CryptoComposerTest::testEditEncryptAttachments()
composer->addAttachmentPart(attachment);
composer->setSignAndEncrypt(false, true);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat) format);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat)format);
VERIFYEXEC(composer);
QCOMPARE(composer->resultMessages().size(), 1);
......@@ -218,7 +217,7 @@ void CryptoComposerTest::testEditEncryptAttachments()
// Let's load the email to the viewer
view.setMessage(message, true);
QModelIndex index = model.index(0, 0);
QModelIndex index = model.index(0, 0);
QCOMPARE(editor.toPlainText(), data);
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(index, AttachmentModel::NameRole).toString(), fileName);
......@@ -230,7 +229,7 @@ void CryptoComposerTest::testEditEncryptAttachments()
void CryptoComposerTest::testEditEncryptAndLateAttachments_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int) Kleo::OpenPGPMIMEFormat;
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
//TODO: SMIME should also be tested
}
......@@ -263,7 +262,7 @@ void CryptoComposerTest::testEditEncryptAndLateAttachments()
composer->addAttachmentPart(attachment);
composer->setSignAndEncrypt(false, true);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat) format);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat)format);
VERIFYEXEC(composer);
QCOMPARE(composer->resultMessages().size(), 1);
......@@ -299,8 +298,8 @@ void CryptoComposerTest::testSignEncryptLateAttachments_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int) Kleo::OpenPGPMIMEFormat;
QTest::newRow("InlineOpenPGP") << (int) Kleo::InlineOpenPGPFormat;
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
QTest::newRow("InlineOpenPGP") << (int)Kleo::InlineOpenPGPFormat;
}
void CryptoComposerTest::testSignEncryptLateAttachments()
......@@ -320,7 +319,7 @@ void CryptoComposerTest::testSignEncryptLateAttachments()
composer->addAttachmentPart(attachment);
composer->setSignAndEncrypt(true, true);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat) format);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat)format);
VERIFYEXEC(composer);
QCOMPARE(composer->resultMessages().size(), 1);
......@@ -332,22 +331,21 @@ void CryptoComposerTest::testSignEncryptLateAttachments()
// as we have an additional attachment, just ignore it when checking for sign/encrypt
KMime::Content *b = MessageCore::NodeHelper::firstChild(message.data());
ComposerTestUtil::verifySignatureAndEncryption(b, data.toUtf8(),
(Kleo::CryptoMessageFormat) format, true);
(Kleo::CryptoMessageFormat)format, true);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
// now check the attachment separately
QCOMPARE(QString::fromAscii(MessageCore::NodeHelper::nextSibling(b)->body()), QString::fromAscii("abc"));
}
void CryptoComposerTest::testBCCEncrypt_data()
{
QTest::addColumn<int>("format");
QTest::newRow("OpenPGPMime") << (int) Kleo::OpenPGPMIMEFormat;
QTest::newRow("InlineOpenPGP") << (int) Kleo::InlineOpenPGPFormat;
QTest::newRow("OpenPGPMime") << (int)Kleo::OpenPGPMIMEFormat;
QTest::newRow("InlineOpenPGP") << (int)Kleo::InlineOpenPGPFormat;
}
// secondary recipients
......@@ -377,7 +375,7 @@ void CryptoComposerTest::testBCCEncrypt()
encKeys.append(QPair<QStringList, std::vector<GpgME::Key> >(secondRecipients, skeys));
composer->setSignAndEncrypt(true, true);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat) format);
composer->setMessageCryptoFormat((Kleo::CryptoMessageFormat)format);
composer->setEncryptionKeys(encKeys);
composer->setSigningKeys(keys);
......@@ -391,17 +389,16 @@ void CryptoComposerTest::testBCCEncrypt()
composer = nullptr;
ComposerTestUtil::verifySignatureAndEncryption(primMessage.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat) format);
(Kleo::CryptoMessageFormat)format);
QCOMPARE(primMessage->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(primMessage->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
ComposerTestUtil::verifySignatureAndEncryption(secMessage.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat) format);
(Kleo::CryptoMessageFormat)format);
QCOMPARE(secMessage->from()->asUnicodeString(), QString::fromLocal8Bit("me@me.me"));
QCOMPARE(secMessage->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
}
// inline pgp
......@@ -509,7 +506,8 @@ void CryptoComposerTest::testCTEquPr_data()
QTest::newRow("CTEquPr:Encrypt") << data << false << true << Headers::CE7Bit;
QTest::newRow("CTEquPr:SignEncrypt") << data << true << true << Headers::CE7Bit;
data = QStringLiteral("All happy families are alike;\n\n\n\neach unhappy family is unhappy in its own way.\n--\n hallloasdfasdfsadfsdf asdf sadfasdf sdf sdf sdf sadfasdf sdaf daf sdf asdf sadf asdf asdf [ä]");
data = QStringLiteral(
"All happy families are alike;\n\n\n\neach unhappy family is unhappy in its own way.\n--\n hallloasdfasdfsadfsdf asdf sadfasdf sdf sdf sdf sadfasdf sdaf daf sdf asdf sadf asdf asdf [ä]");
QTest::newRow("CTEquPr:Sign:Newline") << data << true << false << Headers::CEquPr;
QTest::newRow("CTEquPr:Encrypt:Newline") << data << false << true << Headers::CE7Bit;
QTest::newRow("CTEquPr:SignEncrypt:Newline") << data << true << true << Headers::CE7Bit;
......@@ -530,7 +528,8 @@ void CryptoComposerTest::testCTEbase64_data()
QTest::addColumn<bool>("encrypt");
QTest::addColumn<Headers::contentEncoding>("cte");
QString data(QStringLiteral("[ääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääää]"));
QString data(QStringLiteral(
"[ääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääääää]"));
QTest::newRow("CTEbase64:Sign") << data << true << false << Headers::CEbase64;
QTest::newRow("CTEbase64:Encrypt") << data << false << true << Headers::CE7Bit;
QTest::newRow("CTEbase64:SignEncrypt") << data << true << true << Headers::CE7Bit;
......@@ -606,10 +605,9 @@ void CryptoComposerTest::runSMIMETest(bool sign, bool enc, bool opaque)
//qDebug() << "message:" << message->encodedContent();
ComposerTestUtil::verify(sign, enc, message.data(), data.toUtf8(), f, cte);
ComposerTestUtil::verify(sign, enc, message.data(), data.toUtf8(), f, cte);
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("test@example.com"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("you@you.you"));
}
}
......@@ -23,8 +23,7 @@
#include <QObject>
namespace MessageComposer
{
namespace MessageComposer {
class Composer;
}
......
......@@ -56,7 +56,7 @@ void ComposerTestUtil::verify(bool sign, bool encrypt, KMime::Content *content,
void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray &signedContent, Kleo::CryptoMessageFormat f, KMime::Headers::contentEncoding encoding)
{
// store it in a KMime::Message, that's what OTP needs
KMime::Message *resultMessage = new KMime::Message;
KMime::Message *resultMessage = new KMime::Message;
resultMessage->setContent(content->encodedContent());
resultMessage->parse();
......@@ -103,7 +103,6 @@ void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray
QCOMPARE(resultMessage->contentType()->mimeType(), QByteArray("multipart/signed"));
QCOMPARE(resultMessage->contentType()->parameter(QString::fromLatin1("protocol")), QString::fromLatin1("application/pkcs7-signature"));
QCOMPARE(resultMessage->contentType()->parameter(QString::fromLatin1("micalg")), QString::fromLatin1("sha1"));
} else if (f & Kleo::SMIMEOpaqueFormat) {
KMime::Content *signedPart = Util::findTypeInMessage(resultMessage, "application", "pkcs7-mime");
Q_ASSERT(signedPart);
......@@ -124,7 +123,6 @@ void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray
// make sure the good sig is of what we think it is
QCOMPARE(otp.plainTextContent().trimmed(), QString::fromUtf8(signedContent).trimmed());
Q_UNUSED(signedContent);
}
void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArray &encrContent, Kleo::CryptoMessageFormat f, bool withAttachment)
......@@ -151,7 +149,6 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
// process the result..
otp.parseObjectTree(resultMessage.data());
QCOMPARE(nh->encryptionState(resultMessage.data()), MimeTreeParser::KMMsgFullyEncrypted);
} else if (f & Kleo::InlineOpenPGPFormat) {
if (withAttachment) {
//Only first MimePart is the encrypted Text
......@@ -177,7 +174,6 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
otp.parseObjectTree(resultMessage.data());
QCOMPARE(nh->encryptionState(resultMessage.data()), MimeTreeParser::KMMsgFullyEncrypted);
}
QCOMPARE(otp.plainTextContent().trimmed(), QString::fromUtf8(encrContent).trimmed());
Q_UNUSED(encrContent);
......@@ -187,7 +183,7 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
{
Q_UNUSED(withAttachment);
// store it in a KMime::Message, that's what OTP needs
KMime::Message::Ptr resultMessage = KMime::Message::Ptr(new KMime::Message);
KMime::Message::Ptr resultMessage = KMime::Message::Ptr(new KMime::Message);
resultMessage->setContent(content->encodedContent());
resultMessage->parse();
......@@ -235,4 +231,3 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
QCOMPARE(otp.plainTextContent().trimmed(), QString::fromUtf8(origContent).trimmed());
Q_UNUSED(origContent);
}
......@@ -25,14 +25,11 @@
#include <kmime/kmime_headers.h>
#include <QByteArray>
namespace KMime
{
namespace KMime {
class Content;
}
namespace ComposerTestUtil
{
namespace ComposerTestUtil {
/**
* gate function to run verifySignature, verifyEncryption or verifySignatureAndEncryption.
*/
......@@ -53,7 +50,6 @@ void verifyEncryption(KMime::Content *content, const QByteArray &encrContent, Kl
* Verifies that the given MIME content is signed and then encrypted, and the original text is as specified
*/
void verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment = false);
}
#endif
......@@ -53,7 +53,6 @@ void EncryptJobTest::initTestCase()
void EncryptJobTest::testContentDirect()
{
MessageComposer::Composer *composer = new MessageComposer::Composer;
QList<QByteArray> charsets;
charsets << "us-ascii";
......@@ -84,7 +83,6 @@ void EncryptJobTest::testContentDirect()
eJob->setEncryptionKeys(keys);
checkEncryption(eJob);
}
void EncryptJobTest::testContentChained()
......@@ -117,7 +115,6 @@ void EncryptJobTest::testContentChained()
eJob->setContent(mainTextJob->content());
checkEncryption(eJob);
}
void EncryptJobTest::testHeaders()
......@@ -160,7 +157,6 @@ void EncryptJobTest::testHeaders()
void EncryptJobTest::checkEncryption(MessageComposer::EncryptJob *eJob)
{
VERIFYEXEC(eJob);
KMime::Content *result = eJob->content();
......@@ -168,6 +164,4 @@ void EncryptJobTest::checkEncryption(MessageComposer::EncryptJob *eJob)
result->assemble();
ComposerTestUtil::verifyEncryption(result, QString::fromLocal8Bit("one flew over the cuckoo's nest").toUtf8(), Kleo::OpenPGPMIMEFormat);
}
......@@ -26,8 +26,7 @@
#include <gpgme++/key.h>
#include <gpgme++/keylistresult.h>
namespace MessageComposer
{
namespace MessageComposer {
class EncryptJob;
}
......@@ -45,7 +44,6 @@ private Q_SLOTS:
private:
void checkEncryption(MessageComposer::EncryptJob *eJob);
};
#endif
......@@ -32,12 +32,10 @@
FollowupReminderSelectDateDialogTest::FollowupReminderSelectDateDialogTest(QObject *parent)
: QObject(parent)
{
}
FollowupReminderSelectDateDialogTest::~FollowupReminderSelectDateDialogTest()
{
}
QStandardItemModel *FollowupReminderSelectDateDialogTest::defaultItemModel()
......
......@@ -39,4 +39,3 @@ private:
};
#endif // FOLLOWUPREMINDERSELECTDATEDIALOGTEST_H
......@@ -23,12 +23,10 @@
GlobalPartTest::GlobalPartTest(QObject *parent)
: QObject(parent)
{
}
GlobalPartTest::~GlobalPartTest()
{
}
void GlobalPartTest::shouldHaveDefaultValue()
......
......@@ -23,12 +23,10 @@
InfoPartTest::InfoPartTest(QObject *parent)
: QObject(parent)
{
}
InfoPartTest::~InfoPartTest()
{
}
void InfoPartTest::shouldHaveDefaultValue()
......
......@@ -310,4 +310,3 @@ void MainTextJobTest::testHtmlWithImages()
}
}
}
......@@ -63,19 +63,19 @@ void initLocale()
setenv("LC_ALL", "en_US.utf-8", 1);
setenv("TZ", "UTC", 1);
}
Q_CONSTRUCTOR_FUNCTION(initLocale)
#endif
namespace
{
template <typename String>
namespace {
template<typename String>
String very_simplistic_diff(const String &a, const String &b)
{
const QList<String> al = a.split('\n');
const QList<String> bl = b.split('\n');
String result;
int ai = 0, bi = 0;
while (ai < al.size() && bi < bl.size())
while (ai < al.size() && bi < bl.size()) {
if (al[ai] == bl[bi]) {
//qDebug( "found equal line a@%d x b@%d", ai, bi );
result += " " + al[ai] + '\n';
......@@ -88,15 +88,16 @@ String very_simplistic_diff(const String &a, const String &b)
//qDebug( " b_in_a == %d", b_in_a );
//qDebug( " a_in_b == %d", a_in_b );
if (b_in_a == -1) {
if (a_in_b == -1)
if (a_in_b == -1) {
// (at least) one line changed:
result += "- " + al[ai++] + '\n'
+ "+ " + bl[bi++] + '\n';
else
} else {
// some lines added:
while (bi < a_in_b) {
result += "+ " + bl[bi++] + '\n';
}
}
} else {
// some lines removed:
while (ai < b_in_a) {
......@@ -109,6 +110,7 @@ String very_simplistic_diff(const String &a, const String &b)
}
//qDebug( "result ( a@%d b@%d ):\n%s\n--end", ai, bi, result.constData() );
}
}
const int sizeal(al.size());
for (int i = ai; i < sizeal; ++i) {
......@@ -122,10 +124,10 @@ String very_simplistic_diff(const String &a, const String &b)
}
}
#define QCOMPARE_OR_DIFF( a, b ) \
if ( a != b ) \
qDebug( "diff:\n--begin--\n%s\n--end--", very_simplistic_diff( a, b ).constData() ); \
QVERIFY( a == b )
#define QCOMPARE_OR_DIFF(a, b) \
if (a != b) { \
qDebug("diff:\n--begin--\n%s\n--end--", very_simplistic_diff(a, b).constData());} \
QVERIFY(a == b)
QTEST_MAIN(MessageFactoryTest)
......@@ -172,7 +174,6 @@ KMime::Message::Ptr MessageFactoryTest::loadMessage(const QString &filename)
return origMsg;
}
void MessageFactoryTest::testCreateReplyToAllWithUseSenderAndIdentityInCCAsync()
{
const QString filename(QStringLiteral(MAIL_DATA_DIR) + QStringLiteral("/replyall_with_identity_message_and_identity_in_cc.mbox"));
......@@ -239,7 +240,6 @@ void MessageFactoryTest::testCreateReplyToAllWithUseSenderAsync()
factory.setReplyStrategy(ReplyAll);
factory.setIdentityManager(mIdentMan);
QSignalSpy spy(&factory, &MessageFactoryNG::createReplyDone);
factory.createReplyAsync();
......@@ -379,7 +379,8 @@ void MessageFactoryTest::testCreateReplyToAuthorAsync()
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime += QLatin1Char(' ') + QLocale::system().toString(date.time(), QLocale::LongFormat);
QString replyStr = QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QString replyStr
= QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QCOMPARE(reply.msg->subject()->asUnicodeString(), QLatin1String("Re: Test Email Subject"));
QCOMPARE_OR_DIFF(reply.msg->body(), replyStr.toLatin1());
QString replyTo = reply.msg->inReplyTo()->asUnicodeString();
......@@ -423,7 +424,8 @@ void MessageFactoryTest::testCreateReplyAllWithMultiEmailsAsync()
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime += QLatin1Char(' ') + QLocale::system().toString(date.time(), QLocale::LongFormat);
QString replyStr = QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QString replyStr
= QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QCOMPARE(reply.msg->subject()->asUnicodeString(), QLatin1String("Re: Test Email Subject"));
QString replyTo = reply.msg->inReplyTo()->asUnicodeString();
......@@ -461,7 +463,8 @@ void MessageFactoryTest::testCreateReplyAllAsync()
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime += QLatin1Char(' ') + QLocale::system().toString(date.time(), QLocale::LongFormat);
QString replyStr = QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QString replyStr
= QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QCOMPARE(reply.msg->subject()->asUnicodeString(), QLatin1String("Re: Test Email Subject"));
QCOMPARE_OR_DIFF(reply.msg->body(), replyStr.toLatin1());
}
......@@ -556,26 +559,26 @@ void MessageFactoryTest::testCreateForwardMultiEmailsAsync()
datetime += QLatin1String(", ") + QLocale::system().toString(date.time(), QLocale::LongFormat);
QString fwdMsg = QString::fromLatin1(
"From: another <another@another.com>\n"
"Date: %2\n"
"X-KMail-Transport: 0\n"
"MIME-Version: 1.0\n"
"Subject: Fwd: Test Email Subject\n"
"Content-Type: text/plain; charset=\"US-ASCII\"\n"
"Content-Transfer-Encoding: 8Bit\n"
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: forward\n"
"\n"
"---------- Forwarded Message ----------\n"
"\n"
"Subject: Test Email Subject\n"
"Date: %1\n"
"From: me@me.me\n"
"To: you@you.you, you2@you.you\n"
"CC: cc@cc.cc, cc2@cc.cc\n"
"\n"
"All happy families are alike; each unhappy family is unhappy in its own way.\n"
"-----------------------------------------");
"From: another <another@another.com>\n"
"Date: %2\n"
"X-KMail-Transport: 0\n"
"MIME-Version: 1.0\n"
"Subject: Fwd: Test Email Subject\n"
"Content-Type: text/plain; charset=\"US-ASCII\"\n"
"Content-Transfer-Encoding: 8Bit\n"
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: forward\n"
"\n"
"---------- Forwarded Message ----------\n"