Remove duplicates of QTRY_VERIFY and QTRY_COMPARE.
These macros are now provided by testlib via the QtTest/QtTest header. Change-Id: I6b499395888268aab315d63404e2b0eed8688615 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
090e3efaeb
commit
0811215f40
@@ -52,39 +52,6 @@
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
// Eventually these will make it into qtestcase.h
|
||||
// but we might need to tweak the timeout values here.
|
||||
#ifndef QTRY_COMPARE
|
||||
#define QTRY_COMPARE(__expr, __expected) \
|
||||
do { \
|
||||
const int __step = 50; \
|
||||
const int __timeout = 5000; \
|
||||
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
|
||||
|
||||
#ifndef QTRY_VERIFY
|
||||
#define QTRY_VERIFY(__expr) \
|
||||
do { \
|
||||
const int __step = 50; \
|
||||
const int __timeout = 5000; \
|
||||
if (!(__expr)) { \
|
||||
QTest::qWait(0); \
|
||||
} \
|
||||
for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
|
||||
QTest::qWait(__step); \
|
||||
} \
|
||||
QVERIFY(__expr); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define QTRY_WAIT(code, __expr) \
|
||||
do { \
|
||||
const int __step = 50; \
|
||||
|
||||
@@ -61,37 +61,6 @@
|
||||
#include "mockmediaplayerservice.h"
|
||||
#include "mockvideosurface.h"
|
||||
|
||||
// Encouraging successful diversity through copy and paste.
|
||||
#ifndef QTRY_COMPARE
|
||||
#define QTRY_COMPARE(__expr, __expected) \
|
||||
do { \
|
||||
const int __step = 50; \
|
||||
const int __timeout = 5000; \
|
||||
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
|
||||
|
||||
#ifndef QTRY_VERIFY
|
||||
#define QTRY_VERIFY(__expr) \
|
||||
do { \
|
||||
const int __step = 50; \
|
||||
const int __timeout = 5000; \
|
||||
if (!(__expr)) { \
|
||||
QTest::qWait(0); \
|
||||
} \
|
||||
for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
|
||||
QTest::qWait(__step); \
|
||||
} \
|
||||
QVERIFY(__expr); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class AutoConnection
|
||||
|
||||
Reference in New Issue
Block a user