diff options
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp | 7 | ||||
-rw-r--r-- | tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index 5bd62a8494..a488aa021f 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -519,18 +519,13 @@ void tst_QLibrary::fileName() QLibrary lib(libName); bool ok = lib.load(); - if (!ok) { - qDebug() << lib.errorString(); - } - - QVERIFY(ok); + QVERIFY2(ok, qPrintable(lib.errorString())); #if defined(Q_OS_WIN) QCOMPARE(lib.fileName().toLower(), expectedFilename.toLower()); #else QCOMPARE(lib.fileName(), expectedFilename); #endif QVERIFY(lib.unload()); - } void tst_QLibrary::multipleInstancesForOneLibrary() 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() |