diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-09-30 13:28:50 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-09-30 17:27:58 +0000 |
commit | 0bc3983b8a9b7222c0a85e661919ff2f2e8f958a (patch) | |
tree | 79eea7588ef88d52e8d451761d16b3fe7b93d6ef /tests/auto/widgets/dialogs | |
parent | 32f957ccc68084fe11fcf23823c5094a1833a790 (diff) |
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 <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r-- | tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<QFileSystemModel*>("qt_filesystem_model"); QVERIFY(model); |