summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qsemaphore
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-11-10 13:10:40 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-11 04:28:14 +0100
commit64c8691548d357d34521ec698050cf4d442eee3d (patch)
tree67d8de49c7729b40aba838b0adaaad1cf8b77725 /tests/auto/corelib/thread/qsemaphore
parenta28817fd78540b312b0075ad45d227819175df93 (diff)
Cleanup corelib autotests
Use QVERIFY2 to provide better test diagnostics. Change-Id: I128004f4ee133ceed4d8f373bbbe4a0eee431ebf Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/thread/qsemaphore')
-rw-r--r--tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
index b9ee0e2f18..c7ff4fa02b 100644
--- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
+++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
@@ -229,8 +229,8 @@ void tst_QSemaphore::tryAcquireWithTimeout()
QSemaphore semaphore;
QTime time;
-#define QVERIFYGE(a,b) {int e = a; if (a<b) qDebug() << #a << "=" << e << " !>= " << #b << "=" << b; QVERIFY(e>=b);}
-#define QVERIFYLE(a,b) {int e = a; if (b<a) qDebug() << #a << "=" << e << " !<= " << #b << "=" << b; QVERIFY(e<=b);}
+#define QVERIFYGE(a,b) QVERIFY2(a >= b, qPrintable(QString("%1 = %2 !>= %3 = %4").arg(#a).arg(a).arg(#b).arg(b)));
+#define QVERIFYLE(a,b) QVERIFY2(a <= b, qPrintable(QString("%1 = %2 !<= %3 = %4").arg(#a).arg(a).arg(#b).arg(b)));
QCOMPARE(semaphore.available(), 0);
@@ -302,6 +302,9 @@ void tst_QSemaphore::tryAcquireWithTimeout()
QVERIFY(!semaphore.tryAcquire(10, timeout));
QVERIFYGE(time.elapsed(), timeout);
QCOMPARE(semaphore.available(), 0);
+
+#undef QVERIFYGE
+#undef QVERIFYLE
}
void tst_QSemaphore::tryAcquireWithTimeoutStarvation()