From ed0faba01b26579e726f5a2d3cf5efb14140322c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 31 May 2016 15:44:43 +0200 Subject: ImapMailSyncTest --- examples/imapresource/tests/imapmailsynctest.cpp | 27 ++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'examples/imapresource/tests/imapmailsynctest.cpp') 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 @@ +/* + * Copyright (C) 2016 Christian Mollekopf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include #include @@ -64,18 +82,19 @@ protected: VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.'))); } - void createMessage(const QStringList &folderPath, const QByteArray &message) Q_DECL_OVERRIDE + QByteArray createMessage(const QStringList &folderPath, const QByteArray &message) Q_DECL_OVERRIDE { Imap::ImapServerProxy imap("localhost", 993); - VERIFYEXEC(imap.login("doe", "doe")); - VERIFYEXEC(imap.append("INBOX." + folderPath.join('.'), message)); + imap.login("doe", "doe").exec().waitForFinished(); + imap.append("INBOX." + folderPath.join('.'), message).exec().waitForFinished(); + return "2:*"; } void removeMessage(const QStringList &folderPath, const QByteArray &messages) Q_DECL_OVERRIDE { Imap::ImapServerProxy imap("localhost", 993); VERIFYEXEC(imap.login("doe", "doe")); - VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.'), "2:*")); + VERIFYEXEC(imap.remove("INBOX." + folderPath.join('.'), messages)); } }; -- cgit v1.2.3