diff options
author | Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com> | 2016-08-24 09:51:28 +0200 |
---|---|---|
committer | Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com> | 2016-08-24 08:30:07 +0000 |
commit | a10377853b0b5820cd7e4c9f09ef66a581330949 (patch) | |
tree | f9afbc6a7d88e5d2ecaeb36215026361f4b1487b /tests | |
parent | c88cc251ec1f7f70bae2ea9d5438a3e52e3a1f75 (diff) |
Patch for failing testipc tests
I expect the tests fail because of a wait line. Test uses now the
try version of compare and verify to allow better async waiting
control.
Change-Id: If38ebdbe2dc5c50e9bce824314749b418eab9317
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testipc/tst_testipc.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/testipc/tst_testipc.cpp b/tests/testipc/tst_testipc.cpp index 68628a0..f73d37a 100644 --- a/tests/testipc/tst_testipc.cpp +++ b/tests/testipc/tst_testipc.cpp @@ -28,9 +28,8 @@ ** SPDX-License-Identifier: GPL-3.0 ** ****************************************************************************/ -#include <QtCore> + #include <QtTest> -#include <QtNetwork> #include "ipc/ipcserver.h" #include "ipc/ipcclient.h" @@ -47,7 +46,6 @@ public slots: QDataStream stream(data); QString message; stream >> message; - qDebug() << method << ": " << message; } if (method == "sendFile(QString,QByteArray)") { QDataStream stream(data); @@ -55,7 +53,6 @@ public slots: stream >> path; QByteArray body; stream >> body; - qDebug() << method << ": " << path; } } @@ -71,8 +68,7 @@ private Q_SLOTS: stream << QString("Hello IPC!"); peer2.send("echo(QString)", bytes); QSignalSpy received(&peer1, SIGNAL(received(QString,QByteArray))); - QTest::qWait(100); - QVERIFY(received.count() == 1); + QTRY_COMPARE(received.count(), 1); } void sendFile() { @@ -88,8 +84,7 @@ private Q_SLOTS: stream << QString("hello").toLatin1(); peer2.send("sendFile(QString,QByteArray)", bytes); QSignalSpy received(&peer1, SIGNAL(received(QString,QByteArray))); - QTest::qWait(100); - QVERIFY(received.count() == 1); + QTRY_COMPARE(received.count(), 1); } }; |