summaryrefslogtreecommitdiffstats
path: root/tests/auto/qbearertestcommon.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-09 14:05:20 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-09 14:05:20 (GMT)
commitf5c9262ab59bdb4e35e7d26ea52b72d65b178cf2 (patch)
tree56b9e94aea9571cda947dca8ca5bfc000c6effed /tests/auto/qbearertestcommon.h
parentd85b149a5c7f3532f8e1a593a79298c9ae38a95f (diff)
parentbb966fe9dd8be25530da5a66727c7fe2123fafbb (diff)
downloadQt-f5c9262ab59bdb4e35e7d26ea52b72d65b178cf2.zip
Qt-f5c9262ab59bdb4e35e7d26ea52b72d65b178cf2.tar.gz
Qt-f5c9262ab59bdb4e35e7d26ea52b72d65b178cf2.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'tests/auto/qbearertestcommon.h')
-rw-r--r--tests/auto/qbearertestcommon.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qbearertestcommon.h b/tests/auto/qbearertestcommon.h
index 0bfe622..c9df249 100644
--- a/tests/auto/qbearertestcommon.h
+++ b/tests/auto/qbearertestcommon.h
@@ -42,6 +42,19 @@
#ifndef QBEARERTESTCOMMON_H
#define QBEARERTESTCOMMON_H
+// Wait for __expr to happen, while still allowing events to be processed.
+#define QTRY_NOOP(__expr) \
+ do { \
+ const int __step = 50; \
+ const int __timeout = 15000; \
+ if (!(__expr)) { \
+ QTest::qWait(0); \
+ } \
+ for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
+ QTest::qWait(__step); \
+ } \
+ } while(0)
+
// Will try to wait for the condition while allowing event processing
#define QTRY_VERIFY(__expr) \
do { \