summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib')
-rw-r--r--tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qmap/main.cpp15
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index 1d47d98657..8f8e8300a1 100644
--- a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -30,7 +30,7 @@
#include <QtTest/QtTest>
#include <QtCore/private/qmemory_p.h>
#include <mutex>
-#if QT_HAS_INCLUDE(<shared_mutex>)
+#if __has_include(<shared_mutex>)
#if __cplusplus > 201103L
#include <shared_mutex>
#endif
diff --git a/tests/benchmarks/corelib/tools/qmap/main.cpp b/tests/benchmarks/corelib/tools/qmap/main.cpp
index ce415212e4..50cc853df6 100644
--- a/tests/benchmarks/corelib/tools/qmap/main.cpp
+++ b/tests/benchmarks/corelib/tools/qmap/main.cpp
@@ -59,6 +59,8 @@ private slots:
void insertion_string_int2();
void insertion_string_int2_hint();
+
+ void insertMap();
};
@@ -269,6 +271,19 @@ void tst_QMap::insertion_string_int2_hint()
}
}
+void tst_QMap::insertMap()
+{
+ QMap<int, int> map;
+ for (int i = 0; i < 100000; ++i)
+ map.insert(i * 4, 0);
+ QMap<int, int> map2;
+ for (int i = 0; i < 50000; ++i)
+ map2.insert(i * 7, 0);
+ QBENCHMARK_ONCE {
+ map.insert(map2);
+ }
+}
+
QTEST_MAIN(tst_QMap)
#include "main.moc"