diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-22 18:35:52 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-22 18:35:52 +0100 |
commit | b05edd5644738e7608d13a8b5b679f43d70f4dd4 (patch) | |
tree | 9ac59a67057da63564d59ecc3f896b21bcacd322 /examples/imapresource/tests/imapserverproxytest.cpp | |
parent | e513ee41adb6061aa72de8bfe49d117f47c1545b (diff) | |
download | sink-b05edd5644738e7608d13a8b5b679f43d70f4dd4.tar.gz sink-b05edd5644738e7608d13a8b5b679f43d70f4dd4.zip |
Don't treat the IMAP namespace as subfolder.
INBOX.INBOX means that the INBOX folder is in the INBOX. namespace.
Diffstat (limited to 'examples/imapresource/tests/imapserverproxytest.cpp')
-rw-r--r-- | examples/imapresource/tests/imapserverproxytest.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/imapresource/tests/imapserverproxytest.cpp b/examples/imapresource/tests/imapserverproxytest.cpp index 27d73ea..ec5df49 100644 --- a/examples/imapresource/tests/imapserverproxytest.cpp +++ b/examples/imapresource/tests/imapserverproxytest.cpp | |||
@@ -57,9 +57,21 @@ private slots: | |||
57 | 57 | ||
58 | void testFetchFolders() | 58 | void testFetchFolders() |
59 | { | 59 | { |
60 | QMap<QString, QString> expectedFolderAndParent; | ||
61 | expectedFolderAndParent.insert("INBOX", ""); | ||
62 | expectedFolderAndParent.insert("Drafts", ""); | ||
63 | expectedFolderAndParent.insert("Trash", ""); | ||
64 | expectedFolderAndParent.insert("test", ""); | ||
60 | ImapServerProxy imap("localhost", 993); | 65 | ImapServerProxy imap("localhost", 993); |
61 | VERIFYEXEC(imap.login("doe", "doe")); | 66 | VERIFYEXEC(imap.login("doe", "doe")); |
62 | VERIFYEXEC(imap.fetchFolders([](const Folder &){})); | 67 | QVector<Folder> list; |
68 | VERIFYEXEC(imap.fetchFolders([&](const Folder &f){ list << f;})); | ||
69 | for (const auto &f : list) { | ||
70 | QVERIFY(expectedFolderAndParent.contains(f.name())); | ||
71 | QCOMPARE(expectedFolderAndParent.value(f.name()), f.parentPath()); | ||
72 | expectedFolderAndParent.remove(f.name()); | ||
73 | } | ||
74 | QVERIFY(expectedFolderAndParent.isEmpty()); | ||
63 | } | 75 | } |
64 | 76 | ||
65 | void testFetchFoldersFailure() | 77 | void testFetchFoldersFailure() |