Commit 5a01983d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent 83abd3a2
......@@ -14,8 +14,8 @@
#include <itemfetchscope.h>
#include <itemmodifyjob.h>
#include <kmime/kmime_message.h>
#include "akonadi/kmime/messageparts.h"
#include <kmime/kmime_message.h>
#define WAIT_TIME 100
......
......@@ -14,8 +14,8 @@
#include <itemfetchjob.h>
#include <itemfetchscope.h>
#include <kmime/kmime_message.h>
#include "akonadi/kmime/messageparts.h"
#include <kmime/kmime_message.h>
using namespace Akonadi;
......
......@@ -14,8 +14,8 @@
#include <itemfetchjob.h>
#include <itemfetchscope.h>
#include <kmime/kmime_message.h>
#include "akonadi/kmime/messageparts.h"
#include <kmime/kmime_message.h>
using namespace Akonadi;
......
......@@ -9,8 +9,8 @@
#include "testvcard.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QCommandLineParser>
int main(int argc, char *argv[])
{
......@@ -18,8 +18,12 @@ int main(int argc, char *argv[])
QCommandLineParser parser;
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("maildir"), QStringLiteral("Path to maildir to be used as data source"), QStringLiteral("argument")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("vcarddir"), QStringLiteral("Path to vvcarddir to be used as data source"), QStringLiteral("argument")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("maildir"),
QStringLiteral("Path to maildir to be used as data source"),
QStringLiteral("argument")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("vcarddir"),
QStringLiteral("Path to vvcarddir to be used as data source"),
QStringLiteral("argument")));
parser.process(app);
......
......@@ -12,19 +12,17 @@
#include <collectionfetchjob.h>
#include <collectionfetchscope.h>
#include <QDebug>
#include <QTest>
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDebug>
#include <QTest>
using namespace Akonadi;
MakeTest::MakeTest()
{
connect(AgentManager::self(), &AgentManager::instanceRemoved,
this, &MakeTest::instanceRemoved);
connect(AgentManager::self(), &AgentManager::instanceStatusChanged,
this, &MakeTest::instanceStatusChanged);
connect(AgentManager::self(), &AgentManager::instanceRemoved, this, &MakeTest::instanceRemoved);
connect(AgentManager::self(), &AgentManager::instanceStatusChanged, this, &MakeTest::instanceStatusChanged);
}
void MakeTest::createAgent(const QString &name)
......@@ -42,13 +40,16 @@ void MakeTest::createAgent(const QString &name)
qDebug() << " Created resource instance" << currentInstance.identifier();
}
QTest::qWait(100); //fix this hack
QTest::qWait(100); // fix this hack
}
void MakeTest::configureDBusIface(const QString &name, const QString &dir)
{
auto configIface = new QDBusInterface(QLatin1String("org.freedesktop.Akonadi.Resource.") + currentInstance.identifier(),
QStringLiteral("/Settings"), QLatin1String("org.kde.Akonadi.") + name + QLatin1String(".Settings"), QDBusConnection::sessionBus(), this);
QStringLiteral("/Settings"),
QLatin1String("org.kde.Akonadi.") + name + QLatin1String(".Settings"),
QDBusConnection::sessionBus(),
this);
configIface->call(QStringLiteral("setPath"), dir);
configIface->call(QStringLiteral("setReadOnly"), true);
......@@ -67,10 +68,10 @@ void MakeTest::instanceRemoved(const AgentInstance &instance)
void MakeTest::instanceStatusChanged(const AgentInstance &instance)
{
//qDebug() << "agent status changed:" << agentIdentifier << status << message ;
// qDebug() << "agent status changed:" << agentIdentifier << status << message ;
if (instance == currentInstance) {
if (instance.status() == AgentInstance::Running) {
//qDebug() << " " << message;
// qDebug() << " " << message;
}
if (instance.status() == AgentInstance::Idle) {
done = true;
......
......@@ -32,6 +32,7 @@ protected:
void removeCollections();
void removeResource();
virtual void runTest() = 0;
public:
MakeTest();
void start();
......
......@@ -5,10 +5,10 @@
*/
#include "testmaildir.h"
#include "maildir/maildirimport.h"
#include "maildir/maildirfetchallheaders.h"
#include "maildir/maildir20percentread.h"
#include "maildir/maildirfetchallheaders.h"
#include "maildir/maildirfetchunreadheaders.h"
#include "maildir/maildirimport.h"
TestMailDir::TestMailDir(const QString &dir)
{
......
......@@ -5,8 +5,8 @@
*/
#include "vcardimport.h"
#include <QTest>
#include <QDebug>
#include <QTest>
#define WAIT_TIME 50
......
......@@ -12,6 +12,10 @@
#include <QDebug>
#include "../src/specialmailcollectionstesting_p.h"
#include "specialcollectionattribute.h"
#include "specialcollections.h"
#include <QStandardPaths>
#include <agentinstance.h>
#include <agentmanager.h>
#include <collectioncreatejob.h>
......@@ -20,12 +24,8 @@
#include <collectionmodifyjob.h>
#include <control.h>
#include <qtest_akonadi.h>
#include "specialcollectionattribute.h"
#include "specialcollections.h"
#include <specialmailcollections.h>
#include <specialmailcollectionsrequestjob.h>
#include <QStandardPaths>
#include "../src/specialmailcollectionstesting_p.h"
using namespace Akonadi;
......@@ -70,7 +70,7 @@ void LocalFoldersRequestJobTest::testRequestWithNoDefaultResourceExisting()
QCOMPARE(spy.count(), 1);
QCOMPARE(defSpy.count(), 1);
QCOMPARE(smct->_t_knownResourceCount(), 1);
QCOMPARE(smct->_t_knownFolderCount(), 3); // Outbox, Drafts, and Root.
QCOMPARE(smct->_t_knownFolderCount(), 3); // Outbox, Drafts, and Root.
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Outbox));
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Drafts));
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Root));
......@@ -100,13 +100,13 @@ void LocalFoldersRequestJobTest::testRequestWithDefaultResourceAlreadyExisting()
// Request some default folders.
{
SpecialMailCollectionsRequestJob *rjob = new SpecialMailCollectionsRequestJob(this);
rjob->requestDefaultCollection(SpecialMailCollections::Outbox); // Exists previously.
rjob->requestDefaultCollection(SpecialMailCollections::Inbox); // Must be created.
rjob->requestDefaultCollection(SpecialMailCollections::Outbox); // Exists previously.
rjob->requestDefaultCollection(SpecialMailCollections::Inbox); // Must be created.
AKVERIFYEXEC(rjob);
QCOMPARE(spy.count(), 1);
QCOMPARE(defSpy.count(), 1);
QCOMPARE(smct->_t_knownResourceCount(), 1);
QCOMPARE(smct->_t_knownFolderCount(), 4); // Inbox, Outbox, Drafts, and Root.
QCOMPARE(smct->_t_knownFolderCount(), 4); // Inbox, Outbox, Drafts, and Root.
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Inbox));
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Outbox));
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Drafts));
......@@ -163,12 +163,13 @@ void LocalFoldersRequestJobTest::testMixedRequest()
// Request some folders, both in our default resource and in the knut resource.
{
SpecialMailCollectionsRequestJob *rjob = new SpecialMailCollectionsRequestJob(this);
rjob->requestDefaultCollection(SpecialMailCollections::Outbox); // Exists previously.
rjob->requestDefaultCollection(SpecialMailCollections::SentMail); // Must be created.
rjob->requestCollection(SpecialMailCollections::Outbox, AgentManager::self()->instance(res1.resource())); // Exists previously, but unregistered with LF.
rjob->requestCollection(SpecialMailCollections::SentMail, AgentManager::self()->instance(res1.resource())); // Must be created.
rjob->requestDefaultCollection(SpecialMailCollections::Outbox); // Exists previously.
rjob->requestDefaultCollection(SpecialMailCollections::SentMail); // Must be created.
rjob->requestCollection(SpecialMailCollections::Outbox,
AgentManager::self()->instance(res1.resource())); // Exists previously, but unregistered with LF.
rjob->requestCollection(SpecialMailCollections::SentMail, AgentManager::self()->instance(res1.resource())); // Must be created.
AKVERIFYEXEC(rjob);
QCOMPARE(spy.count(), 2); // Default resource and knut resource.
QCOMPARE(spy.count(), 2); // Default resource and knut resource.
QCOMPARE(defSpy.count(), 1);
QCOMPARE(smct->_t_knownResourceCount(), 2);
QVERIFY(smc->hasDefaultCollection(SpecialMailCollections::Outbox));
......
......@@ -14,6 +14,11 @@
#include <QFile>
#include <QSignalSpy>
#include "../src/specialmailcollectionstesting_p.h"
#include "specialcollectionattribute.h"
#include "specialcollections.h"
#include <KLocalizedString>
#include <QStandardPaths>
#include <agentinstance.h>
#include <agentmanager.h>
#include <collectioncreatejob.h>
......@@ -21,14 +26,9 @@
#include <collectionfetchjob.h>
#include <collectionmodifyjob.h>
#include <control.h>
#include <KLocalizedString>
#include <servermanager.h>
#include <qtest_akonadi.h>
#include "specialcollectionattribute.h"
#include "specialcollections.h"
#include <servermanager.h>
#include <specialmailcollections.h>
#include <QStandardPaths>
#include "../src/specialmailcollectionstesting_p.h"
using namespace Akonadi;
......@@ -545,7 +545,7 @@ void LocalFoldersTest::testDefaultResourceJob()
resjob->setIconForTypeMap(mIconNameMap);
AKVERIFYEXEC(resjob);
QCOMPARE(resourceId, resjob->resourceId()); // Did not mistakenly create another resource.
QCOMPARE(resourceId, resjob->resourceId()); // Did not mistakenly create another resource.
const Collection::List folders = resjob->specialCollections();
QCOMPARE(folders.count(), 2);
QVERIFY(folders.contains(maildirRoot));
......@@ -558,9 +558,7 @@ void LocalFoldersTest::testRecoverDefaultResource()
// The maildirs should exist (created in testDefaultResourceJob).
const QString xdgPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/');
const QString rootPath = xdgPath + QLatin1String("local-mail");
const QString outboxPath = xdgPath + QString::fromLatin1(".%1.directory/%2") \
.arg(QLatin1String("local-mail"))
.arg(QLatin1String("outbox"));
const QString outboxPath = xdgPath + QString::fromLatin1(".%1.directory/%2").arg(QLatin1String("local-mail")).arg(QLatin1String("outbox"));
QVERIFY(QFile::exists(rootPath));
QVERIFY(QFile::exists(outboxPath));
......@@ -586,7 +584,7 @@ void LocalFoldersTest::testRecoverDefaultResource()
resjob->setIconForTypeMap(mIconNameMap);
AKVERIFYEXEC(resjob);
QVERIFY(resjob->resourceId() != oldResourceId); // Created another resource.
QVERIFY(resjob->resourceId() != oldResourceId); // Created another resource.
Collection::List folders = resjob->specialCollections();
QCOMPARE(folders.count(), 2);
......
......@@ -12,7 +12,8 @@
/**
*/
namespace Akonadi {
namespace Akonadi
{
class LocalFoldersTest : public QObject
{
Q_OBJECT
......
......@@ -19,15 +19,15 @@ using namespace KMime;
void MailSerializerPluginTest::testMailPlugin()
{
QByteArray serialized
= "From: sender@test.org\n"
"Subject: Serializer Test\n"
"To: receiver@test.org\n"
"Date: Fri, 22 Jun 2007 17:24:24 +0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain\n"
"\n"
"Body data.";
QByteArray serialized =
"From: sender@test.org\n"
"Subject: Serializer Test\n"
"To: receiver@test.org\n"
"Date: Fri, 22 Jun 2007 17:24:24 +0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain\n"
"\n"
"Body data.";
// deserializing
Item item;
......@@ -50,15 +50,15 @@ void MailSerializerPluginTest::testMessageIntegrity()
{
// A message that will be slightly modified if KMime::Content::assemble() is
// called. We want to avoid this, because it breaks signatures.
QByteArray serialized
= "from: sender@example.com\n"
"to: receiver@example.com\n"
"Subject: Serializer Test\n"
"Date: Thu, 30 Jul 2009 13:46:31 +0300\n"
"MIME-Version: 1.0\n"
"Content-type: text/plain; charset=us-ascii\n"
"\n"
"Bla bla bla.";
QByteArray serialized =
"from: sender@example.com\n"
"to: receiver@example.com\n"
"Subject: Serializer Test\n"
"Date: Thu, 30 Jul 2009 13:46:31 +0300\n"
"MIME-Version: 1.0\n"
"Content-type: text/plain; charset=us-ascii\n"
"\n"
"Bla bla bla.";
// Deserialize.
Item item;
......
......@@ -12,8 +12,8 @@
#include <KMime/Message>
#include <QTest>
#include <QBuffer>
#include <QTest>
using namespace Akonadi;
using namespace KMime;
......@@ -39,62 +39,37 @@ void MailSerializerTest::testEnvelopeDeserialize_data()
QTest::newRow("v1 - no references")
<< 1
<< QByteArray(
R"(("Wed, 1 Feb 2006 13:37:19 UT" "IMPORTANT: Akonadi Test" (("Tobias Koenig" NIL "tokoe" "kde.org")) (("Tobias Koenig" NIL "tokoe" "kde.org")) NIL (("Ingo Kloecker" NIL "kloecker" "kde.org")) NIL NIL NIL <{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>))")
<< QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC)
<< QStringLiteral("IMPORTANT: Akonadi Test")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>")
<< QString()
<< QStringLiteral("Ingo Kloecker <kloecker@kde.org>")
<< QString() << QString() << QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>")
<< QString();
R"(("Wed, 1 Feb 2006 13:37:19 UT" "IMPORTANT: Akonadi Test" (("Tobias Koenig" NIL "tokoe" "kde.org")) (("Tobias Koenig" NIL "tokoe" "kde.org")) NIL (("Ingo Kloecker" NIL "kloecker" "kde.org")) NIL NIL NIL <{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>))")
<< QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC) << QStringLiteral("IMPORTANT: Akonadi Test")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>") << QStringLiteral("Tobias Koenig <tokoe@kde.org>") << QString()
<< QStringLiteral("Ingo Kloecker <kloecker@kde.org>") << QString() << QString() << QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>") << QString();
QTest::newRow("v1 - with references")
<< 1
<< QByteArray(
R"(("Wed, 1 Feb 2006 13:37:19 UT" "IMPORTANT: Akonadi Test" (("Tobias Koenig" NIL "tokoe" "kde.org")) (("Tobias Koenig" NIL "tokoe" "kde.org")) NIL (("Ingo Kloecker" NIL "kloecker" "kde.org")) NIL NIL NIL <{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org> "<{8888827e-77f4-489d-bf18-e805be96718c}@server.kde.org> <{9999927e-77f4-489d-bf18-e805be96718c}@server.kde.org>"))")
<< QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC)
<< QStringLiteral("IMPORTANT: Akonadi Test")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>")
<< QString()
<< QStringLiteral("Ingo Kloecker <kloecker@kde.org>")
<< QString()
<< QString()
<< QString()
R"(("Wed, 1 Feb 2006 13:37:19 UT" "IMPORTANT: Akonadi Test" (("Tobias Koenig" NIL "tokoe" "kde.org")) (("Tobias Koenig" NIL "tokoe" "kde.org")) NIL (("Ingo Kloecker" NIL "kloecker" "kde.org")) NIL NIL NIL <{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org> "<{8888827e-77f4-489d-bf18-e805be96718c}@server.kde.org> <{9999927e-77f4-489d-bf18-e805be96718c}@server.kde.org>"))")
<< QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC) << QStringLiteral("IMPORTANT: Akonadi Test")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>") << QStringLiteral("Tobias Koenig <tokoe@kde.org>") << QString()
<< QStringLiteral("Ingo Kloecker <kloecker@kde.org>") << QString() << QString() << QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>")
<< QStringLiteral("<{8888827e-77f4-489d-bf18-e805be96718c}@server.kde.org> <{9999927e-77f4-489d-bf18-e805be96718c}@server.kde.org>");
QBuffer buffer;
buffer.open(QIODevice::WriteOnly);
QDataStream stream(&buffer);
stream << QDateTime(QDate(2015, 6, 29), QTime(23, 50, 10), Qt::UTC)
<< QStringLiteral("Důležité: Testování Akonadi")
<< QStringLiteral("<1234567.icameup@withthis>")
<< QStringLiteral("<2849719.IhmDc3qecs@thor>")
<< QStringLiteral("<1234567.icameup@withthis> <7654321.icameupwith@thistoo>")
<< 1 << QStringLiteral("Daniel Vrátil") << QStringLiteral("dvratil") << QStringLiteral("kde.org")
<< 1 << QStringLiteral("Daniel Vrátil") << QStringLiteral("dvratil") << QStringLiteral("kde.org")
<< 0
<< 1 << QStringLiteral("Volker Krause") << QStringLiteral("vkrause") << QStringLiteral("kde.org")
<< 0
<< 0;
QTest::newRow("v2")
<< 2
<< buffer.data()
<< QDateTime(QDate(2015, 6, 29), QTime(23, 50, 10), Qt::UTC)
<< QStringLiteral("Důležité: Testování Akonadi")
<< QStringLiteral("Daniel Vrátil <dvratil@kde.org>")
<< QStringLiteral("Daniel Vrátil <dvratil@kde.org>")
<< QString() // reply to
<< QStringLiteral("Volker Krause <vkrause@kde.org>")
<< QString() // cc
<< QString() // bcc
<< QStringLiteral("<1234567.icameup@withthis>")
<< QStringLiteral("<2849719.IhmDc3qecs@thor>")
<< QStringLiteral("<1234567.icameup@withthis> <7654321.icameupwith@thistoo>");
stream << QDateTime(QDate(2015, 6, 29), QTime(23, 50, 10), Qt::UTC) << QStringLiteral("Důležité: Testování Akonadi")
<< QStringLiteral("<1234567.icameup@withthis>") << QStringLiteral("<2849719.IhmDc3qecs@thor>")
<< QStringLiteral("<1234567.icameup@withthis> <7654321.icameupwith@thistoo>") << 1 << QStringLiteral("Daniel Vrátil") << QStringLiteral("dvratil")
<< QStringLiteral("kde.org") << 1 << QStringLiteral("Daniel Vrátil") << QStringLiteral("dvratil") << QStringLiteral("kde.org") << 0 << 1
<< QStringLiteral("Volker Krause") << QStringLiteral("vkrause") << QStringLiteral("kde.org") << 0 << 0;
QTest::newRow("v2") << 2 << buffer.data() << QDateTime(QDate(2015, 6, 29), QTime(23, 50, 10), Qt::UTC) << QStringLiteral("Důležité: Testování Akonadi")
<< QStringLiteral("Daniel Vrátil <dvratil@kde.org>") << QStringLiteral("Daniel Vrátil <dvratil@kde.org>") << QString() // reply to
<< QStringLiteral("Volker Krause <vkrause@kde.org>") << QString() // cc
<< QString() // bcc
<< QStringLiteral("<1234567.icameup@withthis>") << QStringLiteral("<2849719.IhmDc3qecs@thor>")
<< QStringLiteral("<1234567.icameup@withthis> <7654321.icameupwith@thistoo>");
}
void MailSerializerTest::testEnvelopeDeserialize()
......@@ -162,30 +137,14 @@ void MailSerializerTest::testEnvelopeSerialize_data()
QBuffer buffer;
buffer.open(QIODevice::WriteOnly);
QDataStream stream(&buffer);
stream << QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC)
<< QStringLiteral("IMPORTANT: Akonadi Test")
<< QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>")
<< QString()
<< 1 << QStringLiteral("Tobias Koenig") << QStringLiteral("tokoe") << QStringLiteral("kde.org")
<< 1 << QStringLiteral("Tobias Koenig") << QStringLiteral("tokoe") << QStringLiteral("kde.org")
<< 0
<< 1 << QStringLiteral("Ingo Kloecker") << QStringLiteral("kloecker") << QStringLiteral("kde.org")
<< 0
<< 0;
QTest::newRow("")
<< QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC)
<< QStringLiteral("IMPORTANT: Akonadi Test")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>")
<< QString()
<< QStringLiteral("Ingo Kloecker <kloecker@kde.org>")
<< QString()
<< QString()
<< QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>")
<< QString()
<< buffer.data();
stream << QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC) << QStringLiteral("IMPORTANT: Akonadi Test") << QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>") << QString() << 1 << QStringLiteral("Tobias Koenig")
<< QStringLiteral("tokoe") << QStringLiteral("kde.org") << 1 << QStringLiteral("Tobias Koenig") << QStringLiteral("tokoe")
<< QStringLiteral("kde.org") << 0 << 1 << QStringLiteral("Ingo Kloecker") << QStringLiteral("kloecker") << QStringLiteral("kde.org") << 0 << 0;
QTest::newRow("") << QDateTime(QDate(2006, 2, 1), QTime(13, 37, 19), Qt::UTC) << QStringLiteral("IMPORTANT: Akonadi Test")
<< QStringLiteral("Tobias Koenig <tokoe@kde.org>") << QStringLiteral("Tobias Koenig <tokoe@kde.org>") << QString()
<< QStringLiteral("Ingo Kloecker <kloecker@kde.org>") << QString() << QString() << QString()
<< QStringLiteral("<{7b55527e-77f4-489d-bf18-e805be96718c}@server.kde.org>") << QString() << buffer.data();
}
void MailSerializerTest::testEnvelopeSerialize()
......@@ -270,12 +229,13 @@ void MailSerializerTest::testHeaderFetch()
auto serializer = new SerializerPluginMail();
QByteArray headerData("From: David Johnson <david@usermode.org>\n"
"To: kde-commits@kde.org\n"
"MIME-Version: 1.0\n"
"Date: Sun, 01 Feb 2009 06:25:22 +0000\n"
"Message-Id: <1233469522.741324.18468.nullmailer@svn.kde.org>\n"
"Subject: [kde-doc-english] KDE/kdeutils/kcalc\n");
QByteArray headerData(
"From: David Johnson <david@usermode.org>\n"
"To: kde-commits@kde.org\n"
"MIME-Version: 1.0\n"
"Date: Sun, 01 Feb 2009 06:25:22 +0000\n"
"Message-Id: <1233469522.741324.18468.nullmailer@svn.kde.org>\n"
"Subject: [kde-doc-english] KDE/kdeutils/kcalc\n");
QString expectedSubject = QStringLiteral("[kde-doc-english] KDE/kdeutils/kcalc");
QString expectedFrom = QStringLiteral("David Johnson <david@usermode.org>");
......@@ -309,14 +269,15 @@ void MailSerializerTest::testMultiDeserialize()
auto serializer = new SerializerPluginMail();
QByteArray messageData("From: David Johnson <david@usermode.org>\n"
"To: kde-commits@kde.org\n"
"MIME-Version: 1.0\n"
"Date: Sun, 01 Feb 2009 06:25:22 +0000\n"
"Subject: [kde-doc-english] KDE/kdeutils/kcalc\n"
"Content-Type: text/plain\n"
"\n"
"This is content");
QByteArray messageData(
"From: David Johnson <david@usermode.org>\n"
"To: kde-commits@kde.org\n"
"MIME-Version: 1.0\n"
"Date: Sun, 01 Feb 2009 06:25:22 +0000\n"
"Subject: [kde-doc-english] KDE/kdeutils/kcalc\n"
"Content-Type: text/plain\n"
"\n"
"This is content");
QString expectedSubject = QStringLiteral("[kde-doc-english] KDE/kdeutils/kcalc");
QString expectedFrom = QStringLiteral("David Johnson <david@usermode.org>");
......@@ -339,15 +300,16 @@ void MailSerializerTest::testMultiDeserialize()
buffer.close();
messageData = QByteArray("From: DIFFERENT CONTACT <DIFFERENTCONTACT@example.org>\n"
"To: kde-commits@kde.org\n"
"MIME-Version: 1.0\n"
"Date: Sun, 01 Feb 2009 06:25:22 +0000\n"
"Message-Id: <1233469522.741324.18468.nullmailer@svn.kde.org>\n"
"Subject: [kde-doc-english] KDE/kdeutils/kcalc\n"
"Content-Type: text/plain\n"
"\r\n"
"This is content");
messageData = QByteArray(
"From: DIFFERENT CONTACT <DIFFERENTCONTACT@example.org>\n"
"To: kde-commits@kde.org\n"
"MIME-Version: 1.0\n"
"Date: Sun, 01 Feb 2009 06:25:22 +0000\n"
"Message-Id: <1233469522.741324.18468.nullmailer@svn.kde.org>\n"
"Subject: [kde-doc-english] KDE/kdeutils/kcalc\n"
"Content-Type: text/plain\n"
"\r\n"
"This is content");
buffer.setData(messageData);
buffer.open(QIODevice::ReadOnly);
......
......@@ -5,8 +5,8 @@
*/
#include "messagetest.h"
#include <QTest>
#include <QFile>
#include <QTest>
#include <item.h>
#include <messageflags.h>
using namespace KMime;
......
......@@ -7,14 +7,15 @@
#ifndef MESSAGETEST_TEST_H
#define MESSAGETEST_TEST_H
#include <kmime/kmime_message.h>
#include <QObject>
#include <kmime/kmime_message.h>
class MessageTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testCopyFlags();
private:
KMime::Message::Ptr readAndParseMail(const QString &mailFile) const;
};
......
......@@ -13,7 +13,6 @@ using namespace Akonadi;
NewMailNotifierAttributeTest::NewMailNotifierAttributeTest(QObject *parent)
: QObject(parent)
{
}
void NewMailNotifierAttributeTest::shouldHaveDefaultValue()
......
......@@ -6,14 +6,14 @@
#include "racetest.h"
#include <QDebug>
#include <KProcess>
#include <QDebug>
#include <control.h>
#include <agentinstance.h>
#include <agentinstancecreatejob.h>
#include <agenttype.h>
#include <agentmanager.h>
#include <agenttype.h>
#include <control.h>
#include <qtest_akonadi.h>
//#include <localfolders.h>
......@@ -29,15 +29,15 @@ using namespace Akonadi;
void RaceTest::initTestCase()
{
QVERIFY(Control::start());
QTest::qWait(1000); // give the MDA time to start so that we can kill it in peace
QTest::qWait(1000); // give the MDA time to start so that we can kill it in peace
qRegisterMetaType<QProcess::ProcessError>();
qRegisterMetaType<QProcess::ExitStatus>();
}
void RaceTest::testMultipleProcesses_data()
{
QTest::addColumn<int>("count"); // how many processes to create