diff options
Diffstat (limited to 'tests/auto/network/bearer/qbearertestcommon.h')
-rw-r--r-- | tests/auto/network/bearer/qbearertestcommon.h | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/tests/auto/network/bearer/qbearertestcommon.h b/tests/auto/network/bearer/qbearertestcommon.h index c16c2016e8..6279dbb1ef 100644 --- a/tests/auto/network/bearer/qbearertestcommon.h +++ b/tests/auto/network/bearer/qbearertestcommon.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -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,33 +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) - -// Will try to wait for the condition while allowing event processing -#define QTRY_COMPARE(__expr, __expected) \ - do { \ - const int __step = 50; \ - const int __timeout = 90000; \ - if ((__expr) != (__expected)) { \ - QTest::qWait(0); \ - } \ - for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \ - QTest::qWait(__step); \ - } \ - QCOMPARE(__expr, __expected); \ - } while(0) - #endif - |