summaryrefslogtreecommitdiffstats
path: root/examples/imapresource/tests/imapmailtest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-07 11:46:45 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-07 11:46:45 +0200
commite3da13d1fe9ad623e05aec1977c813e7da37cedd (patch)
tree79266f2fba9e50c6e6d9d38d3baeff2d6a8e1e0e /examples/imapresource/tests/imapmailtest.cpp
parentab7c366b27a07cc31730dc7fb696cdc2519bb8d3 (diff)
downloadsink-e3da13d1fe9ad623e05aec1977c813e7da37cedd.tar.gz
sink-e3da13d1fe9ad623e05aec1977c813e7da37cedd.zip
Fail quickly if the backend is not available
Diffstat (limited to 'examples/imapresource/tests/imapmailtest.cpp')
-rw-r--r--examples/imapresource/tests/imapmailtest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/imapresource/tests/imapmailtest.cpp b/examples/imapresource/tests/imapmailtest.cpp
index c94a731..e6f41f4 100644
--- a/examples/imapresource/tests/imapmailtest.cpp
+++ b/examples/imapresource/tests/imapmailtest.cpp
@@ -1,4 +1,5 @@
1#include <QtTest> 1#include <QtTest>
2#include <QTcpSocket>
2 3
3#include <tests/mailtest.h> 4#include <tests/mailtest.h>
4 5
@@ -18,6 +19,13 @@ class ImapMailTest : public Sink::MailTest
18 Q_OBJECT 19 Q_OBJECT
19 20
20protected: 21protected:
22 bool isBackendAvailable() Q_DECL_OVERRIDE
23 {
24 QTcpSocket socket;
25 socket.connectToHost("localhost", 993);
26 return socket.waitForConnected(200);
27 }
28
21 void resetTestEnvironment() Q_DECL_OVERRIDE 29 void resetTestEnvironment() Q_DECL_OVERRIDE
22 { 30 {
23 system("resetmailbox.sh"); 31 system("resetmailbox.sh");