summaryrefslogtreecommitdiffstats
path: root/tests/notificationtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/notificationtest.cpp')
-rw-r--r--tests/notificationtest.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/notificationtest.cpp b/tests/notificationtest.cpp
index a34d325..f0d957e 100644
--- a/tests/notificationtest.cpp
+++ b/tests/notificationtest.cpp
@@ -67,12 +67,21 @@ private slots:
67 VERIFYEXEC(Sink::Store::synchronize(query)); 67 VERIFYEXEC(Sink::Store::synchronize(query));
68 VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(QByteArrayList() << "sink.dummy.instance1")); 68 VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(QByteArrayList() << "sink.dummy.instance1"));
69 69
70 QVERIFY(statusNotifications.size() <= 3); 70 using namespace Sink::ApplicationDomain;
71 QTRY_COMPARE(statusNotifications.size(), 3); 71 {
72 //Sync 72 QList<Status> expected = {
73 QCOMPARE(statusNotifications.at(0).code, static_cast<int>(ApplicationDomain::Status::ConnectedStatus)); 73 Status::ConnectedStatus,
74 QCOMPARE(statusNotifications.at(1).code, static_cast<int>(ApplicationDomain::Status::BusyStatus)); 74 Status::BusyStatus,
75 QCOMPARE(statusNotifications.at(2).code, static_cast<int>(ApplicationDomain::Status::ConnectedStatus)); 75 Status::ConnectedStatus,
76 };
77 qInfo() << "Received notifications " << statusNotifications;
78 QVERIFY2(statusNotifications.size() <= expected.size(), "More notifications than expected.");
79 QTRY_COMPARE(statusNotifications.size(), expected.size());
80 qInfo() << "All received notifications " << statusNotifications;
81 for (auto i = 0; i < statusNotifications.size(); i++) {
82 QCOMPARE(statusNotifications.at(i).code, static_cast<int>(expected.at(i)));
83 }
84 }
76 //Changereplay 85 //Changereplay
77 // It can happen that we get a changereplay notification pair first and then a second one at the end, 86 // It can happen that we get a changereplay notification pair first and then a second one at the end,
78 // we therefore currently filter all changereplay notifications (see above). 87 // we therefore currently filter all changereplay notifications (see above).