summaryrefslogtreecommitdiffstats
path: root/tests/auto/headers
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-12-21 22:48:40 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-12-21 22:50:20 (GMT)
commitafa22a20c1b89960b647b0e3a9dc390fe6f87eae (patch)
treed1a5d7b568a99e68275197d43f2044b1428a7377 /tests/auto/headers
parente753230a048097e6d041ec1ff9d632c4b3b0322b (diff)
downloadQt-afa22a20c1b89960b647b0e3a9dc390fe6f87eae.zip
Qt-afa22a20c1b89960b647b0e3a9dc390fe6f87eae.tar.gz
Qt-afa22a20c1b89960b647b0e3a9dc390fe6f87eae.tar.bz2
tst_headers: make failure more detailed when failing to open a file
Replace QVERIFY(f.open(...)) with QVERIFY2(f.open(...), qPrintable(f.errorString())) This pattern should be followed for all functions which can provide an error string on failure.
Diffstat (limited to 'tests/auto/headers')
-rw-r--r--tests/auto/headers/tst_headers.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp
index 7ccf058..8c8bc2c 100644
--- a/tests/auto/headers/tst_headers.cpp
+++ b/tests/auto/headers/tst_headers.cpp
@@ -203,7 +203,7 @@ void tst_Headers::licenseCheck()
QFETCH(QString, sourceFile);
QFile f(sourceFile);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QByteArray data = f.readAll();
data.replace("\r\n", "\n"); // Windows
data.replace('\r', '\n'); // Mac OS9
@@ -264,7 +264,7 @@ void tst_Headers::privateSlots()
return;
QFile f(header);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QStringList content = QString::fromLocal8Bit(f.readAll()).split("\n");
foreach (QString line, content) {
@@ -286,7 +286,7 @@ void tst_Headers::macros()
return;
QFile f(header);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString()));
QByteArray data = f.readAll();
QStringList content = QString::fromLocal8Bit(data.replace('\r', "")).split("\n");