Commit 90931294 authored by Dennis Schridde's avatar Dennis Schridde Committed by Daniel Vrátil
Browse files

Add autotests for CREATE-ALREADYEXISTS and DELETE-NONEXISTENT

Behaviour with IGNOREDCODE is checked to make sure the pure presence
of response codes does not influence the outcome.
parent ee2900e3
Pipeline #26273 passed with stage
in 13 minutes and 43 seconds
......@@ -43,6 +43,18 @@ private Q_SLOTS:
<< "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\""
<< "S: A000001 NO create failure [IGNOREDCODE]";
QTest::newRow("ignoredcode") << "INBOX-FAIL-IGNOREDCODE" << scenario;
scenario.clear();
scenario << FakeServer::preauth()
<< "C: A000001 CREATE \"INBOX-ALREADYEXISTS\""
<< "S: A000001 NO create failure [ALREADYEXISTS]";
QTest::newRow("alreadyexists") << "INBOX-ALREADYEXISTS" << scenario;
}
void testCreate()
......@@ -60,6 +72,7 @@ private Q_SLOTS:
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);
QVERIFY(result);
if (result) {
QCOMPARE(job->mailBox(), mailbox);
......
......@@ -44,6 +44,18 @@ private Q_SLOTS:
<< "S: A000001 Name \"foo\" has inferior hierarchical names";
QTest::newRow("no") << "foo" << scenario;
scenario.clear();
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\""
<< "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\""
......@@ -67,6 +79,7 @@ private Q_SLOTS:
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);
QVERIFY(result);
if (result) {
QCOMPARE(job->mailBox(), mailbox);
......
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