diff options
-rw-r--r-- | examples/imapresource/tests/imapresourcetest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/imapresource/tests/imapresourcetest.cpp b/examples/imapresource/tests/imapresourcetest.cpp index 27d7d6d..d8fc46e 100644 --- a/examples/imapresource/tests/imapresourcetest.cpp +++ b/examples/imapresource/tests/imapresourcetest.cpp | |||
@@ -156,6 +156,21 @@ private slots: | |||
156 | }); | 156 | }); |
157 | VERIFYEXEC(job); | 157 | VERIFYEXEC(job); |
158 | } | 158 | } |
159 | |||
160 | void testFailingSync() | ||
161 | { | ||
162 | auto resource = ApplicationDomain::ImapResource::create("account1"); | ||
163 | resource.setProperty("server", "foobar"); | ||
164 | resource.setProperty("port", 993); | ||
165 | Sink::Store::create(resource).exec().waitForFinished(); | ||
166 | Sink::Query query; | ||
167 | query.resources << resource.identifier(); | ||
168 | |||
169 | // Ensure sync fails if resource is misconfigured | ||
170 | auto future = Store::synchronize(query).exec(); | ||
171 | future.waitForFinished(); | ||
172 | QVERIFY(future.errorCode()); | ||
173 | } | ||
159 | }; | 174 | }; |
160 | 175 | ||
161 | QTEST_MAIN(ImapResourceTest) | 176 | QTEST_MAIN(ImapResourceTest) |