diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-29 21:01:27 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-29 21:01:27 +0200 |
commit | 2daac34a28aa8a1623f6d347e2a81474b65caf8a (patch) | |
tree | e336a865734ee01ba16db2b8170723a429f71097 /tests | |
parent | 772e1ed16c467ee78dd89da1170ff0812161ee39 (diff) | |
download | sink-2daac34a28aa8a1623f6d347e2a81474b65caf8a.tar.gz sink-2daac34a28aa8a1623f6d347e2a81474b65caf8a.zip |
Cleanup
Diffstat (limited to 'tests')
-rw-r--r-- | tests/resourcecommunicationtest.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/resourcecommunicationtest.cpp b/tests/resourcecommunicationtest.cpp index 7beafc7..ca96baa 100644 --- a/tests/resourcecommunicationtest.cpp +++ b/tests/resourcecommunicationtest.cpp | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "resourceaccess.h" | 3 | #include "resourceaccess.h" |
4 | #include "listener.h" | 4 | #include "listener.h" |
5 | #include "commands.h" | 5 | #include "commands.h" |
6 | #include "testutils.h" | ||
6 | #include "handshake_generated.h" | 7 | #include "handshake_generated.h" |
7 | 8 | ||
8 | /** | 9 | /** |
@@ -34,9 +35,7 @@ private slots: | |||
34 | auto name = fbb.CreateString("test"); | 35 | auto name = fbb.CreateString("test"); |
35 | auto command = Sink::Commands::CreateHandshake(fbb, name); | 36 | auto command = Sink::Commands::CreateHandshake(fbb, name); |
36 | Sink::Commands::FinishHandshakeBuffer(fbb, command); | 37 | Sink::Commands::FinishHandshakeBuffer(fbb, command); |
37 | auto result = resourceAccess.sendCommand(Sink::Commands::HandshakeCommand, fbb).exec(); | 38 | VERIFYEXEC(resourceAccess.sendCommand(Sink::Commands::HandshakeCommand, fbb)); |
38 | result.waitForFinished(); | ||
39 | QVERIFY(!result.errorCode()); | ||
40 | } | 39 | } |
41 | 40 | ||
42 | void testCommandLoop() | 41 | void testCommandLoop() |
@@ -76,7 +75,7 @@ private slots: | |||
76 | int complete = 0; | 75 | int complete = 0; |
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 | VERIFYEXEC(resourceAccess.sendCommand(Sink::Commands::PingCommand) |
80 | .then([&resourceAccess, &errors, &complete](const KAsync::Error &error) { | 79 | .then([&resourceAccess, &errors, &complete](const KAsync::Error &error) { |
81 | complete++; | 80 | complete++; |
82 | if (error) { | 81 | if (error) { |
@@ -85,9 +84,7 @@ private slots: | |||
85 | } | 84 | } |
86 | resourceAccess.close(); | 85 | resourceAccess.close(); |
87 | resourceAccess.open(); | 86 | resourceAccess.open(); |
88 | }) | 87 | })); |
89 | .exec() | ||
90 | .waitForFinished(); | ||
91 | } | 88 | } |
92 | QTRY_COMPARE(complete, count); | 89 | QTRY_COMPARE(complete, count); |
93 | QVERIFY(!errors); | 90 | QVERIFY(!errors); |