Commit dab484f8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent 3083ffdd
......@@ -6,14 +6,14 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/appendjob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
#include <QDateTime>
#include <QTest>
class AppendJobTest: public QObject
class AppendJobTest : public QObject
{
Q_OBJECT
......@@ -22,8 +22,8 @@ private Q_SLOTS:
void testAppend_data()
{
QTest::addColumn<QString>("mailbox");
QTest::addColumn<QList<QByteArray> >("scenario");
QTest::addColumn<QList<QByteArray> >("flags");
QTest::addColumn<QList<QByteArray>>("scenario");
QTest::addColumn<QList<QByteArray>>("flags");
QTest::addColumn<QDateTime>("internaldate");
QTest::addColumn<QByteArray>("content");
QTest::addColumn<qint64>("uid");
......@@ -32,33 +32,31 @@ private Q_SLOTS:
flags << QByteArray("\\Seen");
{
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 APPEND \"INBOX\" (\\Seen) {7}\r\ncontent"
scenario << FakeServer::preauth() << "C: A000001 APPEND \"INBOX\" (\\Seen) {7}\r\ncontent"
<< "S: A000001 OK APPEND completed. [ APPENDUID 492 2671 ]";
QTest::newRow("good") << "INBOX" << scenario << flags << QDateTime() << QByteArray("content") << qint64(2671);
}
{
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 APPEND \"INBOX\" (\\Seen) \"26-Feb-2014 12:38:00 +0000\" {7}\r\ncontent"
scenario << FakeServer::preauth() << "C: A000001 APPEND \"INBOX\" (\\Seen) \"26-Feb-2014 12:38:00 +0000\" {7}\r\ncontent"
<< "S: A000001 OK APPEND completed. [ APPENDUID 493 2672 ]";
QTest::newRow("good, with internalDate set") << "INBOX" << scenario << flags << QDateTime::fromString(QStringLiteral("2014-02-26T12:38:00Z"), Qt::ISODate) << QByteArray("content") << qint64(2672);
QTest::newRow("good, with internalDate set")
<< "INBOX" << scenario << flags << QDateTime::fromString(QStringLiteral("2014-02-26T12:38:00Z"), Qt::ISODate) << QByteArray("content")
<< qint64(2672);
}
{
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 APPEND \"INBOX\" (\\Seen) {7}\r\ncontent"
scenario << FakeServer::preauth() << "C: A000001 APPEND \"INBOX\" (\\Seen) {7}\r\ncontent"
<< "S: BYE"
<< "X" ;
<< "X";
QTest::newRow("bad") << "INBOX" << scenario << flags << QDateTime() << QByteArray("content") << qint64(0);
}
{
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 APPEND \"INBOX\" (\\Seen) {7}\r\ncontent"
scenario << FakeServer::preauth() << "C: A000001 APPEND \"INBOX\" (\\Seen) {7}\r\ncontent"
<< "S: "
<< "X" ;
<< "X";
QTest::newRow("Don't crash on empty response") << "INBOX" << scenario << flags << QDateTime() << QByteArray("content") << qint64(0);
}
}
......@@ -83,14 +81,13 @@ private Q_SLOTS:
job->setInternalDate(internaldate);
job->setMailBox(mailbox);
const bool result = job->exec();
QEXPECT_FAIL("bad" , "Expected failure on connection abort", Continue);
QEXPECT_FAIL("Don't crash on empty response" , "Expected failure on connection abort", Continue);
QEXPECT_FAIL("bad", "Expected failure on connection abort", Continue);
QEXPECT_FAIL("Don't crash on empty response", "Expected failure on connection abort", Continue);
QVERIFY(result);
QCOMPARE(job->uid(), uid);
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(AppendJobTest)
......
......@@ -9,13 +9,13 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/capabilitiesjob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
class CapabilitiesJobTest: public QObject
class CapabilitiesJobTest : public QObject
{
Q_OBJECT
......@@ -23,7 +23,7 @@ private Q_SLOTS:
void testCapabilities_data()
{
QTest::addColumn<QList<QByteArray> >("scenario");
QTest::addColumn<QList<QByteArray>>("scenario");
QTest::addColumn<QStringList>("capabilities");
QList<QByteArray> scenario;
scenario << "S: * PREAUTH"
......@@ -32,7 +32,7 @@ private Q_SLOTS:
<< "S: A000001 OK CAPABILITY completed";
QStringList capabilities;
capabilities << QStringLiteral("IMAP4REV1") << QStringLiteral("STARTTLS") << QStringLiteral("AUTH=GSSAPI");
capabilities << QStringLiteral("IMAP4REV1") << QStringLiteral("STARTTLS") << QStringLiteral("AUTH=GSSAPI");
QTest::newRow("good") << scenario << capabilities;
scenario.clear();
......@@ -50,7 +50,7 @@ private Q_SLOTS:
<< "S: * some response"
<< "S: A000001 OK CAPABILITY completed";
capabilities << QStringLiteral("IMAP4REV1") << QStringLiteral("STARTTLS") << QStringLiteral("AUTH=PLAIN");
capabilities << QStringLiteral("IMAP4REV1") << QStringLiteral("STARTTLS") << QStringLiteral("AUTH=PLAIN");
QTest::newRow("extra-untagged") << scenario << capabilities;
}
......@@ -66,14 +66,13 @@ private Q_SLOTS:
auto job = new KIMAP::CapabilitiesJob(&session);
bool result = job->exec();
QEXPECT_FAIL("bad" , "Expected failure on BAD response", Continue);
QEXPECT_FAIL("bad", "Expected failure on BAD response", Continue);
QVERIFY(result);
if (result) {
QCOMPARE(job->capabilities(), capabilities);
}
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(CapabilitiesJobTest)
......
......@@ -6,13 +6,13 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/closejob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
class CloseJobTest: public QObject
class CloseJobTest : public QObject
{
Q_OBJECT
......@@ -24,20 +24,17 @@ private Q_SLOTS:
QTest::addColumn<quint64>("highestModSeq");
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 CLOSE"
scenario << FakeServer::preauth() << "C: A000001 CLOSE"
<< "S: A000001 OK Closed";
QTest::newRow("good") << scenario << 0ULL;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CLOSE"
scenario << FakeServer::preauth() << "C: A000001 CLOSE"
<< "S: A000001 BAD No mailbox selected";
QTest::newRow("bad") << scenario << 0ULL;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CLOSE"
scenario << FakeServer::preauth() << "C: A000001 CLOSE"
<< "S: A000001 OK [HIGHESTMODSEQ 123456789] Closed.";
QTest::newRow("qresync") << scenario << 123456789ULL;
}
......@@ -55,7 +52,7 @@ private Q_SLOTS:
auto job = new KIMAP::CloseJob(&session);
bool result = job->exec();
QEXPECT_FAIL("bad" , "Expected failure on BAD response", Continue);
QEXPECT_FAIL("bad", "Expected failure on BAD response", Continue);
QVERIFY(result);
if (result) {
QCOMPARE(job->newHighestModSeq(), highestModSeq);
......@@ -63,7 +60,6 @@ private Q_SLOTS:
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(CloseJobTest)
......
......@@ -9,13 +9,13 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/createjob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
class CreateJobTest: public QObject
class CreateJobTest : public QObject
{
Q_OBJECT
......@@ -24,35 +24,30 @@ private Q_SLOTS:
void testCreate_data()
{
QTest::addColumn<QString>("mailbox");
QTest::addColumn<QList<QByteArray> >("scenario");
QTest::addColumn<QList<QByteArray>>("scenario");
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 CREATE \"INBOX\""
scenario << FakeServer::preauth() << "C: A000001 CREATE \"INBOX\""
<< "S: A000001 OK CREATE completed";
QTest::newRow("good") << "INBOX" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CREATE \"INBOX-FAIL-BAD\""
scenario << FakeServer::preauth() << "C: A000001 CREATE \"INBOX-FAIL-BAD\""
<< "S: A000001 BAD command unknown or arguments invalid";
QTest::newRow("bad") << "INBOX-FAIL-BAD" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CREATE \"INBOX-FAIL-NO\""
scenario << FakeServer::preauth() << "C: A000001 CREATE \"INBOX-FAIL-NO\""
<< "S: A000001 NO create failure";
QTest::newRow("no") << "INBOX-FAIL-NO" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CREATE \"INBOX-FAIL-IGNOREDCODE\""
scenario << FakeServer::preauth() << "C: A000001 CREATE \"INBOX-FAIL-IGNOREDCODE\""
<< "S: A000001 NO create failure [IGNOREDCODE]";
QTest::newRow("ignoredcode") << "INBOX-FAIL-IGNOREDCODE" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CREATE \"INBOX-ALREADYEXISTS\""
scenario << FakeServer::preauth() << "C: A000001 CREATE \"INBOX-ALREADYEXISTS\""
<< "S: A000001 NO create failure [ALREADYEXISTS]";
QTest::newRow("alreadyexists") << "INBOX-ALREADYEXISTS" << scenario;
}
......@@ -70,9 +65,9 @@ private Q_SLOTS:
auto job = new KIMAP::CreateJob(&session);
job->setMailBox(mailbox);
bool result = job->exec();
QEXPECT_FAIL("bad" , "Expected failure on BAD response", Continue);
QEXPECT_FAIL("no" , "Expected failure on NO response", Continue);
QEXPECT_FAIL("ignoredcode" , "Expected failure on NO response with ignored response code", Continue);
QEXPECT_FAIL("bad", "Expected failure on BAD response", Continue);
QEXPECT_FAIL("no", "Expected failure on NO response", Continue);
QEXPECT_FAIL("ignoredcode", "Expected failure on NO response with ignored response code", Continue);
QVERIFY(result);
if (result) {
QCOMPARE(job->mailBox(), mailbox);
......@@ -80,7 +75,6 @@ private Q_SLOTS:
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(CreateJobTest)
......
......@@ -9,13 +9,13 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/deletejob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
class DeleteJobTest: public QObject
class DeleteJobTest : public QObject
{
Q_OBJECT
......@@ -24,41 +24,35 @@ private Q_SLOTS:
void testDelete_data()
{
QTest::addColumn<QString>("mailbox");
QTest::addColumn<QList<QByteArray> >("scenario");
QTest::addColumn<QList<QByteArray>>("scenario");
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 DELETE \"foo\""
scenario << FakeServer::preauth() << "C: A000001 DELETE \"foo\""
<< "S: A000001 OK DELETE completed";
QTest::newRow("good") << "foo" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 DELETE \"foo-BAD\""
scenario << FakeServer::preauth() << "C: A000001 DELETE \"foo-BAD\""
<< "S: A000001 BAD command unknown or arguments invalid";
QTest::newRow("bad") << "foo-BAD" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 DELETE \"foo\""
scenario << FakeServer::preauth() << "C: A000001 DELETE \"foo\""
<< "S: A000001 Name \"foo\" has inferior hierarchical names";
QTest::newRow("no") << "foo" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 DELETE \"foo-IGNOREDCODE\""
scenario << FakeServer::preauth() << "C: A000001 DELETE \"foo-IGNOREDCODE\""
<< "S: A000001 NO Name \"foo-IGNOREDCODE\" does not exist [IGNOREDCODE]";
QTest::newRow("ignoredcode") << "foo-IGNOREDCODE" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 DELETE \"foo-NONEXISTENT\""
scenario << FakeServer::preauth() << "C: A000001 DELETE \"foo-NONEXISTENT\""
<< "S: A000001 NO Name \"foo-NONEXISTENT\" does not exist [NONEXISTENT]";
QTest::newRow("nonexistent") << "foo-NONEXISTENT" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 DELETE \"foo/bar\""
scenario << FakeServer::preauth() << "C: A000001 DELETE \"foo/bar\""
<< "S: A000001 OK DELETE completed";
QTest::newRow("hierarchical") << "foo/bar" << scenario;
}
......@@ -77,9 +71,9 @@ private Q_SLOTS:
auto job = new KIMAP::DeleteJob(&session);
job->setMailBox(mailbox);
bool result = job->exec();
QEXPECT_FAIL("bad" , "Expected failure on BAD response", Continue);
QEXPECT_FAIL("no" , "Expected failure on NO response", Continue);
QEXPECT_FAIL("ignoredcode" , "Expected failure on NO response with ignored response code", Continue);
QEXPECT_FAIL("bad", "Expected failure on BAD response", Continue);
QEXPECT_FAIL("no", "Expected failure on NO response", Continue);
QEXPECT_FAIL("ignoredcode", "Expected failure on NO response with ignored response code", Continue);
QVERIFY(result);
if (result) {
QCOMPARE(job->mailBox(), mailbox);
......@@ -87,7 +81,6 @@ private Q_SLOTS:
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(DeleteJobTest)
......
......@@ -6,15 +6,15 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/enablejob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
Q_DECLARE_METATYPE(QList<QList<QByteArray>>)
class EnableJobTest: public QObject
class EnableJobTest : public QObject
{
Q_OBJECT
......@@ -27,8 +27,7 @@ private Q_SLOTS:
QTest::addColumn<QStringList>("supportedCaps");
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 ENABLE CONDSTORE X-GOOD-IDEA"
scenario << FakeServer::preauth() << "C: A000001 ENABLE CONDSTORE X-GOOD-IDEA"
<< "S: * ENABLED X-GOOD-IDEA"
<< "S: A000001 OK Enabled";
QStringList reqCapabilities = {QStringLiteral("CONDSTORE"), QStringLiteral("X-GOOD-IDEA")};
......@@ -36,8 +35,7 @@ private Q_SLOTS:
QTest::newRow("one feature") << scenario << reqCapabilities << supportedCaps;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 ENABLE FEATURE1 FEATURE2"
scenario << FakeServer::preauth() << "C: A000001 ENABLE FEATURE1 FEATURE2"
<< "S: * ENABLED FEATURE1 FEATURE2"
<< "S: A000001 OK Enabled";
reqCapabilities = QStringList{QStringLiteral("FEATURE1"), QStringLiteral("FEATURE2")};
......@@ -65,7 +63,6 @@ private Q_SLOTS:
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(EnableJobTest)
......
......@@ -6,14 +6,14 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/expungejob.h"
#include "imapset.h"
#include "kimap/expungejob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
class ExpungeJobTest: public QObject
class ExpungeJobTest : public QObject
{
Q_OBJECT
......@@ -26,8 +26,7 @@ private Q_SLOTS:
QTest::addColumn<quint64>("highestModSeq");
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 EXPUNGE"
scenario << FakeServer::preauth() << "C: A000001 EXPUNGE"
<< "S: * 1 EXPUNGE"
<< "S: * 2 EXPUNGE"
<< "S: * 3 EXPUNGE"
......@@ -35,27 +34,23 @@ private Q_SLOTS:
QTest::newRow("good") << scenario << KIMAP::ImapSet{} << 0ULL;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 EXPUNGE"
scenario << FakeServer::preauth() << "C: A000001 EXPUNGE"
<< "S: * 1" // missing EXPUNGE word
<< "S: A000001 OK EXPUNGE completed";
QTest::newRow("non-standard response") << scenario << KIMAP::ImapSet{} << 0ULL;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 EXPUNGE"
scenario << FakeServer::preauth() << "C: A000001 EXPUNGE"
<< "S: A000001 BAD command unknown or arguments invalid";
QTest::newRow("bad") << scenario << KIMAP::ImapSet{} << 0ULL;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 EXPUNGE"
scenario << FakeServer::preauth() << "C: A000001 EXPUNGE"
<< "S: A000001 NO access denied";
QTest::newRow("no") << scenario << KIMAP::ImapSet{} << 0ULL;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 EXPUNGE"
scenario << FakeServer::preauth() << "C: A000001 EXPUNGE"
<< "S: * VANISHED 405,407,410:420"
<< "S: A000001 OK [HIGHESTMODSEQ 123456789] Expunged.";
KIMAP::ImapSet vanishedSet;
......@@ -78,8 +73,8 @@ private Q_SLOTS:
auto job = new KIMAP::ExpungeJob(&session);
bool result = job->exec();
QEXPECT_FAIL("bad" , "Expected failure on BAD response", Continue);
QEXPECT_FAIL("no" , "Expected failure on NO response", Continue);
QEXPECT_FAIL("bad", "Expected failure on BAD response", Continue);
QEXPECT_FAIL("no", "Expected failure on NO response", Continue);
QVERIFY(result);
if (result) {
QCOMPARE(job->vanishedMessages(), vanishedSet);
......@@ -88,7 +83,6 @@ private Q_SLOTS:
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(ExpungeJobTest)
......
......@@ -7,13 +7,13 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/listjob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
class FakeServerTest: public QObject
class FakeServerTest : public QObject
{
Q_OBJECT
......@@ -49,7 +49,6 @@ private Q_SLOTS:
fakeServer.quit();
}
};
QTEST_GUILESS_MAIN(FakeServerTest)
......
......@@ -7,16 +7,16 @@
#include <QTest>
#include "kimaptest/fakeserver.h"
#include "kimap/session.h"
#include "kimap/fetchjob.h"
#include "kimap/session.h"
#include "kimaptest/fakeserver.h"
#include <QTest>
#include <QSignalSpy>
#include <QTest>
Q_DECLARE_METATYPE(KIMAP::FetchJob::FetchScope)
class FetchJobTest: public QObject
class FetchJobTest : public QObject
{
Q_OBJECT
......@@ -38,7 +38,7 @@ private:
QMap<qint64, KIMAP::Message> m_msgs;
public Q_SLOTS:
void onHeadersReceived(const QString &/*mailBox*/,
void onHeadersReceived(const QString & /*mailBox*/,
const QMap<qint64, qint64> &uids,
const QMap<qint64, qint64> &sizes,
const QMap<qint64, KIMAP::MessageAttribute> &attrs,
......@@ -53,7 +53,7 @@ public Q_SLOTS:
m_attrs.unite(attrs);
}
void onMessagesReceived(const QString &/*mailbox*/,
void onMessagesReceived(const QString & /*mailbox*/,
const QMap<qint64, qint64> &uids,
const QMap<qint64, KIMAP::MessageAttribute> &attrs,
const QMap<qint64, KIMAP::MessagePtr> &messages)
......@@ -64,8 +64,8 @@ public Q_SLOTS:
m_attrs.unite(attrs);
}
void onPartsReceived(const QString &/*mailbox*/,
const QMap<qint64, qint64> &/*uids*/,
void onPartsReceived(const QString & /*mailbox*/,
const QMap<qint64, qint64> & /*uids*/,
const QMap<qint64, KIMAP::MessageAttribute> &attrs,
const QMap<qint64, KIMAP::MessageParts> &parts)
{
......@@ -98,29 +98,25 @@ private Q_SLOTS:
scope.changedSince = 123456789;
QList<QByteArray> scenario;
scenario << FakeServer::preauth()
<< "C: A000001 FETCH 1:4 (FLAGS UID) (CHANGEDSINCE 123456789)"
scenario << FakeServer::preauth() << "C: A000001 FETCH 1:4 (FLAGS UID) (CHANGEDSINCE 123456789)"
<< "S: * 1 FETCH ( FLAGS () UID 1 )"
<< "S: * 2 FETCH ( FLAGS () UID 2 )"
<< "S: * 3 FETCH ( FLAGS () UID 3 )"
<< "S: * 4 FETCH ( FLAGS () UID 4 )"
<< "S: A000001 OK fetch done";
QTest::newRow("messages have empty flags (with changedsince)") << false << KIMAP::ImapSet(1, 4) << 4
<< scenario << scope << KIMAP::ImapSet{};
QTest::newRow("messages have empty flags (with changedsince)") << false << KIMAP::ImapSet(1, 4) << 4 << scenario << scope << KIMAP::ImapSet{};
scenario.clear();
scope.changedSince = 0;
scenario << FakeServer::preauth()
<< "C: A000001 FETCH 1:4 (FLAGS UID)"
scenario << FakeServer::preauth() << "C: A000001 FETCH 1:4 (FLAGS UID)"
<< "S: * 1 FETCH ( FLAGS () UID 1 )"
<< "S: * 2 FETCH ( FLAGS () UID 2 )"
<< "S: * 3 FETCH ( FLAGS () UID 3 )"
<< "S: * 4 FETCH ( FLAGS () UID 4 )"
<< "S: A000001 OK fetch done";
QTest::newRow("messages have empty flags") << false << KIMAP::ImapSet(1, 4) << 4
<< scenario << scope << KIMAP::ImapSet{};
QTest::newRow("messages have empty flags") << false << KIMAP::ImapSet(1, 4) << 4 << scenario << scope << KIMAP::ImapSet{};
scenario.clear();
// kill the connection part-way through a list, with carriage returns at end
......@@ -128,8 +124,11 @@ private Q_SLOTS:
// this should fail, but it shouldn't crash
scenario << FakeServer::preauth()
<< "C: A000001 FETCH 11 (RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER.FIELDS (TO FROM MESSAGE-ID REFERENCES IN-REPLY-TO SUBJECT DATE)] FLAGS UID)"
<< "S: * 11 FETCH (RFC822.SIZE 770 INTERNALDATE \"11-Oct-2010 03:33:50 +0100\" BODY[HEADER.FIELDS (TO FROM MESSAGE-ID REFERENCES IN-REPLY-TO SUBJECT DATE)] {246}"
<< "S: From: John Smith <jonathanr.smith@foobarbaz.com>\r\nTo: \"amagicemailaddress@foobarbazbarfoo.com\"\r\n\t<amagicemailaddress@foobarbazbarfoo.com>\r\nDate: Mon, 11 Oct 2010 03:34:48 +0100\r\nSubject: unsubscribe\r\nMessage-ID: <ASDFFDSASDFFDS@foobarbaz.com>\r\n\r\n"
<< "S: * 11 FETCH (RFC822.SIZE 770 INTERNALDATE \"11-Oct-2010 03:33:50 +0100\" BODY[HEADER.FIELDS (TO FROM MESSAGE-ID REFERENCES IN-REPLY-TO "
"SUBJECT DATE)] {246}"
<< "S: From: John Smith <jonathanr.smith@foobarbaz.com>\r\nTo: "
"\"amagicemailaddress@foobarbazbarfoo.com\"\r\n\t<amagicemailaddress@foobarbazbarfoo.com>\r\nDate: Mon, 11 Oct 2010 03:34:48 "
"+0100\r\nSubject: unsubscribe\r\nMessage-ID: <ASDFFDSASDFFDS@foobarbaz.com>\r\n\r\n"
<< "X";
scope.mode = KIMAP::FetchJob::FetchScope::Headers;
QTest::newRow("connection drop") << false << KIMAP::ImapSet(11, 11) << 1 << scenario << scope << KIMAP::ImapSet{};
......@@ -138,7 +137,8 @@ private Q_SLOTS:
// Important bit here if "([127.0.0.1])" which used to crash the stream parser
scenario << FakeServer::preauth()