Changeset View
Changeset View
Standalone View
Standalone View
tests/testlib/akonadistoragetestbase.cpp
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Line(s) | 324 | { | |||
---|---|---|---|---|---|
329 | QSignalSpy spy(monitor.data(), &Akonadi::MonitorInterface::itemRemoved); | 329 | QSignalSpy spy(monitor.data(), &Akonadi::MonitorInterface::itemRemoved); | ||
330 | MonitorSpy monitorSpy(monitor.data()); | 330 | MonitorSpy monitorSpy(monitor.data()); | ||
331 | 331 | | |||
332 | Akonadi::Item item = fetchItemByRID(QStringLiteral("{d0159c99-0d23-41fa-bb5f-tasktoremove}"), calendar2()); | 332 | Akonadi::Item item = fetchItemByRID(QStringLiteral("{d0159c99-0d23-41fa-bb5f-tasktoremove}"), calendar2()); | ||
333 | QVERIFY(item.isValid()); | 333 | QVERIFY(item.isValid()); | ||
334 | 334 | | |||
335 | // WHEN | 335 | // WHEN | ||
336 | auto storage = createStorage(); | 336 | auto storage = createStorage(); | ||
337 | auto job = storage->removeItem(item); | 337 | auto job = storage->removeItem(item, nullptr); | ||
338 | AKVERIFYEXEC(job); | 338 | AKVERIFYEXEC(job); | ||
339 | monitorSpy.waitForStableState(); | 339 | monitorSpy.waitForStableState(); | ||
340 | QTRY_VERIFY(!spy.isEmpty()); | 340 | QTRY_VERIFY(!spy.isEmpty()); | ||
341 | 341 | | |||
342 | // THEN | 342 | // THEN | ||
343 | QCOMPARE(spy.size(), 1); | 343 | QCOMPARE(spy.size(), 1); | ||
344 | auto notifiedItem = spy.takeFirst().at(0).value<Akonadi::Item>(); | 344 | auto notifiedItem = spy.takeFirst().at(0).value<Akonadi::Item>(); | ||
345 | QCOMPARE(notifiedItem.id(), item.id()); | 345 | QCOMPARE(notifiedItem.id(), item.id()); | ||
▲ Show 20 Lines • Show All 274 Lines • ▼ Show 20 Line(s) | 614 | { | |||
620 | QSignalSpy spy(monitor.data(), &Akonadi::MonitorInterface::itemRemoved); | 620 | QSignalSpy spy(monitor.data(), &Akonadi::MonitorInterface::itemRemoved); | ||
621 | MonitorSpy monitorSpy(monitor.data()); | 621 | MonitorSpy monitorSpy(monitor.data()); | ||
622 | 622 | | |||
623 | // An existing item (if we trust the test data) | 623 | // An existing item (if we trust the test data) | ||
624 | Akonadi::Item item = fetchItemByRID(QStringLiteral("{0aa4dc30-a2c2-4e08-8241-033b3344debc}"), calendar1()); | 624 | Akonadi::Item item = fetchItemByRID(QStringLiteral("{0aa4dc30-a2c2-4e08-8241-033b3344debc}"), calendar1()); | ||
625 | QVERIFY(item.isValid()); | 625 | QVERIFY(item.isValid()); | ||
626 | 626 | | |||
627 | //When | 627 | //When | ||
628 | auto job = storage->removeItem(item); | 628 | auto job = storage->removeItem(item, nullptr); | ||
629 | AKVERIFYEXEC(job); | 629 | AKVERIFYEXEC(job); | ||
630 | monitorSpy.waitForStableState(); | 630 | monitorSpy.waitForStableState(); | ||
631 | QTRY_VERIFY(!spy.isEmpty()); | 631 | QTRY_VERIFY(!spy.isEmpty()); | ||
632 | 632 | | |||
633 | // THEN | 633 | // THEN | ||
634 | QCOMPARE(spy.size(), 1); | 634 | QCOMPARE(spy.size(), 1); | ||
635 | auto notifiedItem = spy.takeFirst().at(0).value<Akonadi::Item>(); | 635 | auto notifiedItem = spy.takeFirst().at(0).value<Akonadi::Item>(); | ||
636 | QCOMPARE(notifiedItem.id(), item.id()); | 636 | QCOMPARE(notifiedItem.id(), item.id()); | ||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |