summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdiriterator
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-09-14 11:01:29 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-09-14 16:37:30 (GMT)
commit0299d30d5aa35d532df6bc018afc52df263651a0 (patch)
tree371617428eb049b1e67ce08f58fdb0e2c5333bb4 /tests/auto/qdiriterator
parentf2dbebdab183dfe5d18ab7a8fbd85983401dfa3c (diff)
downloadQt-0299d30d5aa35d532df6bc018afc52df263651a0.zip
Qt-0299d30d5aa35d532df6bc018afc52df263651a0.tar.gz
Qt-0299d30d5aa35d532df6bc018afc52df263651a0.tar.bz2
Test QDirIterator using UNC paths on Windows.
Adding the test tst_QDirIterator::uncPaths(). Currently this traverses the shares & folders in test-server for all entries except '.' & '..' Reviewed-by: Denis
Diffstat (limited to 'tests/auto/qdiriterator')
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp
index f78ce34..d93e91e 100644
--- a/tests/auto/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp
@@ -57,6 +57,10 @@
#define Q_NO_SYMLINKS_TO_DIRS
#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#include "../network-settings.h"
+#endif
+
Q_DECLARE_METATYPE(QDirIterator::IteratorFlags)
Q_DECLARE_METATYPE(QDir::Filters)
@@ -118,6 +122,10 @@ private slots:
void longPath();
void task185502_dirorder();
void relativePaths();
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ void uncPaths_data();
+ void uncPaths();
+#endif
};
tst_QDirIterator::tst_QDirIterator()
@@ -532,6 +540,28 @@ void tst_QDirIterator::relativePaths()
}
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+void tst_QDirIterator::uncPaths_data()
+{
+ QTest::addColumn<QString>("dirName");
+ QTest::newRow("uncserver")
+ <<QString("//" + QtNetworkSettings::winServerName());
+ QTest::newRow("uncserver/testshare")
+ <<QString("//" + QtNetworkSettings::winServerName() + "/testshare");
+ QTest::newRow("uncserver/testshare/tmp")
+ <<QString("//" + QtNetworkSettings::winServerName() + "/testshare/tmp");
+}
+void tst_QDirIterator::uncPaths()
+{
+ QFETCH(QString, dirName);
+ QDirIterator iterator(dirName, QDir::AllEntries|QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
+ while(iterator.hasNext()) {
+ iterator.next();
+ QCOMPARE(iterator.filePath(), QDir::cleanPath(iterator.filePath()));
+ }
+}
+#endif
+
QTEST_MAIN(tst_QDirIterator)
#include "tst_qdiriterator.moc"