summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-19 12:09:31 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-19 12:32:01 (GMT)
commit80f69e2d2501c9958068c305ccd909aa034334d9 (patch)
treec422efc06379a0626392fb994123680734f240cd /tests
parentbd593fa64efebbe6608631ec9c08290414389c16 (diff)
downloadQt-80f69e2d2501c9958068c305ccd909aa034334d9.zip
Qt-80f69e2d2501c9958068c305ccd909aa034334d9.tar.gz
Qt-80f69e2d2501c9958068c305ccd909aa034334d9.tar.bz2
[tst_qdiriterator] Stop removing files from the repository.
Fixes issue introduced by 21e0423a5c9ecd9da8e141dcfba25e60b55f7fe5. Reviewed-By: João Abecasis
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp
index c1db8f2..1a873b8 100644
--- a/tests/auto/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp
@@ -85,11 +85,13 @@ private: // convenience functions
return false;
}
- bool createFile(const QString &fileName)
+ enum Cleanup { DoDelete, DontDelete };
+ bool createFile(const QString &fileName, Cleanup cleanup = DoDelete)
{
QFile file(fileName);
if (file.open(QIODevice::WriteOnly)) {
- createdFiles << fileName;
+ if (cleanup == DoDelete)
+ createdFiles << fileName;
return true;
}
return false;
@@ -131,9 +133,9 @@ tst_QDirIterator::tst_QDirIterator()
createDirectory("entrylist");
createDirectory("entrylist/directory");
- createFile("entrylist/file");
+ createFile("entrylist/file", DontDelete);
createFile("entrylist/writable");
- createFile("entrylist/directory/dummy");
+ createFile("entrylist/directory/dummy", DontDelete);
createDirectory("recursiveDirs");
createDirectory("recursiveDirs/dir1");