summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2018-09-25 21:49:05 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2018-09-29 14:22:18 +0000
commit09e926cc278d8572bfd107424af2d4d482ac73ae (patch)
treeb1cd322dc3f61df6f2d1b6441d506a2edd0fdf93 /tests
parent0e1866017fd389629629b150ce252820592506cd (diff)
Use a std::vector instead of a QVector in QMimeDatabasePrivate
Using std::vector saves a bit c++ code when using range-for loop over the vector. Besides, no shared copies created anymore which is a bit faster. Change-Id: I564306ed9ac907e9f32f59b33ed15c027a59b4eb Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp b/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp
index 704119b921..1b432f3b3e 100644
--- a/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp
+++ b/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp
@@ -35,6 +35,7 @@ class tst_QMimeDatabase: public QObject
private slots:
void inheritsPerformance();
+ void benchMimeTypeForName();
};
void tst_QMimeDatabase::inheritsPerformance()
@@ -70,5 +71,15 @@ void tst_QMimeDatabase::inheritsPerformance()
// parsing XML, and then keeps being around 4.5 MB for all the in-memory hashes.
}
+void tst_QMimeDatabase::benchMimeTypeForName()
+{
+ QMimeDatabase db;
+
+ QBENCHMARK {
+ const auto s = db.mimeTypeForName(QStringLiteral("text/plain"));
+ QVERIFY(s.isValid());
+ }
+}
+
QTEST_MAIN(tst_QMimeDatabase)
#include "main.moc"