summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qfsfileengine_p.h2
-rw-r--r--tests/benchmarks/qfileinfo/main.cpp8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index 87f0737..41a6a1b 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
#define Q_USE_DEPRECATED_MAP_API 1
#endif
-class QFSFileEnginePrivate : public QAbstractFileEnginePrivate
+class Q_AUTOTEST_EXPORT QFSFileEnginePrivate : public QAbstractFileEnginePrivate
{
Q_DECLARE_PUBLIC(QFSFileEngine)
diff --git a/tests/benchmarks/qfileinfo/main.cpp b/tests/benchmarks/qfileinfo/main.cpp
index 7950f58..711209c 100644
--- a/tests/benchmarks/qfileinfo/main.cpp
+++ b/tests/benchmarks/qfileinfo/main.cpp
@@ -44,6 +44,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
+#include "private/qfsfileengine_p.h"
class qfileinfo : public QObject
{
@@ -67,11 +68,12 @@ void qfileinfo::cleanupTestCase()
void qfileinfo::canonicalFileNamePerformance()
{
+ QString appPath = QCoreApplication::applicationFilePath();
+ QFSFileEnginePrivate::canonicalized(appPath); // warmup
+ QFSFileEnginePrivate::canonicalized(appPath); // more warmup
QBENCHMARK {
for (int i = 0; i < 5000; i++) {
- // this actually calls canonicalFilePath twice, once inside QCoreApplication.
- QFileInfo fi(QCoreApplication::applicationFilePath());
- fi.canonicalFilePath();
+ QFSFileEnginePrivate::canonicalized(appPath);
}
}
}