From 726a49431909dbd8bdc6efdb8a36ddf4214a7328 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 16 Aug 2015 12:45:17 +0200 Subject: Batch dequeue in messagequeue. The messagequeue removes all dequeued values once all values have been processed in a single transaction. --- tests/genericresourcetest.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/genericresourcetest.cpp b/tests/genericresourcetest.cpp index 0faa484..abac7a6 100644 --- a/tests/genericresourcetest.cpp +++ b/tests/genericresourcetest.cpp @@ -87,14 +87,12 @@ private Q_SLOTS: //Actual test auto pipeline = QSharedPointer::create("org.kde.test.instance1"); QSignalSpy revisionSpy(pipeline.data(), SIGNAL(revisionUpdated(qint64))); + QVERIFY(revisionSpy.isValid()); TestResource resource("org.kde.test.instance1", pipeline); resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); - - QVERIFY(revisionSpy.isValid()); - QTRY_COMPARE(revisionSpy.count(), 2); - QTest::qWait(100); - QCOMPARE(revisionSpy.count(), 2); + resource.processAllMessages().exec().waitForFinished(); + QCOMPARE(revisionSpy.last().at(0).toInt(), 2); } }; -- cgit v1.2.3