summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2009-08-11 18:11:27 +0200
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 18:21:30 +0200
commitf36fb8b2b63b3734cc2bd66b329ca4fef1204845 (patch)
tree18f7dd3fa9d7a88abdac58d5ac3afe9773eb80f3 /tests
parent7fe0dfb80efd67886a33fe8b37e9714175925688 (diff)
'.' and '..' must not be hidden
_unix code always sets HiddenFlag for special dirs which is wrong; also there is some inconsistence under win: * FindFirstFile sets FILE_ATTRIBUTE_HIDDEN flag for ".." of hidden dir *even* if parent dir is not hidden; * GetFileAttributes sets FILE_ATTRIBUTE_HIDDEN flag for ".." *only* if parent dir is hidden. so, _win part sets HiddenFlag wrong too; finally, we never test parent dir's flags; futhermore hidden special dirs (dotAndDotDot) makes dir iterator's filtering a bit more complex Merge-request: 1176 Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index e2800e564..fa2bd6e7d 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -974,9 +974,22 @@ void tst_QFileInfo::isHidden_data()
foreach (const QFileInfo& info, QDir::drives()) {
QTest::newRow(qPrintable("drive." + info.path())) << info.path() << false;
}
+
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ QTest::newRow("C:/RECYCLER") << QString::fromLatin1("C:/RECYCLER") << true;
+ QTest::newRow("C:/RECYCLER/.") << QString::fromLatin1("C:/RECYCLER/.") << false;
+ QTest::newRow("C:/RECYCLER/..") << QString::fromLatin1("C:/RECYCLER/..") << false;
+#endif
+#if defined(Q_OS_UNIX)
+ QTest::newRow("~/.qt") << QDir::homePath() + QString("/.qt") << true;
+ QTest::newRow("~/.qt/.") << QDir::homePath() + QString("/.qt/.") << false;
+ QTest::newRow("~/.qt/..") << QDir::homePath() + QString("/.qt/..") << false;
+#endif
+
#if !defined(Q_OS_WIN)
QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false;
#endif
+
#ifdef Q_OS_MAC
QTest::newRow("mac_etc") << QString::fromLatin1("/etc") << true;
QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false;