summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/imapresource/tests/imapmailsynctest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/imapresource/tests/imapmailsynctest.cpp b/examples/imapresource/tests/imapmailsynctest.cpp
index 06369f3..76023e1 100644
--- a/examples/imapresource/tests/imapmailsynctest.cpp
+++ b/examples/imapresource/tests/imapmailsynctest.cpp
@@ -69,9 +69,13 @@ protected:
69 Sink::ApplicationDomain::SinkResource createFaultyResource() Q_DECL_OVERRIDE 69 Sink::ApplicationDomain::SinkResource createFaultyResource() Q_DECL_OVERRIDE
70 { 70 {
71 auto resource = ApplicationDomain::ImapResource::create("account1"); 71 auto resource = ApplicationDomain::ImapResource::create("account1");
72 //Using a bogus ip instead of a bogus hostname avoids getting stuck in the hostname lookup 72 //We try to connect on localhost on port 0 because:
73 resource.setProperty("server", "111.111.1.1"); 73 //* Using a bogus ip instead of a bogus hostname avoids getting stuck in the hostname lookup.
74 resource.setProperty("port", 143); 74 //* Using localhost avoids tcp trying to retransmit packets into nirvana
75 //* Using port 0 fails immediately because it's not an existing port.
76 //All we really want is something that immediately rejects our connection attempt, and this seems to work.
77 resource.setProperty("server", "127.0.0.1");
78 resource.setProperty("port", 0);
75 resource.setProperty("username", "doe"); 79 resource.setProperty("username", "doe");
76 Sink::SecretStore::instance().insert(resource.identifier(), "doe"); 80 Sink::SecretStore::instance().insert(resource.identifier(), "doe");
77 return resource; 81 return resource;