diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-11-24 15:01:49 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-28 08:13:41 +0100 |
commit | ab79c7c092079ee7b3949a7b5ad7ea2faccb1659 (patch) | |
tree | 75adf6bfac594785f85e0e6d894c19289eca1503 /tests/auto | |
parent | e15548d3e49a8937856c78d8e6c1133d46df57ee (diff) |
Improved failure messages from tst_qlibrary
Use QVERIFY2 to include errorString() in the failure message.
Change-Id: Iecb4e7694c3d71bfb786908a6a6c26b187d60c8f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index c3fe27dddf..97e38ff2ef 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 ); } |