summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp1
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/main.cpp14
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index af2578ac37..d2171cc64a 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -438,6 +438,7 @@ void tst_QFileInfo::exists()
QFileInfo fi(path);
QCOMPARE(fi.exists(), expected);
+ QCOMPARE(QFileInfo::exists(path), expected);
}
void tst_QFileInfo::absolutePath_data()
diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
index 2e63795978..594e5b7478 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp
+++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
@@ -52,6 +52,8 @@ class qfileinfo : public QObject
{
Q_OBJECT
private slots:
+ void existsTemporary();
+ void existsStatic();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void symLinkTargetPerformanceLNK();
void symLinkTargetPerformanceMounpoint();
@@ -70,6 +72,18 @@ void qfileinfo::cleanupTestCase()
{
}
+void qfileinfo::existsTemporary()
+{
+ QString appPath = QCoreApplication::applicationFilePath();
+ QBENCHMARK { QFileInfo(appPath).exists(); }
+}
+
+void qfileinfo::existsStatic()
+{
+ QString appPath = QCoreApplication::applicationFilePath();
+ QBENCHMARK { QFileInfo::exists(appPath); }
+}
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void qfileinfo::symLinkTargetPerformanceLNK()
{