diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-03 14:02:27 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-03 14:02:27 +0200 |
commit | 55fe06979ceebe67553135b43aa47e70d931304b (patch) | |
tree | 16b10a744879cc1872d6c07624b59ae64469ddbf /tests/notificationtest.cpp | |
parent | 56fae95f49a1ca8ca614bd9f89b0ea5f872765e9 (diff) | |
parent | 288946f1694c2abe1d2c5800c87339d1e8780e4b (diff) | |
download | sink-55fe06979ceebe67553135b43aa47e70d931304b.tar.gz sink-55fe06979ceebe67553135b43aa47e70d931304b.zip |
Merge branch 'develop'
Diffstat (limited to 'tests/notificationtest.cpp')
-rw-r--r-- | tests/notificationtest.cpp | 21 |
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). |