summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-06-16 22:57:03 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-06-16 22:57:03 (GMT)
commiteda8acac2197a12fff512b3b7da8a671a458de27 (patch)
treea9be7aa0b85912df29b45198881a3f6c26cd9515 /tests/auto/qwidget
parent3c33d95b9906758733edf2b6a79b19f2cfdd5add (diff)
downloadQt-eda8acac2197a12fff512b3b7da8a671a458de27.zip
Qt-eda8acac2197a12fff512b3b7da8a671a458de27.tar.gz
Qt-eda8acac2197a12fff512b3b7da8a671a458de27.tar.bz2
Replace custom WAIT_FOR_CONDITION with semi-standard QTRY_COMPARE
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 18cc2ba..140356b 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -151,16 +151,6 @@ bool macHasAccessToWindowsServer()
#undef Bool
#endif
-// Will try to wait for the condition while allowing event processing
-// for a maximum of 2 seconds.
-#define WAIT_FOR_CONDITION(expr, expected) \
- do { \
- const int step = 100; \
- for (int i = 0; i < 2000 && expr != expected; i+=step) { \
- QTest::qWait(step); \
- } \
- } while(0)
-
//TESTED_CLASS=
//TESTED_FILES=
@@ -1657,13 +1647,11 @@ void tst_QWidget::focusChainOnHide()
child->setFocus();
qApp->processEvents();
- WAIT_FOR_CONDITION(child->hasFocus(), true);
- QCOMPARE(child->hasFocus(), true);
+ QTRY_COMPARE(child->hasFocus(), true);
child->hide();
qApp->processEvents();
- WAIT_FOR_CONDITION(parent->hasFocus(), true);
- QCOMPARE(parent->hasFocus(), true);
+ QTRY_COMPARE(parent->hasFocus(), true);
QCOMPARE(parent, qApp->focusWidget());
delete parent;