summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-28 20:53:04 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-28 20:53:04 (GMT)
commit26205fb25ed41b62484fed28b6a66543050f349c (patch)
treeb1da1c66b2b8caf80cd8b01b8438860092ca352a /tests/benchmarks/corelib
parent576cb12c36f24917d674f4c0bf240441b4ac9b43 (diff)
parent47f9469f825141a346592f14d5e7db12da7fa307 (diff)
downloadQt-26205fb25ed41b62484fed28b6a66543050f349c.zip
Qt-26205fb25ed41b62484fed28b6a66543050f349c.tar.gz
Qt-26205fb25ed41b62484fed28b6a66543050f349c.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix a small typo in setColor description (brush -> color) Unable to load plugin DLLs compiled with the '/clr' option Remove legacy macros. Repositioned _WIN32_WINNT define in tst_qfileinfo and tst_qdir tst_networkselftest: fix building on Windows Assistant: Fix line endings. Assistant: Fix license headers. Fix for missing wchar_t pointer casts in filesystem.h Assistant: Don't display close button when it's not functional. Assistant: Fix some merge artifacts. Use GetProcAddress for GetVolumePathNamesForVolumeNameW Fix for missing wchar_t pointer cast in qfsfileengine_win.cpp Added support for symlinks and junction points on Windows Assistant: Get rid of tabs. Assistant: Move search widget into the dock area.
Diffstat (limited to 'tests/benchmarks/corelib')
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/main.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
index 025787f..b272bda 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp
+++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
@@ -43,15 +43,20 @@
#include <QtTest/QtTest>
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
+#include <QtCore/QFile>
#include "private/qfsfileengine_p.h"
+#include "../../../../shared/filesystem.h"
class qfileinfo : public QObject
{
Q_OBJECT
private slots:
void canonicalFileNamePerformance();
-
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ void symLinkTargetPerformanceLNK();
+ void symLinkTargetPerformanceMounpoint();
+#endif
void initTestCase();
void cleanupTestCase();
public:
@@ -78,6 +83,43 @@ void qfileinfo::canonicalFileNamePerformance()
}
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+void qfileinfo::symLinkTargetPerformanceLNK()
+{
+ QVERIFY(QFile::link("file","link.lnk"));
+ QFileInfo info("link.lnk");
+ info.setCaching(false);
+ QVERIFY(info.isSymLink());
+ QString linkTarget;
+ QBENCHMARK {
+ for(int i=0; i<100; i++)
+ linkTarget = info.readLink();
+ }
+ QVERIFY(QFile::remove("link.lnk"));
+}
+
+void qfileinfo::symLinkTargetPerformanceMounpoint()
+{
+ wchar_t buffer[MAX_PATH];
+ QString rootPath = QDir::toNativeSeparators(QDir::rootPath());
+ QVERIFY(GetVolumeNameForVolumeMountPointW(rootPath.utf16(), buffer, MAX_PATH));
+ QString rootVolume = QString::fromWCharArray(buffer);
+ QString mountpoint = "mountpoint";
+ rootVolume.replace("\\\\?\\","\\??\\");
+ FileSystem::createNtfsJunction(rootVolume, mountpoint);
+
+ QFileInfo info(mountpoint);
+ info.setCaching(false);
+ QVERIFY(info.isSymLink());
+ QString linkTarget;
+ QBENCHMARK {
+ for(int i=0; i<100; i++)
+ linkTarget = info.readLink();
+ }
+ QVERIFY(QDir().rmdir(mountpoint));
+}
+#endif
+
QTEST_MAIN(qfileinfo)
#include "main.moc"