From: Rohan McGovern Date: Thu, 24 Nov 2011 05:01:49 +0000 (+1000) Subject: Improved failure messages from tst_qlibrary X-Git-Tag: qt-v5.0.0-alpha1~2519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab79c7c092079ee7b3949a7b5ad7ea2faccb1659;p=profile%2Fivi%2Fqtbase.git Improved failure messages from tst_qlibrary Use QVERIFY2 to include errorString() in the failure message. Change-Id: Iecb4e7694c3d71bfb786908a6a6c26b187d60c8f Reviewed-by: Jason McDonald --- diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index c3fe27d..97e38ff 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -193,13 +193,12 @@ void tst_QLibrary::version() #if !defined(Q_OS_AIX) && !defined(Q_OS_WIN) QString currDir = QDir::currentPath(); QLibrary library( currDir + QLatin1Char('/') + lib, loadversion ); - bool ok = library.load(); - QVERIFY(ok); + QVERIFY2(library.load(), qPrintable(library.errorString())); VersionFunction fnVersion = (VersionFunction)library.resolve("mylibversion"); QVERIFY(fnVersion); QCOMPARE(fnVersion(), resultversion); - QVERIFY(library.unload()); + QVERIFY2(library.unload(), qPrintable(library.errorString())); #else Q_UNUSED(lib); Q_UNUSED(loadversion); @@ -241,8 +240,8 @@ void tst_QLibrary::load() QLibrary library( lib ); bool ok = library.load(); if ( result ) { - QVERIFY( ok ); - QVERIFY(library.unload()); + QVERIFY2( ok, qPrintable(library.errorString()) ); + QVERIFY2( library.unload(), qPrintable(library.errorString()) ); } else { QVERIFY( !ok ); } @@ -272,7 +271,7 @@ void tst_QLibrary::unload() library.load(); bool ok = library.unload(); if ( result ) { - QVERIFY( ok ); + QVERIFY2( ok, qPrintable(library.errorString()) ); } else { QVERIFY( !ok ); }