summaryrefslogtreecommitdiffstats
path: root/examples/imapresource/tests/imapmailsynctest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imapresource/tests/imapmailsynctest.cpp')
-rw-r--r--examples/imapresource/tests/imapmailsynctest.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/examples/imapresource/tests/imapmailsynctest.cpp b/examples/imapresource/tests/imapmailsynctest.cpp
index c73c840..b0d5b22 100644
--- a/examples/imapresource/tests/imapmailsynctest.cpp
+++ b/examples/imapresource/tests/imapmailsynctest.cpp
@@ -1,3 +1,21 @@
1/*
2 * Copyright (C) 2016 Christian Mollekopf <chrigi_1@fastmail.fm>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
1#include <QtTest> 19#include <QtTest>
2 20
3#include <tests/mailsynctest.h> 21#include <tests/mailsynctest.h>
@@ -64,18 +82,19 @@ protected:
64 VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.'))); 82 VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.')));
65 } 83 }
66 84
67 void createMessage(const QStringList &folderPath, const QByteArray &message) Q_DECL_OVERRIDE 85 QByteArray createMessage(const QStringList &folderPath, const QByteArray &message) Q_DECL_OVERRIDE
68 { 86 {
69 Imap::ImapServerProxy imap("localhost", 993); 87 Imap::ImapServerProxy imap("localhost", 993);
70 VERIFYEXEC(imap.login("doe", "doe")); 88 imap.login("doe", "doe").exec().waitForFinished();
71 VERIFYEXEC(imap.append("INBOX." + folderPath.join('.'), message)); 89 imap.append("INBOX." + folderPath.join('.'), message).exec().waitForFinished();
90 return "2:*";
72 } 91 }
73 92
74 void removeMessage(const QStringList &folderPath, const QByteArray &messages) Q_DECL_OVERRIDE 93 void removeMessage(const QStringList &folderPath, const QByteArray &messages) Q_DECL_OVERRIDE
75 { 94 {
76 Imap::ImapServerProxy imap("localhost", 993); 95 Imap::ImapServerProxy imap("localhost", 993);
77 VERIFYEXEC(imap.login("doe", "doe")); 96 VERIFYEXEC(imap.login("doe", "doe"));
78 VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.'), "2:*")); 97 VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.'), messages));
79 } 98 }
80}; 99};
81 100