Warning, file /pim/trojita/tests/Imap/test_Imap_Tasks_ObtainSynchronizedMailbox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* Copyright (C) 2006 - 2014 Jan Kundrát <jkt@flaska.net>
0002 
0003    This file is part of the Trojita Qt IMAP e-mail client,
0004    http://trojita.flaska.net/
0005 
0006    This program is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU General Public License as
0008    published by the Free Software Foundation; either version 2 of
0009    the License or (at your option) version 3 or any later version
0010    accepted by the membership of KDE e.V. (or its successor approved
0011    by the membership of KDE e.V.), which shall act as a proxy
0012    defined in Section 14 of version 3 of the license.
0013 
0014    This program is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017    GNU General Public License for more details.
0018 
0019    You should have received a copy of the GNU General Public License
0020    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #ifndef TEST_IMAP_TASKS_OBTAINSYNCHRONIZEDMAILBOXTASK
0024 #define TEST_IMAP_TASKS_OBTAINSYNCHRONIZEDMAILBOXTASK
0025 
0026 #include "Utils/LibMailboxSync.h"
0027 
0028 class QSignalSpy;
0029 
0030 class ImapModelObtainSynchronizedMailboxTest : public LibMailboxSync
0031 {
0032     Q_OBJECT
0033 
0034     typedef enum {WITHOUT_ESEARCH, WITH_ESEARCH} ESearchMode;
0035     void helperCacheArrivalRaceDuringUid(const ESearchMode esearch);
0036     void helperCacheExpunges(const ESearchMode esearch);
0037 
0038     typedef enum { JUST_QRESYNC, EXTRA_ENABLED, EXTRA_ENABLED_EMPTY } ModeForHelperTestQresyncNoChanges;
0039     void helperTestQresyncNoChanges(ModeForHelperTestQresyncNoChanges mode);
0040 
0041     enum class MessageNumberChange { SAME, MORE, LESS };
0042     void helperMissingUidNext(const MessageNumberChange mode);
0043 private slots:
0044     void init();
0045     void testSyncEmptyMinimal();
0046     void testSyncEmptyMinimalNonEmpty();
0047     void testSyncEmptyNormal();
0048     void testSyncWithMessages();
0049     void testSyncTwoLikeCyrus();
0050     void testSyncTwoInParallel();
0051     void testSyncNoUidnext();
0052     void testResyncNoArrivals();
0053     void testResyncOneNew();
0054     void testResyncUidValidity();
0055     void testDecreasedUidNext();
0056     void testMisingUidNextSame();
0057     void testMisingUidNextMore();
0058     void testMisingUidNextLess();
0059     void testReloadReadsFromCache();
0060     void testCacheNoChange();
0061     void testCacheUidValidity();
0062     void testCacheArrivals();
0063     void testCacheArrivalRaceDuringUid();
0064     void testCacheArrivalRaceDuringUid_ESearch();
0065     void testCacheArrivalRaceDuringUid2();
0066     void testCacheArrivalRaceDuringFlags();
0067     void testCacheExpunges();
0068     void testCacheExpunges_ESearch();
0069     void testCacheExpungesDuringUid();
0070     void testCacheExpungesDuringUid2();
0071     void testCacheExpungesDuringSelect();
0072     void testCacheExpungesDuringFlags();
0073     void testCacheArrivalsImmediatelyDeleted();
0074     void testCacheArrivalsOldDeleted();
0075     void testCacheArrivalsThenDynamic();
0076     void testCacheDeletionsThenDynamic();
0077     void testCondstoreNoChanges();
0078     void testCondstoreChangedFlags();
0079     void testCondstoreErrorExists();
0080     void testCondstoreErrorUidNext();
0081     void testCondstoreUidValidity();
0082     void testCondstoreDecreasedHighestModSeq();
0083     void testCacheDiscrepancyExistsUidsConstantHMS();
0084     void testCacheDiscrepancyExistsUidsDifferentHMS();
0085     void testCondstoreQresyncNomodseqHighestmodseq();
0086 
0087     void testQresyncNoChanges();
0088     void testQresyncChangedFlags();
0089     void testQresyncVanishedEarlier();
0090     void testQresyncUidValidity();
0091     void testQresyncNoModseqChangedFlags();
0092     void testQresyncErrorExists();
0093     void testQresyncErrorUidNext();
0094     void testQresyncUnreportedNewArrivals();
0095     void testQresyncReportedNewArrivals();
0096     void testQresyncDeletionsNewArrivals();
0097     void testQresyncSpuriousVanishedEarlier();
0098     void testQresyncAfterEmpty();
0099     void testQresyncExtraEnabled();
0100     void testQresyncExtraEnabledEmptySwitchover();
0101 
0102     void testQresyncNoClosed();
0103     void testNoQresyncOutOfBounds();
0104     void testQresyncClosedHandover();
0105     void testNoClosedRouting();
0106     void testUnselectClosed();
0107     void testUnselectClosedDuringSelecting();
0108 
0109     void testSpuriousSearch();
0110     void testSpuriousESearch();
0111 
0112     void testOfflineOpening();
0113 
0114     void testQresyncEnabling();
0115 
0116     void testSelectRetryNoBad();
0117 
0118     void testDanglingSelect();
0119 
0120     void testUid0();
0121 
0122     // We put the benchmark to the last position as this one takes a long time
0123     void testFlagReSyncBenchmark();
0124 
0125     void helperCacheDiscrepancyExistsUids(bool constantHighestModSeq);
0126 };
0127 
0128 #endif