diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2010-09-30 15:49:19 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-10-04 04:51:50 (GMT) |
commit | c249db933aeb4b44b935924f3ff67669f3d94707 (patch) | |
tree | 260edceda89d41e07d502a585b644e6ab3b117c4 /tests/auto/declarative/qdeclarativedebugclient | |
parent | 000a95629a4dd07b600b5ae4d463654f8d2267af (diff) | |
download | Qt-c249db933aeb4b44b935924f3ff67669f3d94707.zip Qt-c249db933aeb4b44b935924f3ff67669f3d94707.tar.gz Qt-c249db933aeb4b44b935924f3ff67669f3d94707.tar.bz2 |
QDeclarativeDebug: Make autotests more robust
Always flush sockets after sending data, and make autotests more robust
by using busy wait.
Reviewed-by: Christiaan Janssen
(cherry picked from commit cfe198948f1e4867918176df38b3e0b49757a4b8)
Diffstat (limited to 'tests/auto/declarative/qdeclarativedebugclient')
-rw-r--r-- | tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index a5f9846..80241ba 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -112,12 +112,10 @@ void tst_QDeclarativeDebugClient::status() { QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::status()"); - QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())); - QCOMPARE(client.status(), QDeclarativeDebugClient::Enabled); + QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled); } - QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())); - QCOMPARE(client.status(), QDeclarativeDebugClient::Unavailable); + QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Unavailable); // duplicate plugin name QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugClient: Conflicting plugin name \"tst_QDeclarativeDebugClient::status()\" "); @@ -135,7 +133,8 @@ void tst_QDeclarativeDebugClient::sendMessage() QByteArray msg = "hello!"; - QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())); + QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled); + client.sendMessage(msg); QByteArray resp = client.waitForResponse(); QCOMPARE(resp, msg); |