diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-01-10 10:13:55 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-10 19:54:03 +0100 |
commit | dc5ea809634560e836d2847f42f66beb43db7924 (patch) | |
tree | 5a80b2e483451e19da23af36f706c95bc102416c /tests/auto/network/bearer/qbearertestcommon.h | |
parent | 00d4b151123b5df415db9cd49d4683ac485cf1e7 (diff) |
Tests: Remove duplicate QTRY_VERIFY/QTRY_COMPARE macros in bearer.
Introduce QTRY_VERIFY_WITH_TIMEOUT and QTRY_COMPARE_WITH_TIMEOUT
to be able to specify a timeout value.
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Change-Id: Iaeaa4938eb14f2c431537055f626510cba183ce3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/network/bearer/qbearertestcommon.h')
-rw-r--r-- | tests/auto/network/bearer/qbearertestcommon.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tests/auto/network/bearer/qbearertestcommon.h b/tests/auto/network/bearer/qbearertestcommon.h index 4b73b51d15..6279dbb1ef 100644 --- a/tests/auto/network/bearer/qbearertestcommon.h +++ b/tests/auto/network/bearer/qbearertestcommon.h @@ -42,6 +42,10 @@ #ifndef QBEARERTESTCOMMON_H #define QBEARERTESTCOMMON_H +#include <QtTest/qtestcase.h> + +enum { TestTimeOut = 90000 }; + // Wait for __expr to happen, while still allowing events to be processed. #define QTRY_NOOP(__expr) \ do { \ @@ -55,18 +59,4 @@ } \ } while(0) -// Will try to wait for the condition while allowing event processing -#define QTRY_VERIFY(__expr) \ - do { \ - const int __step = 50; \ - const int __timeout = 90000; \ - if (!(__expr)) { \ - QTest::qWait(0); \ - } \ - for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \ - QTest::qWait(__step); \ - } \ - QVERIFY(__expr); \ - } while(0) - #endif |