From d91bf00c43736940e4139357e288df6432775a3d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 8 Jun 2016 12:06:29 +0200 Subject: tst_QFileSystemModel::specialFiles(): Remove Windows parts The test created a Windows shortcut (.lnk) and checked on its existence. It was not found in the first test since QFileSystemModel returned the resolved file name (linktarget.txt). When fixing this by querying QFileSystemModel::fileInfo()::fileName(), the 2nd test failed since shortcut files are not considered system files. Amends change 3b093034b638a69b4dc91212d1743638864a1337. Task-number: QTBUG-53890 Task-number: QTBUG-20968 Task-number: QTBUG-29403 Change-Id: Iec58b52532b44d12759eaa6c8d63a8a4dc8d1bc3 Reviewed-by: Joerg Bornemann --- .../dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index af92f0735d..cb0f0b040a 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -1097,6 +1097,10 @@ static QSet fileListUnderIndex(const QFileSystemModel *model, const QMo void tst_QFileSystemModel::specialFiles() { +#ifndef Q_OS_UNIX + QSKIP("Not implemented"); +#endif + QFileSystemModel model; model.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden); @@ -1105,23 +1109,8 @@ void tst_QFileSystemModel::specialFiles() // as it will always return a valid index for existing files, // even if the file is not visible with the given filter. -#if defined(Q_OS_UNIX) const QModelIndex rootIndex = model.setRootPath(QStringLiteral("/dev/")); const QString testFileName = QStringLiteral("null"); -#elif defined(Q_OS_WIN) - const QModelIndex rootIndex = model.setRootPath(flatDirTestPath); - - const QString testFileName = QStringLiteral("linkSource.lnk"); - - QFile file(flatDirTestPath + QLatin1String("/linkTarget.txt")); - QVERIFY(file.open(QIODevice::WriteOnly)); - file.close(); - QVERIFY(file.link(flatDirTestPath + '/' + testFileName)); -#else - QSKIP("Not implemented"); - QModelIndex rootIndex; - QString testFileName; -#endif QTRY_VERIFY(fileListUnderIndex(&model, rootIndex).contains(testFileName)); -- cgit v1.2.3