]> cloud.milkyroute.net Git - dolphin.git/blob - src/tests/kitemlistselectionmanagertest.cpp
Merge remote-tracking branch 'origin/master' into frameworks
[dolphin.git] / src / tests / kitemlistselectionmanagertest.cpp
1 /***************************************************************************
2 * Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com> *
3 * Copyright (C) 2011 by Frank Reininghaus <frank78ac@googlemail.com> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #include <qtest_kde.h>
22
23 #include "kitemviews/kitemmodelbase.h"
24 #include "kitemviews/kitemlistselectionmanager.h"
25
26 class DummyModel : public KItemModelBase
27 {
28 public:
29 DummyModel();
30 void setCount(int count);
31 virtual int count() const;
32 virtual QHash<QByteArray, QVariant> data(int index) const;
33
34 private:
35 int m_count;
36 };
37
38 DummyModel::DummyModel() :
39 KItemModelBase(),
40 m_count(100)
41 {
42 }
43
44 void DummyModel::setCount(int count)
45 {
46 m_count = count;
47 }
48
49 int DummyModel::count() const
50 {
51 return m_count;
52 }
53
54 QHash<QByteArray, QVariant> DummyModel::data(int index) const
55 {
56 Q_UNUSED(index);
57 return QHash<QByteArray, QVariant>();
58 }
59
60
61 class KItemListSelectionManagerTest : public QObject
62 {
63 Q_OBJECT
64
65 private slots:
66 void init();
67 void cleanup();
68
69 void testConstructor();
70
71 void testCurrentItemAnchorItem();
72 void testSetSelected_data();
73 void testSetSelected();
74 void testItemsInserted();
75 void testItemsRemoved();
76 void testAnchoredSelection();
77 void testChangeSelection_data();
78 void testChangeSelection();
79 void testDeleteCurrentItem_data();
80 void testDeleteCurrentItem();
81 void testAnchoredSelectionAfterMovingItems();
82
83 private:
84 void verifySelectionChange(QSignalSpy& spy, const KItemSet& currentSelection, const KItemSet& previousSelection) const;
85
86 KItemListSelectionManager* m_selectionManager;
87 DummyModel* m_model;
88 };
89
90 void KItemListSelectionManagerTest::init()
91 {
92 m_model = new DummyModel();
93 m_selectionManager = new KItemListSelectionManager();
94 m_selectionManager->setModel(m_model);
95 }
96
97 void KItemListSelectionManagerTest::cleanup()
98 {
99 delete m_selectionManager;
100 m_selectionManager = 0;
101
102 delete m_model;
103 m_model = 0;
104 }
105
106 void KItemListSelectionManagerTest::testConstructor()
107 {
108 QVERIFY(!m_selectionManager->hasSelection());
109 QCOMPARE(m_selectionManager->selectedItems().count(), 0);
110 QCOMPARE(m_selectionManager->currentItem(), 0);
111 QCOMPARE(m_selectionManager->m_anchorItem, -1);
112 }
113
114 void KItemListSelectionManagerTest::testCurrentItemAnchorItem()
115 {
116 QSignalSpy spyCurrent(m_selectionManager, SIGNAL(currentChanged(int,int)));
117
118 // Set current item and check that the selection manager emits the currentChanged(int,int) signal correctly.
119 m_selectionManager->setCurrentItem(4);
120 QCOMPARE(m_selectionManager->currentItem(), 4);
121 QCOMPARE(spyCurrent.count(), 1);
122 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 4);
123 spyCurrent.takeFirst();
124
125 // Begin an anchored selection.
126 m_selectionManager->beginAnchoredSelection(5);
127 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
128 QCOMPARE(m_selectionManager->m_anchorItem, 5);
129
130 // Items between current and anchor should be selected now
131 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 4 << 5);
132 QVERIFY(m_selectionManager->hasSelection());
133
134 // Change current item again and check the selection
135 m_selectionManager->setCurrentItem(2);
136 QCOMPARE(m_selectionManager->currentItem(), 2);
137 QCOMPARE(spyCurrent.count(), 1);
138 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 2);
139 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 4);
140 spyCurrent.takeFirst();
141
142 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 2 << 3 << 4 << 5);
143 QVERIFY(m_selectionManager->hasSelection());
144
145 // Inserting items should update current item and anchor item.
146 m_selectionManager->itemsInserted(KItemRangeList() <<
147 KItemRange(0, 1) <<
148 KItemRange(2, 2) <<
149 KItemRange(6, 3));
150
151 QCOMPARE(m_selectionManager->currentItem(), 5);
152 QCOMPARE(spyCurrent.count(), 1);
153 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 5);
154 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 2);
155 spyCurrent.takeFirst();
156
157 QCOMPARE(m_selectionManager->m_anchorItem, 8);
158
159 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 8);
160 QVERIFY(m_selectionManager->hasSelection());
161
162 // Removing items should update current item and anchor item.
163 m_selectionManager->itemsRemoved(KItemRangeList() <<
164 KItemRange(0, 2) <<
165 KItemRange(2, 1) <<
166 KItemRange(9, 2));
167
168 QCOMPARE(m_selectionManager->currentItem(), 2);
169 QCOMPARE(spyCurrent.count(), 1);
170 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(0)), 2);
171 QCOMPARE(qvariant_cast<int>(spyCurrent.at(0).at(1)), 5);
172 spyCurrent.takeFirst();
173
174 QCOMPARE(m_selectionManager->m_anchorItem, 5);
175
176 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 2 << 3 << 4 << 5);
177 QVERIFY(m_selectionManager->hasSelection());
178
179 // Verify that clearSelection() also clears the anchored selection.
180 m_selectionManager->clearSelection();
181 QCOMPARE(m_selectionManager->selectedItems(), KItemSet());
182 QVERIFY(!m_selectionManager->hasSelection());
183
184 m_selectionManager->endAnchoredSelection();
185 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
186 }
187
188 void KItemListSelectionManagerTest::testSetSelected_data()
189 {
190 QTest::addColumn<int>("index");
191 QTest::addColumn<int>("count");
192 QTest::addColumn<int>("expectedSelectionCount");
193
194 QTest::newRow("Select all") << 0 << 100 << 100;
195 QTest::newRow("Sub selection 15 items") << 20 << 15 << 15;
196 QTest::newRow("Sub selection 1 item") << 20 << 1 << 1;
197 QTest::newRow("Too small index") << -1 << 100 << 0;
198 QTest::newRow("Too large index") << 100 << 100 << 0;
199 QTest::newRow("Too large count") << 0 << 100000 << 100;
200 QTest::newRow("Too small count") << 0 << 0 << 0;
201 }
202
203 void KItemListSelectionManagerTest::testSetSelected()
204 {
205 QFETCH(int, index);
206 QFETCH(int, count);
207 QFETCH(int, expectedSelectionCount);
208 m_selectionManager->setSelected(index, count);
209 QCOMPARE(m_selectionManager->selectedItems().count(), expectedSelectionCount);
210 }
211
212 void KItemListSelectionManagerTest::testItemsInserted()
213 {
214 // Select items 10 to 12
215 m_selectionManager->setSelected(10, 3);
216 KItemSet selectedItems = m_selectionManager->selectedItems();
217 QCOMPARE(selectedItems.count(), 3);
218 QVERIFY(selectedItems.contains(10));
219 QVERIFY(selectedItems.contains(11));
220 QVERIFY(selectedItems.contains(12));
221
222 // Insert items 0 to 4 -> selection must be 15 to 17
223 m_selectionManager->itemsInserted(KItemRangeList() << KItemRange(0, 5));
224 selectedItems = m_selectionManager->selectedItems();
225 QCOMPARE(selectedItems.count(), 3);
226 QVERIFY(selectedItems.contains(15));
227 QVERIFY(selectedItems.contains(16));
228 QVERIFY(selectedItems.contains(17));
229
230 // Insert 3 items between the selections
231 m_selectionManager->itemsInserted(KItemRangeList() <<
232 KItemRange(15, 1) <<
233 KItemRange(16, 1) <<
234 KItemRange(17, 1));
235 selectedItems = m_selectionManager->selectedItems();
236 QCOMPARE(selectedItems.count(), 3);
237 QVERIFY(selectedItems.contains(16));
238 QVERIFY(selectedItems.contains(18));
239 QVERIFY(selectedItems.contains(20));
240 }
241
242 void KItemListSelectionManagerTest::testItemsRemoved()
243 {
244 // Select items 10 to 15
245 m_selectionManager->setSelected(10, 6);
246 KItemSet selectedItems = m_selectionManager->selectedItems();
247 QCOMPARE(selectedItems.count(), 6);
248 for (int i = 10; i <= 15; ++i) {
249 QVERIFY(selectedItems.contains(i));
250 }
251
252 // Remove items 0 to 4 -> selection must be 5 to 10
253 m_selectionManager->itemsRemoved(KItemRangeList() << KItemRange(0, 5));
254 selectedItems = m_selectionManager->selectedItems();
255 QCOMPARE(selectedItems.count(), 6);
256 for (int i = 5; i <= 10; ++i) {
257 QVERIFY(selectedItems.contains(i));
258 }
259
260 // Remove the items 6 , 8 and 10
261 m_selectionManager->itemsRemoved(KItemRangeList() <<
262 KItemRange(6, 1) <<
263 KItemRange(8, 1) <<
264 KItemRange(10, 1));
265 selectedItems = m_selectionManager->selectedItems();
266 QCOMPARE(selectedItems.count(), 3);
267 QVERIFY(selectedItems.contains(5));
268 QVERIFY(selectedItems.contains(6));
269 QVERIFY(selectedItems.contains(7));
270 }
271
272 void KItemListSelectionManagerTest::testAnchoredSelection()
273 {
274 m_selectionManager->beginAnchoredSelection(5);
275 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
276 QCOMPARE(m_selectionManager->m_anchorItem, 5);
277
278 m_selectionManager->setCurrentItem(6);
279 QCOMPARE(m_selectionManager->currentItem(), 6);
280 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6);
281
282 m_selectionManager->setCurrentItem(4);
283 QCOMPARE(m_selectionManager->currentItem(), 4);
284 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 4 << 5);
285
286 m_selectionManager->setCurrentItem(7);
287 QCOMPARE(m_selectionManager->currentItem(), 7);
288 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7);
289
290 // Ending the anchored selection should not change the selected items.
291 m_selectionManager->endAnchoredSelection();
292 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
293 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7);
294
295 // Start a new anchored selection that overlaps the previous one
296 m_selectionManager->beginAnchoredSelection(9);
297 QVERIFY(m_selectionManager->isAnchoredSelectionActive());
298 QCOMPARE(m_selectionManager->m_anchorItem, 9);
299
300 m_selectionManager->setCurrentItem(6);
301 QCOMPARE(m_selectionManager->currentItem(), 6);
302 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 8 << 9);
303
304 m_selectionManager->setCurrentItem(10);
305 QCOMPARE(m_selectionManager->currentItem(), 10);
306 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 9 << 10);
307
308 m_selectionManager->endAnchoredSelection();
309 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
310 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 5 << 6 << 7 << 9 << 10);
311 }
312
313 namespace {
314 enum ChangeType {
315 NoChange,
316 InsertItems,
317 RemoveItems,
318 MoveItems,
319 EndAnchoredSelection,
320 SetSelected
321 };
322 }
323
324 Q_DECLARE_METATYPE(KItemSet);
325 Q_DECLARE_METATYPE(ChangeType);
326 Q_DECLARE_METATYPE(KItemRange);
327 Q_DECLARE_METATYPE(KItemRangeList);
328 Q_DECLARE_METATYPE(KItemListSelectionManager::SelectionMode);
329 Q_DECLARE_METATYPE(QList<int>);
330
331 /**
332 * The following function provides a generic way to test the selection functionality.
333 *
334 * The test is data-driven and takes the following arguments:
335 *
336 * \param initialSelection The selection at the beginning.
337 * \param anchor This item will be the anchor item.
338 * \param current This item will be the current item.
339 * \param expectedSelection Expected selection after anchor and current are set.
340 * \param changeType Type of the change that is done then:
341 * - NoChange
342 * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
343 * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
344 * - MoveItems -> data.at(0) provides the KItemRange containing the original indices,
345 * data.at(1) provides the list containing the new indices
346 * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
347 * - EndAnchoredSelection
348 * - SetSelected -> data.at(0) provides the index where the selection process starts,
349 * data.at(1) provides the number of indices to be selected,
350 * data.at(2) provides the selection mode.
351 * \sa KItemListSelectionManager::setSelected()
352 * \param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
353 * \param finalSelection The expected final selection.
354 *
355 */
356
357 void KItemListSelectionManagerTest::testChangeSelection_data()
358 {
359 QTest::addColumn<KItemSet>("initialSelection");
360 QTest::addColumn<int>("anchor");
361 QTest::addColumn<int>("current");
362 QTest::addColumn<KItemSet>("expectedSelection");
363 QTest::addColumn<ChangeType>("changeType");
364 QTest::addColumn<QList<QVariant> >("data");
365 QTest::addColumn<KItemSet>("finalSelection");
366
367 QTest::newRow("No change")
368 << (KItemSet() << 5 << 6)
369 << 2 << 3
370 << (KItemSet() << 2 << 3 << 5 << 6)
371 << NoChange
372 << QList<QVariant>()
373 << (KItemSet() << 2 << 3 << 5 << 6);
374
375 QTest::newRow("Insert Items")
376 << (KItemSet() << 5 << 6)
377 << 2 << 3
378 << (KItemSet() << 2 << 3 << 5 << 6)
379 << InsertItems
380 << (QList<QVariant>() << QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(5, 2) << KItemRange(10, 5)))
381 << (KItemSet() << 3 << 4 << 8 << 9);
382
383 QTest::newRow("Remove Items")
384 << (KItemSet() << 5 << 6)
385 << 2 << 3
386 << (KItemSet() << 2 << 3 << 5 << 6)
387 << RemoveItems
388 << (QList<QVariant>() << QVariant::fromValue(KItemRangeList() << KItemRange(1, 1) << KItemRange(3, 1) << KItemRange(10, 5)))
389 << (KItemSet() << 1 << 2 << 3 << 4);
390
391 QTest::newRow("Empty Anchored Selection")
392 << KItemSet()
393 << 2 << 2
394 << KItemSet()
395 << EndAnchoredSelection
396 << QList<QVariant>()
397 << KItemSet();
398
399 QTest::newRow("Toggle selection")
400 << (KItemSet() << 1 << 3 << 4)
401 << 6 << 8
402 << (KItemSet() << 1 << 3 << 4 << 6 << 7 << 8)
403 << SetSelected
404 << (QList<QVariant>() << 0 << 10 << QVariant::fromValue(KItemListSelectionManager::Toggle))
405 << (KItemSet() << 0 << 2 << 5 << 9);
406
407 // Swap items 2, 3 and 4, 5
408 QTest::newRow("Move items")
409 << (KItemSet() << 0 << 1 << 2 << 3)
410 << -1 << -1
411 << (KItemSet() << 0 << 1 << 2 << 3)
412 << MoveItems
413 << (QList<QVariant>() << QVariant::fromValue(KItemRange(2, 4))
414 << QVariant::fromValue(QList<int>() << 4 << 5 << 2 << 3))
415 << (KItemSet() << 0 << 1 << 4 << 5);
416
417 QTest::newRow("Move items with active anchored selection")
418 << KItemSet()
419 << 0 << 3
420 << (KItemSet() << 0 << 1 << 2 << 3)
421 << MoveItems
422 << (QList<QVariant>() << QVariant::fromValue(KItemRange(2, 4))
423 << QVariant::fromValue(QList<int>() << 4 << 5 << 2 << 3))
424 << (KItemSet() << 0 << 1 << 4 << 5);
425
426 // Revert sort order
427 QTest::newRow("Revert sort order")
428 << (KItemSet() << 0 << 1)
429 << 3 << 4
430 << (KItemSet() << 0 << 1 << 3 << 4)
431 << MoveItems
432 << (QList<QVariant>() << QVariant::fromValue(KItemRange(0, 10))
433 << QVariant::fromValue(QList<int>() << 9 << 8 << 7 << 6 << 5 << 4 << 3 << 2 << 1 << 0))
434 << (KItemSet() << 5 << 6 << 8 << 9);
435 }
436
437 void KItemListSelectionManagerTest::testChangeSelection()
438 {
439 QFETCH(KItemSet, initialSelection);
440 QFETCH(int, anchor);
441 QFETCH(int, current);
442 QFETCH(KItemSet, expectedSelection);
443 QFETCH(ChangeType, changeType);
444 QFETCH(QList<QVariant>, data);
445 QFETCH(KItemSet, finalSelection);
446
447 QSignalSpy spySelectionChanged(m_selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)));
448
449 // Initial selection should be empty
450 QVERIFY(!m_selectionManager->hasSelection());
451 QVERIFY(m_selectionManager->selectedItems().isEmpty());
452
453 // Perform the initial selectiion
454 m_selectionManager->setSelectedItems(initialSelection);
455
456 verifySelectionChange(spySelectionChanged, initialSelection, KItemSet());
457
458 // Perform an anchored selection.
459 // Note that current and anchor index are equal first because this is the case in typical uses of the
460 // selection manager, and because this makes it easier to test the correctness of the signal's arguments.
461 m_selectionManager->setCurrentItem(anchor);
462 m_selectionManager->beginAnchoredSelection(anchor);
463 m_selectionManager->setCurrentItem(current);
464 QCOMPARE(m_selectionManager->m_anchorItem, anchor);
465 QCOMPARE(m_selectionManager->currentItem(), current);
466
467 verifySelectionChange(spySelectionChanged, expectedSelection, initialSelection);
468
469 // Change the model by inserting or removing items.
470 switch (changeType) {
471 case InsertItems:
472 m_selectionManager->itemsInserted(data.at(0).value<KItemRangeList>());
473 break;
474 case RemoveItems:
475 m_selectionManager->itemsRemoved(data.at(0).value<KItemRangeList>());
476 break;
477 case MoveItems:
478 m_selectionManager->itemsMoved(data.at(0).value<KItemRange>(),
479 data.at(1).value<QList<int> >());
480 break;
481 case EndAnchoredSelection:
482 m_selectionManager->endAnchoredSelection();
483 QVERIFY(!m_selectionManager->isAnchoredSelectionActive());
484 break;
485 case SetSelected:
486 m_selectionManager->setSelected(data.at(0).value<int>(), // index
487 data.at(1).value<int>(), // count
488 data.at(2).value<KItemListSelectionManager::SelectionMode>());
489 break;
490 case NoChange:
491 break;
492 }
493
494 verifySelectionChange(spySelectionChanged, finalSelection, expectedSelection);
495
496 // Finally, clear the selection
497 m_selectionManager->clearSelection();
498
499 verifySelectionChange(spySelectionChanged, KItemSet(), finalSelection);
500 }
501
502 void KItemListSelectionManagerTest::testDeleteCurrentItem_data()
503 {
504 QTest::addColumn<int>("oldCurrentItemIndex");
505 QTest::addColumn<int>("removeIndex");
506 QTest::addColumn<int>("removeCount");
507 QTest::addColumn<int>("newCurrentItemIndex");
508
509 QTest::newRow("Remove before") << 50 << 0 << 10 << 40;
510 QTest::newRow("Remove after") << 50 << 51 << 10 << 50;
511 QTest::newRow("Remove exactly current item") << 50 << 50 << 1 << 50;
512 QTest::newRow("Remove around current item") << 50 << 45 << 10 << 45;
513 QTest::newRow("Remove all except one item") << 50 << 1 << 99 << 0;
514 }
515
516 void KItemListSelectionManagerTest::testDeleteCurrentItem()
517 {
518 QFETCH(int, oldCurrentItemIndex);
519 QFETCH(int, removeIndex);
520 QFETCH(int, removeCount);
521 QFETCH(int, newCurrentItemIndex);
522
523 m_selectionManager->setCurrentItem(oldCurrentItemIndex);
524
525 const int newCount = m_model->count() - removeCount;
526 m_model->setCount(newCount);
527 m_selectionManager->itemsRemoved(KItemRangeList() << KItemRange(removeIndex, removeCount));
528
529 QCOMPARE(m_selectionManager->currentItem(), newCurrentItemIndex);
530 }
531
532 void KItemListSelectionManagerTest::testAnchoredSelectionAfterMovingItems()
533 {
534 m_selectionManager->setCurrentItem(4);
535 m_selectionManager->beginAnchoredSelection(4);
536
537 // Reverse the items between 0 and 5.
538 m_selectionManager->itemsMoved(KItemRange(0, 6), QList<int>() << 5 << 4 << 3 << 2 << 1 << 0);
539
540 QCOMPARE(m_selectionManager->currentItem(), 1);
541 QCOMPARE(m_selectionManager->m_anchorItem, 1);
542
543 // Make 2 the current item -> 1 and 2 should be selected.
544 m_selectionManager->setCurrentItem(2);
545 QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 1 << 2);
546 }
547
548 void KItemListSelectionManagerTest::verifySelectionChange(QSignalSpy& spy,
549 const KItemSet& currentSelection,
550 const KItemSet& previousSelection) const
551 {
552 QCOMPARE(m_selectionManager->selectedItems(), currentSelection);
553 QCOMPARE(m_selectionManager->hasSelection(), !currentSelection.isEmpty());
554 for (int index = 0; index < m_selectionManager->model()->count(); ++index) {
555 if (currentSelection.contains(index)) {
556 QVERIFY(m_selectionManager->isSelected(index));
557 }
558 else {
559 QVERIFY(!m_selectionManager->isSelected(index));
560 }
561 }
562
563 if (currentSelection == previousSelection) {
564 QCOMPARE(spy.count(), 0);
565 }
566 else {
567 QCOMPARE(spy.count(), 1);
568 QList<QVariant> arguments = spy.takeFirst();
569 QCOMPARE(qvariant_cast<KItemSet>(arguments.at(0)), currentSelection);
570 QCOMPARE(qvariant_cast<KItemSet>(arguments.at(1)), previousSelection);
571 }
572 }
573
574 QTEST_KDEMAIN(KItemListSelectionManagerTest, NoGUI)
575
576 #include "kitemlistselectionmanagertest.moc"