diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/notificationtest.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/notificationtest.cpp b/tests/notificationtest.cpp index a34d325..e268a17 100644 --- a/tests/notificationtest.cpp +++ b/tests/notificationtest.cpp | |||
@@ -67,12 +67,22 @@ 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::OfflineStatus, |
74 | QCOMPARE(statusNotifications.at(1).code, static_cast<int>(ApplicationDomain::Status::BusyStatus)); | 74 | Status::ConnectedStatus, |
75 | QCOMPARE(statusNotifications.at(2).code, static_cast<int>(ApplicationDomain::Status::ConnectedStatus)); | 75 | Status::BusyStatus, |
76 | Status::ConnectedStatus | ||
77 | }; | ||
78 | qInfo() << "Received notifications " << statusNotifications; | ||
79 | QVERIFY2(statusNotifications.size() <= expected.size(), "More notifications than expected."); | ||
80 | QTRY_COMPARE(statusNotifications.size(), expected.size()); | ||
81 | qInfo() << "All received notifications " << statusNotifications; | ||
82 | for (auto i = 0; i < statusNotifications.size(); i++) { | ||
83 | QCOMPARE(statusNotifications.at(i).code, static_cast<int>(expected.at(i))); | ||
84 | } | ||
85 | } | ||
76 | //Changereplay | 86 | //Changereplay |
77 | // It can happen that we get a changereplay notification pair first and then a second one at the end, | 87 | // 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). | 88 | // we therefore currently filter all changereplay notifications (see above). |