summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdiriterator
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-10-06 10:46:16 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-10-07 13:36:04 (GMT)
commitc509f556628fa73192604869b3f1135af5e447ca (patch)
tree2440b05ff358af6346514fb07e5f924bc5bc0bd5 /tests/auto/qdiriterator
parent3f8476b9d7dc6bf45db5c3e959d7bc045099cd08 (diff)
downloadQt-c509f556628fa73192604869b3f1135af5e447ca.zip
Qt-c509f556628fa73192604869b3f1135af5e447ca.tar.gz
Qt-c509f556628fa73192604869b3f1135af5e447ca.tar.bz2
Add test case for enumerating an empty directory
Reviewed-By: Thomas Zander
Diffstat (limited to 'tests/auto/qdiriterator')
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp
index d93e91e..3a696b5 100644
--- a/tests/auto/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp
@@ -155,6 +155,8 @@ tst_QDirIterator::tst_QDirIterator()
createDirectory("foo/bar");
createFile("foo/bar/readme.txt");
+ createDirectory("empty");
+
#ifndef Q_NO_SYMLINKS
# if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
// ### Sadly, this is a platform difference right now.
@@ -296,6 +298,20 @@ void tst_QDirIterator::iterateRelativeDirectory_data()
#endif
"entrylist/directory/dummy,"
"entrylist/writable").split(',');
+
+ QTest::newRow("empty, default")
+ << QString("empty") << QDirIterator::IteratorFlags(0)
+ << QDir::Filters(QDir::NoFilter) << QStringList("*")
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
+ << QStringList();
+#else
+ << QString("empty/.,empty/..").split(',');
+#endif
+
+ QTest::newRow("empty, QDir::NoDotAndDotDot")
+ << QString("empty") << QDirIterator::IteratorFlags(0)
+ << QDir::Filters(QDir::NoDotAndDotDot) << QStringList("*")
+ << QStringList();
}
void tst_QDirIterator::iterateRelativeDirectory()