diff options
Diffstat (limited to 'tests/resourcecommunicationtest.cpp')
-rw-r--r-- | tests/resourcecommunicationtest.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/resourcecommunicationtest.cpp b/tests/resourcecommunicationtest.cpp index db8703e..2daf372 100644 --- a/tests/resourcecommunicationtest.cpp +++ b/tests/resourcecommunicationtest.cpp | |||
@@ -51,14 +51,13 @@ private slots: | |||
51 | int errors = 0; | 51 | int errors = 0; |
52 | for (int i = 0; i < count; i++) { | 52 | for (int i = 0; i < count; i++) { |
53 | auto result = resourceAccess.sendCommand(Sink::Commands::PingCommand) | 53 | auto result = resourceAccess.sendCommand(Sink::Commands::PingCommand) |
54 | .then<void>([&complete]() { | 54 | .then<void>([&complete]() { complete++; }, |
55 | complete++; | 55 | [&errors, &complete](int error, const QString &msg) { |
56 | }, | 56 | qWarning() << msg; |
57 | [&errors, &complete](int error, const QString &msg) { | 57 | errors++; |
58 | qWarning() << msg; | 58 | complete++; |
59 | errors++; | 59 | }) |
60 | complete++; | 60 | .exec(); |
61 | }).exec(); | ||
62 | } | 61 | } |
63 | QTRY_COMPARE(complete, count); | 62 | QTRY_COMPARE(complete, count); |
64 | QVERIFY(!errors); | 63 | QVERIFY(!errors); |
@@ -77,17 +76,18 @@ private slots: | |||
77 | int errors = 0; | 76 | int errors = 0; |
78 | for (int i = 0; i < count; i++) { | 77 | for (int i = 0; i < count; i++) { |
79 | resourceAccess.sendCommand(Sink::Commands::PingCommand) | 78 | resourceAccess.sendCommand(Sink::Commands::PingCommand) |
80 | .then<void>([&complete]() { | 79 | .then<void>([&complete]() { complete++; }, |
81 | complete++; | 80 | [&errors, &complete](int error, const QString &msg) { |
82 | }, | 81 | qWarning() << msg; |
83 | [&errors, &complete](int error, const QString &msg) { | 82 | errors++; |
84 | qWarning() << msg; | 83 | complete++; |
85 | errors++; | 84 | }) |
86 | complete++; | 85 | .then<void>([&resourceAccess]() { |
87 | }).then<void>([&resourceAccess]() { | ||
88 | resourceAccess.close(); | 86 | resourceAccess.close(); |
89 | resourceAccess.open(); | 87 | resourceAccess.open(); |
90 | }).exec().waitForFinished(); | 88 | }) |
89 | .exec() | ||
90 | .waitForFinished(); | ||
91 | } | 91 | } |
92 | QTRY_COMPARE(complete, count); | 92 | QTRY_COMPARE(complete, count); |
93 | QVERIFY(!errors); | 93 | QVERIFY(!errors); |