Changeset View
Changeset View
Standalone View
Standalone View
tests/units/akonadi/akonadicachingstoragetest.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 77 | { | |||
---|---|---|---|---|---|
83 | 83 | | |||
84 | const auto allCollections = QStringList() << "42Task" << "43Task" << "44Note" << "45Stuff" | 84 | const auto allCollections = QStringList() << "42Task" << "43Task" << "44Note" << "45Stuff" | ||
85 | << "46Note" << "47Task" << "48Note" << "49Stuff" | 85 | << "46Note" << "47Task" << "48Note" << "49Stuff" | ||
86 | << "50Stuff" << "51Task" << "52Note" << "53Stuff" | 86 | << "50Stuff" << "51Task" << "52Note" << "53Stuff" | ||
87 | << "54Task" << "55Task" << "56Task" | 87 | << "54Task" << "55Task" << "56Task" | ||
88 | << "57Note" << "58Note" << "59Note" | 88 | << "57Note" << "58Note" << "59Note" | ||
89 | << "60Stuff" << "61Stuff" << "62Stuff"; | 89 | << "60Stuff" << "61Stuff" << "62Stuff"; | ||
90 | 90 | | |||
91 | const auto noteCollections = QStringList() << "42Task" << "44Note" | | |||
92 | << "46Note" << "48Note" | | |||
93 | << "50Stuff" << "52Note" | | |||
94 | << "57Note" << "58Note" << "59Note"; | | |||
95 | | ||||
96 | const auto taskCollections = QStringList() << "42Task" << "43Task" | 91 | const auto taskCollections = QStringList() << "42Task" << "43Task" | ||
97 | << "46Note" << "47Task" | 92 | << "46Note" << "47Task" | ||
98 | << "50Stuff" << "51Task" | 93 | << "50Stuff" << "51Task" | ||
99 | << "54Task" << "55Task" << "56Task"; | 94 | << "54Task" << "55Task" << "56Task"; | ||
100 | 95 | | |||
101 | const auto noteTaskCollections = QStringList() << "42Task" << "43Task" << "44Note" | | |||
102 | << "46Note" << "47Task" << "48Note" | | |||
103 | << "50Stuff" << "51Task" << "52Note" | | |||
104 | << "54Task" << "55Task" << "56Task" | | |||
105 | << "57Note" << "58Note" << "59Note"; | | |||
106 | | ||||
107 | QTest::newRow("rootRecursiveAll") << Akonadi::Collection::root() << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::AllContent) | 96 | QTest::newRow("rootRecursiveAll") << Akonadi::Collection::root() << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::AllContent) | ||
108 | << allCollections << allCollections; | 97 | << allCollections << allCollections; | ||
109 | QTest::newRow("rootRecursiveTask") << Akonadi::Collection::root() << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::Tasks) | 98 | QTest::newRow("rootRecursiveTask") << Akonadi::Collection::root() << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::Tasks) | ||
110 | << onlyWithSuffix(taskCollections, "Task") << taskCollections; | 99 | << onlyWithSuffix(taskCollections, "Task") << taskCollections; | ||
111 | QTest::newRow("rootRecursiveNote") << Akonadi::Collection::root() << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::Notes) | | |||
112 | << onlyWithSuffix(noteCollections, "Note") << noteCollections; | | |||
113 | QTest::newRow("rootRecursiveNoteTask") << Akonadi::Collection::root() << Akonadi::StorageInterface::Recursive | | |||
114 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
115 | << onlyWithSuffixes(noteTaskCollections, {"Task", "Note"}) << noteTaskCollections; | | |||
116 | 100 | | |||
117 | QTest::newRow("60RecursiveAll") << Akonadi::Collection(60) << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::AllContent) | 101 | QTest::newRow("60RecursiveAll") << Akonadi::Collection(60) << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::AllContent) | ||
118 | << (QStringList() << "61Stuff" << "62Stuff") << allCollections; | 102 | << (QStringList() << "61Stuff" << "62Stuff") << allCollections; | ||
119 | QTest::newRow("54RecursiveTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::Tasks) | 103 | QTest::newRow("54RecursiveTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::Tasks) | ||
120 | << (QStringList() << "55Task" << "56Task") << taskCollections; | 104 | << (QStringList() << "55Task" << "56Task") << taskCollections; | ||
121 | QTest::newRow("57RecursiveNote") << Akonadi::Collection(57) << Akonadi::StorageInterface::Recursive << int(Akonadi::StorageInterface::Notes) | | |||
122 | << (QStringList() << "58Note" << "59Note") << noteCollections; | | |||
123 | QTest::newRow("54RecursiveNoteTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::Recursive | | |||
124 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
125 | << (QStringList() << "55Task" << "56Task") << noteTaskCollections; | | |||
126 | QTest::newRow("57RecursiveNoteTask") << Akonadi::Collection(57) << Akonadi::StorageInterface::Recursive | | |||
127 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
128 | << (QStringList() << "58Note" << "59Note") << noteTaskCollections; | | |||
129 | 105 | | |||
130 | QTest::newRow("60FirstLevelAll") << Akonadi::Collection(60) << Akonadi::StorageInterface::FirstLevel << int(Akonadi::StorageInterface::AllContent) | 106 | QTest::newRow("60FirstLevelAll") << Akonadi::Collection(60) << Akonadi::StorageInterface::FirstLevel << int(Akonadi::StorageInterface::AllContent) | ||
131 | << (QStringList() << "61Stuff") << allCollections; | 107 | << (QStringList() << "61Stuff") << allCollections; | ||
132 | QTest::newRow("54FirstLevelTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::FirstLevel << int(Akonadi::StorageInterface::Tasks) | 108 | QTest::newRow("54FirstLevelTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::FirstLevel << int(Akonadi::StorageInterface::Tasks) | ||
133 | << (QStringList() << "55Task") << taskCollections; | 109 | << (QStringList() << "55Task") << taskCollections; | ||
134 | QTest::newRow("57FirstLevelNote") << Akonadi::Collection(57) << Akonadi::StorageInterface::FirstLevel << int(Akonadi::StorageInterface::Notes) | | |||
135 | << (QStringList() << "58Note") << noteCollections; | | |||
136 | QTest::newRow("54FirstLevelNoteTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::FirstLevel | | |||
137 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
138 | << (QStringList() << "55Task") << noteTaskCollections; | | |||
139 | QTest::newRow("57FirstLevelNoteTask") << Akonadi::Collection(57) << Akonadi::StorageInterface::FirstLevel | | |||
140 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
141 | << (QStringList() << "58Note") << noteTaskCollections; | | |||
142 | 110 | | |||
143 | QTest::newRow("60BaseAll") << Akonadi::Collection(60) << Akonadi::StorageInterface::Base << int(Akonadi::StorageInterface::AllContent) | 111 | QTest::newRow("60BaseAll") << Akonadi::Collection(60) << Akonadi::StorageInterface::Base << int(Akonadi::StorageInterface::AllContent) | ||
144 | << (QStringList() << "60Stuff") << allCollections; | 112 | << (QStringList() << "60Stuff") << allCollections; | ||
145 | QTest::newRow("54BaseTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::Base << int(Akonadi::StorageInterface::Tasks) | 113 | QTest::newRow("54BaseTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::Base << int(Akonadi::StorageInterface::Tasks) | ||
146 | << (QStringList() << "54Task") << taskCollections; | 114 | << (QStringList() << "54Task") << taskCollections; | ||
147 | QTest::newRow("57BaseNote") << Akonadi::Collection(57) << Akonadi::StorageInterface::Base << int(Akonadi::StorageInterface::Notes) | | |||
148 | << (QStringList() << "57Note") << noteCollections; | | |||
149 | QTest::newRow("54BaseNoteTask") << Akonadi::Collection(54) << Akonadi::StorageInterface::Base | | |||
150 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
151 | << (QStringList() << "54Task") << noteTaskCollections; | | |||
152 | QTest::newRow("57BaseNoteTask") << Akonadi::Collection(57) << Akonadi::StorageInterface::Base | | |||
153 | << int(Akonadi::StorageInterface::Notes|Akonadi::StorageInterface::Tasks) | | |||
154 | << (QStringList() << "57Note") << noteTaskCollections; | | |||
155 | } | 115 | } | ||
156 | 116 | | |||
157 | void shouldCacheAllCollectionsPerFetchType() | 117 | void shouldCacheAllCollectionsPerFetchType() | ||
158 | { | 118 | { | ||
159 | // GIVEN | 119 | // GIVEN | ||
160 | AkonadiFakeData data; | 120 | AkonadiFakeData data; | ||
161 | 121 | | |||
162 | data.createCollection(GenCollection().withId(42).withName(QStringLiteral("42Task")).withRootAsParent().withTaskContent()); | 122 | data.createCollection(GenCollection().withId(42).withName(QStringLiteral("42Task")).withRootAsParent().withTaskContent()); | ||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |