summaryrefslogtreecommitdiffstats
path: root/tests/shared
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-09-15 16:48:39 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-09-15 17:12:02 (GMT)
commit5e2fc1468572098cd02df25061f277b60e9b35bd (patch)
tree7ed21f976fa5a149f0011b40d2ee0a342f2b6083 /tests/shared
parent6bc165d0fbbc4704d87e59cc0795dc2769228dc3 (diff)
downloadQt-5e2fc1468572098cd02df25061f277b60e9b35bd.zip
Qt-5e2fc1468572098cd02df25061f277b60e9b35bd.tar.gz
Qt-5e2fc1468572098cd02df25061f277b60e9b35bd.tar.bz2
Integrate media use case performance tests to qdir tree benchmarks
These tests measure the performance of QDirIterator across: - 1000 files in one directory (based on photos) - 1000 files as 100 directories each with 10 files (based on music albums) The test counts and totals the sizes of files, to make sure this isn't causing unwanted filesystem accesses. Reviewed-By: joao
Diffstat (limited to 'tests/shared')
-rw-r--r--tests/shared/filesystem.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h
index 079a6dc..8274346 100644
--- a/tests/shared/filesystem.h
+++ b/tests/shared/filesystem.h
@@ -87,6 +87,16 @@ struct FileSystem
return false;
}
+ qint64 createFileWithContent(const QString &fileName)
+ {
+ QFile file(fileName);
+ if (file.open(QIODevice::WriteOnly)) {
+ createdFiles << fileName;
+ return file.write(fileName.toUtf8());
+ }
+ return -1;
+ }
+
bool createLink(const QString &destination, const QString &linkName)
{
if (QFile::link(destination, linkName)) {