From 0bc3983b8a9b7222c0a85e661919ff2f2e8f958a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Sep 2015 13:28:50 +0200 Subject: Improve messages in tst_qdir/tst_fileinfo/tst_qfiledialog2. Introduce error messages showing the path in file existence, file type and directory entry list tests to make fails related to missing UNC shares clearer. Task-number: QTBUG-48504 Change-Id: I5fb401b94cfa8b58562a906b8d9765039e334027 Reviewed-by: Joerg Bornemann --- tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/auto/widgets/dialogs/qfiledialog2') diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index ed44a5d503..d48c718d4d 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -81,6 +81,12 @@ public: } }; +static QByteArray msgDoesNotExist(const QString &name) +{ + return (QLatin1Char('"') + QDir::toNativeSeparators(name) + + QLatin1String("\" does not exist.")).toLocal8Bit(); +} + class tst_QFileDialog2 : public QObject { Q_OBJECT @@ -307,7 +313,7 @@ void tst_QFileDialog2::unc() #else QString dir(QDir::currentPath()); #endif - QVERIFY(QFile::exists(dir)); + QVERIFY2(QFile::exists(dir), msgDoesNotExist(dir).constData()); QNonNativeFileDialog fd(0, QString(), dir); QFileSystemModel *model = fd.findChild("qt_filesystem_model"); QVERIFY(model); -- cgit v1.2.3