diff options
author | David Faure <faure@kde.org> | 2012-05-03 09:02:10 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-04 07:34:03 (GMT) |
commit | 841d72500ce2763f4ce00c5979658a397491d5be (patch) | |
tree | bfbed75f1e93d5264a3ff6fa83f9a8907be243e3 /tests/auto | |
parent | 00ac402870730592965a41567bb4d577fc441f82 (diff) | |
download | Qt-841d72500ce2763f4ce00c5979658a397491d5be.zip Qt-841d72500ce2763f4ce00c5979658a397491d5be.tar.gz Qt-841d72500ce2763f4ce00c5979658a397491d5be.tar.bz2 |
Fix unit confusion in ccf3b9e48b2d773999a9a88e249f79380618cde6
I wrote nonsense in that commit. The older methods that take a timeout
all take milliseconds, and the comments in the unit test really meant
milliseconds, not seconds. 1s is not shorter than 100ms....
Backport of 972464262166752df0015fe1209a7ab307cc7105
Change-Id: I3539cf196848b483b8c3a96b45851a465fc2dfcb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 5ba581e..07427ed 100644 --- a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -497,7 +497,7 @@ void tst_QDBusAbstractInterface::callWithTimeout() QDBusMessage msg = QDBusMessage::createMethodCall(server_serviceName, server_objectPath, server_interfaceName, "sleepMethod"); - msg << 100; + msg << 100; // sleep 100 ms { // Call with no timeout -> works @@ -507,7 +507,7 @@ void tst_QDBusAbstractInterface::callWithTimeout() } { - // Call with 1 sec timeout -> fails + // Call with 1 msec timeout -> fails QDBusMessage reply = con.call(msg, QDBus::Block, 1); QCOMPARE(reply.type(), QDBusMessage::ErrorMessage); } @@ -522,11 +522,17 @@ void tst_QDBusAbstractInterface::callWithTimeout() QCOMPARE(reply.arguments().at(0).toInt(), 42); } { - // Call with 1 sec timeout -> fails + // Call with 1 msec timeout -> fails iface.setTimeout(1); QDBusMessage reply = iface.call("sleepMethod", 100); QCOMPARE(reply.type(), QDBusMessage::ErrorMessage); } + { + // Call with 300 msec timeout -> works + iface.setTimeout(300); + QDBusMessage reply = iface.call("sleepMethod", 100); + QCOMPARE(reply.arguments().at(0).toInt(), 42); + } // Now using generated code com::trolltech::QtDBus::Pinger p(server_serviceName, server_objectPath, QDBusConnection::sessionBus()); @@ -537,7 +543,7 @@ void tst_QDBusAbstractInterface::callWithTimeout() QCOMPARE(int(reply), 42); } { - // Call with 1 sec timeout -> fails + // Call with 1 msec timeout -> fails p.setTimeout(1); QDBusReply<int> reply = p.sleepMethod(100); QVERIFY(!reply.isValid()); |