diff options
Diffstat (limited to 'tests/benchmarks')
216 files changed, 1187 insertions, 354 deletions
diff --git a/tests/benchmarks/corelib/CMakeLists.txt b/tests/benchmarks/corelib/CMakeLists.txt index ea00b02c61..890cbcfc6b 100644 --- a/tests/benchmarks/corelib/CMakeLists.txt +++ b/tests/benchmarks/corelib/CMakeLists.txt @@ -4,10 +4,13 @@ add_subdirectory(io) add_subdirectory(itemmodels) add_subdirectory(json) -add_subdirectory(mimetypes) +if(QT_FEATURE_mimetype) + add_subdirectory(mimetypes) +endif() add_subdirectory(kernel) add_subdirectory(text) add_subdirectory(thread) add_subdirectory(time) add_subdirectory(tools) add_subdirectory(plugin) +add_subdirectory(serialization) diff --git a/tests/benchmarks/corelib/io/qdir/10000/tst_bench_qdir_10000.cpp b/tests/benchmarks/corelib/io/qdir/10000/tst_bench_qdir_10000.cpp index 80dbc0f141..a53742b536 100644 --- a/tests/benchmarks/corelib/io/qdir/10000/tst_bench_qdir_10000.cpp +++ b/tests/benchmarks/corelib/io/qdir/10000/tst_bench_qdir_10000.cpp @@ -1,5 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses #include <QTest> #include <QDirIterator> diff --git a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt index f1800fc0cd..00991de9a9 100644 --- a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt @@ -1,2 +1,4 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause add_subdirectory(10000) add_subdirectory(tree) diff --git a/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt b/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt index ee5f7eabc1..6f1a208fe0 100644 --- a/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt +++ b/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt @@ -7983,8 +7983,6 @@ qeventloop.cpp qeventloop.h qfunctions_p.h - qfunctions_vxworks.cpp - qfunctions_vxworks.h qfunctions_wince.cpp qfunctions_wince.h qguard_p.h diff --git a/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.cpp b/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.cpp index 773f17a35a..4f122c876c 100644 --- a/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.cpp +++ b/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtTest/QTest> diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp index d13017f108..16b64cf362 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only /*! \since 4.5 diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h index 5b39d7326c..479ce7b392 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h +++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef QFILESYSTEMITERATOR_H #define QFILESYSTEMITERATOR_H diff --git a/tests/benchmarks/corelib/io/qdiriterator/tst_bench_qdiriterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/tst_bench_qdiriterator.cpp index c1826e99e4..66448bf838 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/tst_bench_qdiriterator.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/tst_bench_qdiriterator.cpp @@ -1,7 +1,8 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QDirIterator> +#include <QDirListing> #include <QString> #include <qplatformdefs.h> @@ -23,16 +24,30 @@ #include <filesystem> #endif +using namespace Qt::StringLiterals; + +constexpr bool forceStat = false; + class tst_QDirIterator : public QObject { Q_OBJECT void data(); + + const QDir::Filters dirFilters = + // QDir::AllEntries | QDir::Hidden | QDir::NoDotAndDotDot + QDir::AllEntries | QDir::Hidden + //QDir::Files | QDir::NoDotAndDotDot, + // QDir::Files, + ; + private slots: void posix(); void posix_data() { data(); } void diriterator(); void diriterator_data() { data(); } + void dirlisting(); + void dirlisting_data() { data(); } void fsiterator(); void fsiterator_data() { data(); } void stdRecursiveDirectoryIterator(); @@ -118,9 +133,20 @@ static int posix_helper(const char *dirpath) QByteArray ba = dirpath; ba += '/'; ba += entry->d_name; + bool isDir = false; +#if defined(_DIRENT_HAVE_D_TYPE) || defined(Q_OS_BSD4) + isDir = entry->d_type == DT_DIR; + if (forceStat) { + QT_STATBUF st; + QT_LSTAT(ba.constData(), &st); + } +#else // d_type not available >>> must stat() to see if it's a dir QT_STATBUF st; QT_LSTAT(ba.constData(), &st); - if (S_ISDIR(st.st_mode)) + isDir = S_ISDIR(st.st_mode); +#endif + + if (isDir) count += posix_helper(ba.constData()); } @@ -157,14 +183,12 @@ void tst_QDirIterator::diriterator() QBENCHMARK { int c = 0; - QDirIterator dir(dirpath, - //QDir::AllEntries | QDir::Hidden | QDir::NoDotAndDotDot, - //QDir::AllEntries | QDir::Hidden, - QDir::Files, - QDirIterator::Subdirectories); + QDirIterator dir(dirpath, dirFilters, QDirIterator::Subdirectories); while (dir.hasNext()) { const auto fi = dir.nextFileInfo(); + if (forceStat) + fi.size(); //printf("%s\n", qPrintable(dir.fileName())); 0 && printf("%d %s\n", fi.isDir(), @@ -178,6 +202,28 @@ void tst_QDirIterator::diriterator() qDebug() << count; } +void tst_QDirIterator::dirlisting() +{ + QFETCH(QByteArray, dirpath); + + int count = 0; + + QBENCHMARK { + int c = 0; + + QDirListing dir(dirpath, dirFilters, QDirListing::IteratorFlag::Recursive); + + for (const auto &dirEntry : dir) { + const auto path = dirEntry.filePath(); + if (forceStat) + dirEntry.size(); + ++c; + } + count = c; + } + qDebug() << count; +} + void tst_QDirIterator::fsiterator() { QFETCH(QByteArray, dirpath); @@ -189,14 +235,12 @@ void tst_QDirIterator::fsiterator() int c = 0; dump && printf("\n\n\n\n"); - QDirIteratorTest::QFileSystemIterator dir(dirpath, - //QDir::AllEntries | QDir::Hidden | QDir::NoDotAndDotDot, - //QDir::AllEntries | QDir::Hidden, - //QDir::Files | QDir::NoDotAndDotDot, - QDir::Files, - QDirIteratorTest::QFileSystemIterator::Subdirectories); + QDirIteratorTest::QFileSystemIterator dir( + dirpath, dirFilters, QDirIteratorTest::QFileSystemIterator::Subdirectories); for (; !dir.atEnd(); dir.next()) { + if (forceStat) + dir.fileInfo().size(); dump && printf("%d %s\n", dir.fileInfo().isDir(), //qPrintable(dir.fileInfo().absoluteFilePath()), @@ -217,10 +261,16 @@ void tst_QDirIterator::stdRecursiveDirectoryIterator() int count = 0; + namespace fs = std::filesystem; + std::error_code ec; + + // Note that fs::recursive_directory_iterator may be calling stat() internally, + // that depends on the implementation. So the benchmark times might "seem" higher + // than the other methods in this source file. QBENCHMARK { int c = 0; - for (auto obj : std::filesystem::recursive_directory_iterator(dirpath.data())) { - if (obj.is_directory()) + for (const auto &dirEntry : fs::recursive_directory_iterator(dirpath.data(), ec)) { + if (dirEntry.is_directory()) continue; c++; } diff --git a/tests/benchmarks/corelib/io/qfile/tst_bench_qfile.cpp b/tests/benchmarks/corelib/io/qfile/tst_bench_qfile.cpp index b7e32be259..b805726f5f 100644 --- a/tests/benchmarks/corelib/io/qfile/tst_bench_qfile.cpp +++ b/tests/benchmarks/corelib/io/qfile/tst_bench_qfile.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QTemporaryFile> diff --git a/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp b/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp index 4ef2cdad9c..2c626dde70 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp +++ b/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <qtest.h> #include <QTest> diff --git a/tests/benchmarks/corelib/io/qiodevice/tst_bench_qiodevice.cpp b/tests/benchmarks/corelib/io/qiodevice/tst_bench_qiodevice.cpp index b90fd4fbc5..cae90631ee 100644 --- a/tests/benchmarks/corelib/io/qiodevice/tst_bench_qiodevice.cpp +++ b/tests/benchmarks/corelib/io/qiodevice/tst_bench_qiodevice.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QIODevice> #include <QFile> diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/loopback.cpp b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/loopback.cpp index be1bf53a35..1f47f6b0f1 100644 --- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/loopback.cpp +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/loopback.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <stdio.h> diff --git a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp index 424ff88048..9cf87a6653 100644 --- a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp +++ b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QSignalSpy> diff --git a/tests/benchmarks/corelib/io/qtemporaryfile/tst_bench_qtemporaryfile.cpp b/tests/benchmarks/corelib/io/qtemporaryfile/tst_bench_qtemporaryfile.cpp index fe7a8be79e..c72b525827 100644 --- a/tests/benchmarks/corelib/io/qtemporaryfile/tst_bench_qtemporaryfile.cpp +++ b/tests/benchmarks/corelib/io/qtemporaryfile/tst_bench_qtemporaryfile.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QIODevice> #include <QFile> diff --git a/tests/benchmarks/corelib/io/qtextstream/tst_bench_qtextstream.cpp b/tests/benchmarks/corelib/io/qtextstream/tst_bench_qtextstream.cpp index 3d281c5615..74552b85cf 100644 --- a/tests/benchmarks/corelib/io/qtextstream/tst_bench_qtextstream.cpp +++ b/tests/benchmarks/corelib/io/qtextstream/tst_bench_qtextstream.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2014 David Faure <david.faure@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QIODevice> diff --git a/tests/benchmarks/corelib/io/qurl/tst_bench_qurl.cpp b/tests/benchmarks/corelib/io/qurl/tst_bench_qurl.cpp index b0e0941001..87c4f51816 100644 --- a/tests/benchmarks/corelib/io/qurl/tst_bench_qurl.cpp +++ b/tests/benchmarks/corelib/io/qurl/tst_bench_qurl.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qurl.h> #include <qtest.h> diff --git a/tests/benchmarks/corelib/itemmodels/CMakeLists.txt b/tests/benchmarks/corelib/itemmodels/CMakeLists.txt index c74f36709c..8dc331aee2 100644 --- a/tests/benchmarks/corelib/itemmodels/CMakeLists.txt +++ b/tests/benchmarks/corelib/itemmodels/CMakeLists.txt @@ -1 +1,6 @@ -add_subdirectory(qsortfilterproxymodel) +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(QT_FEATURE_proxymodel) + add_subdirectory(qsortfilterproxymodel) +endif() diff --git a/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_bench_qsortfilterproxymodel.cpp b/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_bench_qsortfilterproxymodel.cpp index 42017a30ec..0411972ce3 100644 --- a/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_bench_qsortfilterproxymodel.cpp +++ b/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_bench_qsortfilterproxymodel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 Igor Kushnir <igorkuo@gmail.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QSortFilterProxyModel> #include <QString> diff --git a/tests/benchmarks/corelib/json/tst_bench_qtjson.cpp b/tests/benchmarks/corelib/json/tst_bench_qtjson.cpp index 199bef8595..2202b9a576 100644 --- a/tests/benchmarks/corelib/json/tst_bench_qtjson.cpp +++ b/tests/benchmarks/corelib/json/tst_bench_qtjson.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QVariantMap> diff --git a/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp b/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp index b6fa503d1d..17eb838af2 100644 --- a/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp +++ b/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <qtest.h> diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp b/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp index 044acee366..d2ff489784 100644 --- a/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp +++ b/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2011 Robin Burchell <robin+qt@viroteck.net> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <qtest.h> #include <qcoreapplication.h> @@ -10,6 +10,9 @@ Q_OBJECT private slots: void event_posting_benchmark_data(); void event_posting_benchmark(); + + void event_posting_multiple_objects_benchmark_data(); + void event_posting_multiple_objects_benchmark(); }; void tst_QCoreApplication::event_posting_benchmark_data() @@ -39,6 +42,29 @@ void tst_QCoreApplication::event_posting_benchmark() } } +void tst_QCoreApplication::event_posting_multiple_objects_benchmark_data() +{ + event_posting_benchmark_data(); +} + +void tst_QCoreApplication::event_posting_multiple_objects_benchmark() +{ + QFETCH(int, size); + + QObject objects[15]; // The size of the array has not been chosen through any meaningful means + + QRandomGenerator gen; + + // benchmark posting & sending events + QBENCHMARK { + for (int i = 0; i < size; ++i) { + QCoreApplication::postEvent(&objects[gen.bounded(0, int(std::size(objects)))], + new QTimerEvent(i % 10)); + } + QCoreApplication::sendPostedEvents(); + } +} + QTEST_MAIN(tst_QCoreApplication) #include "tst_bench_qcoreapplication.moc" diff --git a/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp b/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp index 3ebbe176d8..1a88c49993 100644 --- a/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp +++ b/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QMetaEnum> #include <QTest> diff --git a/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp index f539ec2692..6b02fb4ba4 100644 --- a/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp +++ b/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QtWidgets/QTreeView> #include <qtest.h> diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp index 95e7bc5dfd..94adfa4a8c 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp +++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore/qmetatype.h> diff --git a/tests/benchmarks/corelib/kernel/qobject/object.cpp b/tests/benchmarks/corelib/kernel/qobject/object.cpp index 049a1a1107..9e0fba2e98 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/object.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "object.h" void Object::emitSignal0() diff --git a/tests/benchmarks/corelib/kernel/qobject/object.h b/tests/benchmarks/corelib/kernel/qobject/object.h index 2f8bf7ca9f..72705f7f34 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.h +++ b/tests/benchmarks/corelib/kernel/qobject/object.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef OBJECT_H #define OBJECT_H diff --git a/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp index f3b3fc098a..99c15f6317 100644 --- a/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QtWidgets/QTreeView> #include <qtest.h> diff --git a/tests/benchmarks/corelib/kernel/qproperty/propertytester.h b/tests/benchmarks/corelib/kernel/qproperty/propertytester.h index f913395af6..a89d51c286 100644 --- a/tests/benchmarks/corelib/kernel/qproperty/propertytester.h +++ b/tests/benchmarks/corelib/kernel/qproperty/propertytester.h @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef PROPERTYTESTER_H #define PROPERTYTESTER_H diff --git a/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp index 2d57c4c51e..c91ca1ea11 100644 --- a/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp +++ b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QScopedPointer> #include <QProperty> diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp index d36ea17756..d0b3e21772 100644 --- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp +++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QTest> @@ -101,13 +101,9 @@ void qtimer_vs_qmetaobject::bench_data() void qtimer_vs_qmetaobject::benchBackgroundThread() { -#if !QT_CONFIG(cxx11_future) - QSKIP("This test requires QThread::create"); -#else QScopedPointer<QThread> thread(QThread::create([this]() { bench(); })); thread->start(); QVERIFY(thread->wait()); -#endif } QTEST_MAIN(qtimer_vs_qmetaobject) diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp index 157ec9b660..8b2e10c125 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp +++ b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #ifdef QT_GUI_LIB diff --git a/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp b/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp index 4cfd1247b5..b1f87eabed 100644 --- a/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp +++ b/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtCore/qglobal.h> diff --git a/tests/benchmarks/corelib/mimetypes/qmimedatabase/tst_bench_qmimedatabase.cpp b/tests/benchmarks/corelib/mimetypes/qmimedatabase/tst_bench_qmimedatabase.cpp index 0711dd9244..ffc65e7949 100644 --- a/tests/benchmarks/corelib/mimetypes/qmimedatabase/tst_bench_qmimedatabase.cpp +++ b/tests/benchmarks/corelib/mimetypes/qmimedatabase/tst_bench_qmimedatabase.cpp @@ -1,10 +1,12 @@ // Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2021 Igor Kushnir <igorkuo@gmail.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QMimeDatabase> +using namespace Qt::StringLiterals; + namespace { struct MatchModeInfo { @@ -51,26 +53,31 @@ void tst_QMimeDatabase::inheritsPerformance() { // Check performance of inherits(). // This benchmark (which started in 2009 in kmimetypetest.cpp) uses 40 mimetypes. - QStringList mimeTypes; - mimeTypes << QLatin1String("image/jpeg") << QLatin1String("image/png") << QLatin1String("image/tiff") << QLatin1String("text/plain") << QLatin1String("text/html"); - mimeTypes += mimeTypes; - mimeTypes += mimeTypes; - mimeTypes += mimeTypes; - QCOMPARE(mimeTypes.size(), 40); + // (eight groups of five unique ones) + const QString uniqueMimeTypes[] = { + u"image/jpeg"_s, + u"image/png"_s, + u"image/tiff"_s, + u"text/plain"_s, + u"text/html"_s, + }; + constexpr size_t NumOuterLoops = 40 / std::size(uniqueMimeTypes); QMimeDatabase db; - QMimeType mime = db.mimeTypeForName(QString::fromLatin1("text/x-chdr")); + const QMimeType mime = db.mimeTypeForName(u"text/x-chdr"_s); QVERIFY(mime.isValid()); + QString match; QBENCHMARK { - QString match; - foreach (const QString &mt, mimeTypes) { - if (mime.inherits(mt)) { - match = mt; - // of course there would normally be a "break" here, but we're testing worse-case - // performance here + for (size_t i = 0; i < NumOuterLoops; ++i) { + for (const QString &mt : uniqueMimeTypes) { + if (mime.inherits(mt)) { + match = mt; + // of course there would normally be a "break" here, but + // we're testing worse-case performance here + } } } - QCOMPARE(match, QString::fromLatin1("text/plain")); } + QCOMPARE(match, u"text/plain"_s); // Numbers from 2011, in release mode: // KDE 4.7 numbers: 0.21 msec / 494,000 ticks / 568,345 instr. loads per iteration // QMimeBinaryProvider (with Qt 5): 0.16 msec / NA / 416,049 instr. reads per iteration diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp index b21f66d9e9..7a6da7f84c 100644 --- a/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp +++ b/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/QCoreApplication> #include <QtCore/QUuid> diff --git a/tests/benchmarks/corelib/serialization/CMakeLists.txt b/tests/benchmarks/corelib/serialization/CMakeLists.txt new file mode 100644 index 0000000000..98343d7688 --- /dev/null +++ b/tests/benchmarks/corelib/serialization/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +add_subdirectory(qcborvalue) diff --git a/tests/benchmarks/corelib/serialization/qcborvalue/CMakeLists.txt b/tests/benchmarks/corelib/serialization/qcborvalue/CMakeLists.txt new file mode 100644 index 0000000000..6ada5b983d --- /dev/null +++ b/tests/benchmarks/corelib/serialization/qcborvalue/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_benchmark(tst_bench_qcborvalue + SOURCES + tst_bench_qcborvalue.cpp + LIBRARIES + Qt::Core + Qt::Test +) diff --git a/tests/benchmarks/corelib/serialization/qcborvalue/tst_bench_qcborvalue.cpp b/tests/benchmarks/corelib/serialization/qcborvalue/tst_bench_qcborvalue.cpp new file mode 100644 index 0000000000..b9978fa25c --- /dev/null +++ b/tests/benchmarks/corelib/serialization/qcborvalue/tst_bench_qcborvalue.cpp @@ -0,0 +1,95 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QCborMap> +#include <QCborValue> + +#include <QTest> + +template <typename Char> +struct SampleStrings +{ + static constexpr char key[] = "hello"; +}; + +template <> +struct SampleStrings<char16_t> +{ + static constexpr char16_t key[] = u"hello"; +}; + +template <> +struct SampleStrings<QChar> +{ + static const QChar *const key; +}; +const QChar *const SampleStrings<QChar>::key = + reinterpret_cast<const QChar *>(SampleStrings<char16_t>::key); + +template <typename T, typename = void> +constexpr bool hasValueType = false; + +template <typename T> +constexpr bool hasValueType<T, std::void_t<typename T::value_type>> = true; + +class tst_QCborValue : public QObject +{ + Q_OBJECT +private: + template <typename Type> + void doKeyLookup(); + + template <typename Type> + void doConstruct(); + +private slots: + void keyLookupLatin1() { doKeyLookup<QLatin1StringView>(); } + void keyLookupString() { doKeyLookup<QString>(); } + void keyLookupConstCharPtr() { doKeyLookup<char>(); }; + + void constructLatin1() { doConstruct<QLatin1StringView>(); } + void constructString() { doConstruct<QString>(); } + void constructStringView() { doConstruct<QStringView>(); } + void constructConstCharPtr() { doConstruct<char>(); } +}; + +template <typename Type> +void tst_QCborValue::doKeyLookup() +{ + const QCborMap m{{"hello", "world"}, {1, 2}}; + const QCborValue v = m; + + if constexpr (hasValueType<Type>) { + using Char = std::remove_cv_t<typename Type::value_type>; + using Strings = SampleStrings<Char>; + const Type s(Strings::key); + QBENCHMARK { + [[maybe_unused]] const QCborValue r = v[s]; + } + } else { + QBENCHMARK { + [[maybe_unused]] const QCborValue r = v[SampleStrings<Type>::key]; + } + } +} + +template<typename Type> +void tst_QCborValue::doConstruct() +{ + if constexpr (hasValueType<Type>) { + using Char = std::remove_cv_t<typename Type::value_type>; + using Strings = SampleStrings<Char>; + const Type s(Strings::key); + QBENCHMARK { + [[maybe_unused]] const auto v = QCborValue{s}; + } + } else { + QBENCHMARK { + [[maybe_unused]] const auto v = QCborValue{SampleStrings<Type>::key}; + } + } +} + +QTEST_MAIN(tst_QCborValue) + +#include "tst_bench_qcborvalue.moc" diff --git a/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp b/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp index 05e20645d7..a97cba7c50 100644 --- a/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp +++ b/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2016 Intel Corporation. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QIODevice> #include <QFile> @@ -31,6 +31,9 @@ private slots: void toPercentEncoding_data(); void toPercentEncoding(); + + void operator_assign_char(); + void operator_assign_char_data(); }; void tst_QByteArray::initTestCase() @@ -353,6 +356,38 @@ void tst_QByteArray::toPercentEncoding() QTEST(encoded, "expected"); } +void tst_QByteArray::operator_assign_char() +{ + QFETCH(QByteArray, data); + QString str(data.size(), Qt::Uninitialized); + + const char *tdata = data.constData(); + QBENCHMARK { + str.operator=(tdata); + } +} + +void tst_QByteArray::operator_assign_char_data() +{ + QTest::addColumn<QByteArray>("data"); + + QByteArray data; + data.fill('a', 5); + QTest::newRow("length: 5") << data; + data.fill('b', 10); + QTest::newRow("length: 10") << data; + data.fill('c', 20); + QTest::newRow("length: 20") << data; + data.fill('d', 50); + QTest::newRow("length: 50") << data; + data.fill('e', 100); + QTest::newRow("length: 100") << data; + data.fill('f', 500); + QTest::newRow("length: 500") << data; + data.fill('g', 1'000); + QTest::newRow("length: 1'000") << data; +} + QTEST_MAIN(tst_QByteArray) #include "tst_bench_qbytearray.moc" diff --git a/tests/benchmarks/corelib/text/qchar/tst_bench_qchar.cpp b/tests/benchmarks/corelib/text/qchar/tst_bench_qchar.cpp index b3ef96dfe1..194dd27d36 100644 --- a/tests/benchmarks/corelib/text/qchar/tst_bench_qchar.cpp +++ b/tests/benchmarks/corelib/text/qchar/tst_bench_qchar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QChar> diff --git a/tests/benchmarks/corelib/text/qlocale/tst_bench_qlocale.cpp b/tests/benchmarks/corelib/text/qlocale/tst_bench_qlocale.cpp index d6a5b90f98..3d13174c9c 100644 --- a/tests/benchmarks/corelib/text/qlocale/tst_bench_qlocale.cpp +++ b/tests/benchmarks/corelib/text/qlocale/tst_bench_qlocale.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QLocale> #include <QTest> diff --git a/tests/benchmarks/corelib/text/qregularexpression/tst_bench_qregularexpression.cpp b/tests/benchmarks/corelib/text/qregularexpression/tst_bench_qregularexpression.cpp index 55eb4f2fed..83c87be0b1 100644 --- a/tests/benchmarks/corelib/text/qregularexpression/tst_bench_qregularexpression.cpp +++ b/tests/benchmarks/corelib/text/qregularexpression/tst_bench_qregularexpression.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QRegularExpression> #include <QTest> diff --git a/tests/benchmarks/corelib/text/qstring/tst_bench_qstring.cpp b/tests/benchmarks/corelib/text/qstring/tst_bench_qstring.cpp index 4d2eaafd28..da5c0ff359 100644 --- a/tests/benchmarks/corelib/text/qstring/tst_bench_qstring.cpp +++ b/tests/benchmarks/corelib/text/qstring/tst_bench_qstring.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QStringList> +#include <QByteArray> +#include <QLatin1StringView> #include <QFile> #include <QTest> #include <limits> @@ -43,10 +45,22 @@ private slots: void toDouble_data(); void toDouble(); + // operator=(~) +#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) + void operator_assign_BA() { operator_assign<QByteArray>(); } + void operator_assign_BA_data() { operator_assign_data(); } + void operator_assign_char() { operator_assign<const char*>(); }; + void operator_assign_char_data() { operator_assign_data();} +#endif + void operator_assign_L1SV() { operator_assign<QLatin1StringView>(); } + void operator_assign_L1SV_data() { operator_assign_data(); } + private: void section_data_impl(bool includeRegExOnly = true); template <typename RX> void section_impl(); template <typename Integer> void number_impl(); + template <typename T> void operator_assign(); + void operator_assign_data(); }; tst_QString::tst_QString() @@ -450,6 +464,47 @@ void tst_QString::toDouble() QCOMPARE(actual, expected); } +template <typename T> void tst_QString::operator_assign() +{ + QFETCH(QByteArray, data); + QString str(data.size(), Qt::Uninitialized); + + T tdata; + if constexpr (std::is_same_v<T, const char*>) { + tdata = data.constData(); + } else if constexpr (std::is_same_v<T, QLatin1String>) { + tdata = T(data.constData(), data.size()); + } else { + tdata = T(data.constData(), data.size()); + tdata.detach(); + } + + QBENCHMARK { + str.operator=(tdata); + } +} + +void tst_QString::operator_assign_data() +{ + QTest::addColumn<QByteArray>("data"); + + QByteArray data; + data.fill('a', 5); + QTest::newRow("length: 5") << data; + data.fill('b', 10); + QTest::newRow("length: 10") << data; + data.fill('c', 20); + QTest::newRow("length: 20") << data; + data.fill('d', 50); + QTest::newRow("length: 50") << data; + data.fill('e', 100); + QTest::newRow("length: 100") << data; + data.fill('f', 500); + QTest::newRow("length: 500") << data; + data.fill('g', 1'000); + QTest::newRow("length: 1'000") << data; +} + QTEST_APPLESS_MAIN(tst_QString) #include "tst_bench_qstring.moc" diff --git a/tests/benchmarks/corelib/text/qstringbuilder/tst_bench_qstringbuilder.cpp b/tests/benchmarks/corelib/text/qstringbuilder/tst_bench_qstringbuilder.cpp index 8946897160..496abdaf3b 100644 --- a/tests/benchmarks/corelib/text/qstringbuilder/tst_bench_qstringbuilder.cpp +++ b/tests/benchmarks/corelib/text/qstringbuilder/tst_bench_qstringbuilder.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // Select one of the scenarios below #define SCENARIO 1 diff --git a/tests/benchmarks/corelib/text/qstringlist/tst_bench_qstringlist.cpp b/tests/benchmarks/corelib/text/qstringlist/tst_bench_qstringlist.cpp index ee0789261c..2431446bf6 100644 --- a/tests/benchmarks/corelib/text/qstringlist/tst_bench_qstringlist.cpp +++ b/tests/benchmarks/corelib/text/qstringlist/tst_bench_qstringlist.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QStringList> #include <QTest> @@ -8,6 +8,8 @@ #include <string> #include <vector> +using namespace Qt::StringLiterals; + class tst_QStringList: public QObject { Q_OBJECT @@ -19,6 +21,11 @@ private slots: void removeDuplicates() const; void removeDuplicates_data() const; + void filter_data() const; + void filter() const; + void filter_stringMatcher_data() const { filter_data(); } + void filter_stringMatcher() const; + void split_qlist_qbytearray() const; void split_qlist_qbytearray_data() const { return split_data(); } @@ -43,9 +50,9 @@ private: QStringList tst_QStringList::populateList(const int count, const QString &unit) { QStringList retval; - + retval.reserve(count); for (int i = 0; i < count; ++i) - retval.append(unit); + retval.append(unit + QString::number(i)); return retval; } @@ -77,20 +84,20 @@ void tst_QStringList::join_data() const QTest::addColumn<QStringList>("input"); QTest::addColumn<QString>("separator"); - QTest::newRow("") + QTest::newRow("100") << populateList(100, QLatin1String("unit")) << QString(); - QTest::newRow("") + QTest::newRow("1000") << populateList(1000, QLatin1String("unit")) << QString(); - QTest::newRow("") - << populateList(10000, QLatin1String("unit")) + QTest::newRow("10000") + << populateList(10'000, QLatin1String("unit")) << QString(); - QTest::newRow("") - << populateList(100000, QLatin1String("unit")) + QTest::newRow("100000") + << populateList(100'000, QLatin1String("unit")) << QString(); } @@ -130,6 +137,39 @@ void tst_QStringList::removeDuplicates_data() const QTest::addRow("long-dup-0.75") << (l + l + l + l); } +void tst_QStringList::filter_data() const +{ + QTest::addColumn<QStringList>("list"); + QTest::addColumn<QStringList>("expected"); + + for (int i : {10, 20, 30, 40, 50, 70, 80, 100, 300, 500, 700, 900, 10'000}) { + QStringList list = populateList(i, u"A rather long string to test QStringMatcher"_s); + list.append(u"Horse and cart from old"_s); + QTest::addRow("list%d", i) << list << QStringList(u"Horse and cart from old"_s); + } +} + +void tst_QStringList::filter() const +{ + QFETCH(QStringList, list); + QFETCH(QStringList, expected); + + QBENCHMARK { + QCOMPARE(list.filter(u"Horse and cart from old", Qt::CaseSensitive), expected); + } +} + +void tst_QStringList::filter_stringMatcher() const +{ + QFETCH(QStringList, list); + QFETCH(QStringList, expected); + + const QStringMatcher matcher(u"Horse and cart from old", Qt::CaseSensitive); + QBENCHMARK { + QCOMPARE(list.filter(matcher), expected); + } +} + void tst_QStringList::split_data() const { QTest::addColumn<QString>("input"); diff --git a/tests/benchmarks/corelib/text/qstringtokenizer/tst_bench_qstringtokenizer.cpp b/tests/benchmarks/corelib/text/qstringtokenizer/tst_bench_qstringtokenizer.cpp index 38f55069b7..eccfad91da 100644 --- a/tests/benchmarks/corelib/text/qstringtokenizer/tst_bench_qstringtokenizer.cpp +++ b/tests/benchmarks/corelib/text/qstringtokenizer/tst_bench_qstringtokenizer.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtTest/QTest> diff --git a/tests/benchmarks/corelib/text/qutf8stringview/tst_bench_qutf8stringview.cpp b/tests/benchmarks/corelib/text/qutf8stringview/tst_bench_qutf8stringview.cpp index 1286543828..ec633ff67d 100644 --- a/tests/benchmarks/corelib/text/qutf8stringview/tst_bench_qutf8stringview.cpp +++ b/tests/benchmarks/corelib/text/qutf8stringview/tst_bench_qutf8stringview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: BSD-3-Clause +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qbytearray.h> #include <qdebug.h> diff --git a/tests/benchmarks/corelib/thread/CMakeLists.txt b/tests/benchmarks/corelib/thread/CMakeLists.txt index 48bf0572a6..fd7cbe6117 100644 --- a/tests/benchmarks/corelib/thread/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/CMakeLists.txt @@ -1,7 +1,9 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -add_subdirectory(qfuture) +if(QT_FEATURE_future) + add_subdirectory(qfuture) +endif() add_subdirectory(qmutex) add_subdirectory(qreadwritelock) add_subdirectory(qthreadstorage) diff --git a/tests/benchmarks/corelib/thread/qfuture/tst_bench_qfuture.cpp b/tests/benchmarks/corelib/thread/qfuture/tst_bench_qfuture.cpp index 74dd549462..38b3f636c9 100644 --- a/tests/benchmarks/corelib/thread/qfuture/tst_bench_qfuture.cpp +++ b/tests/benchmarks/corelib/thread/qfuture/tst_bench_qfuture.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_bench_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_bench_qmutex.cpp index fa48c959ec..6ea0c25c0b 100644 --- a/tests/benchmarks/corelib/thread/qmutex/tst_bench_qmutex.cpp +++ b/tests/benchmarks/corelib/thread/qmutex/tst_bench_qmutex.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/QtCore> #include <QTest> diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp index a41002e5fe..e63ac6573f 100644 --- a/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp +++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/QtCore> #include <QTest> diff --git a/tests/benchmarks/corelib/thread/qthreadpool/tst_bench_qthreadpool.cpp b/tests/benchmarks/corelib/thread/qthreadpool/tst_bench_qthreadpool.cpp index cc4ae3cfb2..e7e5636307 100644 --- a/tests/benchmarks/corelib/thread/qthreadpool/tst_bench_qthreadpool.cpp +++ b/tests/benchmarks/corelib/thread/qthreadpool/tst_bench_qthreadpool.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2013 David Faure <david.faure@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore> diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/tst_bench_qthreadstorage.cpp b/tests/benchmarks/corelib/thread/qthreadstorage/tst_bench_qthreadstorage.cpp index 724d587dd1..47db215465 100644 --- a/tests/benchmarks/corelib/thread/qthreadstorage/tst_bench_qthreadstorage.cpp +++ b/tests/benchmarks/corelib/thread/qthreadstorage/tst_bench_qthreadstorage.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore> diff --git a/tests/benchmarks/corelib/thread/qwaitcondition/tst_bench_qwaitcondition.cpp b/tests/benchmarks/corelib/thread/qwaitcondition/tst_bench_qwaitcondition.cpp index 2cdba3d07a..0abd53fc93 100644 --- a/tests/benchmarks/corelib/thread/qwaitcondition/tst_bench_qwaitcondition.cpp +++ b/tests/benchmarks/corelib/thread/qwaitcondition/tst_bench_qwaitcondition.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/QtCore> #include <QTest> diff --git a/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp b/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp index 448b941bb1..7dde3bf426 100644 --- a/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp +++ b/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp @@ -1,9 +1,10 @@ // Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDate> #include <QTest> #include <QList> +using namespace Qt::StringLiterals; class tst_QDate : public QObject { @@ -33,6 +34,9 @@ private Q_SLOTS: void addDays(); void addMonths(); void addYears(); + + void fromString_data(); + void fromString(); }; QList<QDate> tst_QDate::daily(qint64 start, qint64 end) @@ -184,5 +188,28 @@ void tst_QDate::addYears() Q_UNUSED(store); } +void tst_QDate::fromString_data() +{ + QTest::addColumn<QString>("string"); + QTest::addColumn<QString>("format"); + QTest::addColumn<int>("baseYear"); + + QTest::newRow("yyyyMMdd") << u"20240412"_s << u"yyyyMMdd"_s << 2000; + QTest::newRow("yyyy-MM-dd") << u"2024-04-12"_s << u"yyyy-MM-dd"_s << 2000; + QTest::newRow("YYYYMMDD") << u"20240412"_s << u"YYYYMMDD"_s << 2000; // Invalid, QTBUG-124465. +} + +void tst_QDate::fromString() +{ + QFETCH(const QString, string); + QFETCH(const QString, format); + QFETCH(const int, baseYear); + QDate date; + QBENCHMARK { + date = QDate::fromString(string, format, baseYear); + } + Q_UNUSED(date); +} + QTEST_MAIN(tst_QDate) #include "tst_bench_qdate.moc" diff --git a/tests/benchmarks/corelib/time/qdatetime/tst_bench_qdatetime.cpp b/tests/benchmarks/corelib/time/qdatetime/tst_bench_qdatetime.cpp index 822477c8fd..1c86eae009 100644 --- a/tests/benchmarks/corelib/time/qdatetime/tst_bench_qdatetime.cpp +++ b/tests/benchmarks/corelib/time/qdatetime/tst_bench_qdatetime.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDateTime> #include <QTimeZone> @@ -13,7 +13,9 @@ class tst_QDateTime : public QObject Q_OBJECT static QList<QDateTime> daily(qint64 start, qint64 end); +#if QT_CONFIG(timezone) static QList<QDateTime> norse(qint64 start, qint64 end); +#endif void decade_data(); private Q_SLOTS: @@ -28,8 +30,10 @@ private Q_SLOTS: void timeZoneAbbreviation(); void toMSecsSinceEpoch_data() { decade_data(); } void toMSecsSinceEpoch(); +#if QT_CONFIG(timezone) void toMSecsSinceEpochTz_data() { decade_data(); } void toMSecsSinceEpochTz(); +#endif void setDate(); void setTime(); #if QT_DEPRECATED_SINCE(6, 9) @@ -37,14 +41,18 @@ private Q_SLOTS: void setOffsetFromUtc(); #endif void setMSecsSinceEpoch(); +#if QT_CONFIG(timezone) void setMSecsSinceEpochTz(); +#endif void toString(); void toStringTextFormat(); void toStringIsoFormat(); void addDays(); +#if QT_CONFIG(timezone) void addDaysTz(); - void addMSecs(); void addMSecsTz(); +#endif + void addMSecs(); #if QT_DEPRECATED_SINCE(6, 9) void toTimeSpec(); void toOffsetFromUtc(); @@ -65,7 +73,9 @@ private Q_SLOTS: void fromStringIso(); void fromMSecsSinceEpoch(); void fromMSecsSinceEpochUtc(); +#if QT_CONFIG(timezone) void fromMSecsSinceEpochTz(); +#endif }; using namespace QtPrivate::DateTimeConstants; @@ -102,7 +112,7 @@ QList<QDateTime> tst_QDateTime::daily(qint64 start, qint64 end) list.append(QDateTime(QDate::fromJulianDay(jd).startOfDay())); return list; } - +#if QT_CONFIG(timezone) QList<QDateTime> tst_QDateTime::norse(qint64 start, qint64 end) { const QTimeZone cet("Europe/Oslo"); @@ -112,7 +122,7 @@ QList<QDateTime> tst_QDateTime::norse(qint64 start, qint64 end) list.append(QDateTime(QDate::fromJulianDay(jd).startOfDay(cet))); return list; } - +#endif void tst_QDateTime::create() { QFETCH(const qint64, startJd); @@ -199,7 +209,7 @@ void tst_QDateTime::toMSecsSinceEpoch() test.toMSecsSinceEpoch(); } } - +#if QT_CONFIG(timezone) void tst_QDateTime::toMSecsSinceEpochTz() { QFETCH(const qint64, startJd); @@ -213,7 +223,7 @@ void tst_QDateTime::toMSecsSinceEpochTz() } Q_UNUSED(result); } - +#endif void tst_QDateTime::setDate() { const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020); @@ -264,7 +274,7 @@ void tst_QDateTime::setMSecsSinceEpoch() test.setMSecsSinceEpoch(msecs); } } - +#if QT_CONFIG(timezone) void tst_QDateTime::setMSecsSinceEpochTz() { const qint64 msecs = qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970 + 180) * MSECS_PER_DAY; @@ -274,7 +284,7 @@ void tst_QDateTime::setMSecsSinceEpochTz() test.setMSecsSinceEpoch(msecs); } } - +#endif void tst_QDateTime::toString() { const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2011); @@ -312,7 +322,7 @@ void tst_QDateTime::addDays() } Q_UNUSED(next); } - +#if QT_CONFIG(timezone) void tst_QDateTime::addDaysTz() { const auto list = norse(JULIAN_DAY_2010, JULIAN_DAY_2020); @@ -321,7 +331,7 @@ void tst_QDateTime::addDaysTz() QDateTime result = test.addDays(1); } } - +#endif void tst_QDateTime::addMSecs() { const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020); @@ -332,7 +342,7 @@ void tst_QDateTime::addMSecs() } Q_UNUSED(next); } - +#if QT_CONFIG(timezone) void tst_QDateTime::addMSecsTz() { const auto list = norse(JULIAN_DAY_2010, JULIAN_DAY_2020); @@ -341,7 +351,7 @@ void tst_QDateTime::addMSecsTz() QDateTime result = test.addMSecs(1); } } - +#endif #if QT_DEPRECATED_SINCE(6, 9) QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED @@ -527,7 +537,7 @@ void tst_QDateTime::fromMSecsSinceEpochUtc() QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, QTimeZone::UTC); } } - +#if QT_CONFIG(timezone) void tst_QDateTime::fromMSecsSinceEpochTz() { const int start = JULIAN_DAY_2010 - JULIAN_DAY_1970; @@ -538,6 +548,7 @@ void tst_QDateTime::fromMSecsSinceEpochTz() QDateTime test = QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, cet); } } +#endif QTEST_MAIN(tst_QDateTime) diff --git a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp index 0cd4065824..db8b910d98 100644 --- a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp @@ -1,6 +1,7 @@ +// Copyright (C) 2022 The Qt Company Ltd. // Copyright (C) 2019 Crimson AS <info@crimson.no> // Copyright (C) 2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTimeZone> #include <QTest> @@ -14,6 +15,7 @@ class tst_QTimeZone : public QObject Q_OBJECT private Q_SLOTS: +#if QT_CONFIG(timezone) void isTimeZoneIdAvailable(); void systemTimeZone(); void zoneByName_data(); @@ -24,16 +26,13 @@ private Q_SLOTS: void transitionsForward(); void transitionsReverse_data() { transitionList_data(); } void transitionsReverse(); +#endif }; static QList<QByteArray> enoughZones() { #ifdef EXHAUSTIVE - auto available = QTimeZone::availableTimeZoneIds(); - QList<QByteArray> result; - result.reserve(available.size() + 1); - for (conat auto &name : available) - result << name; + QList<QByteArray> result = QTimeZone::availableTimeZoneIds(); #else QList<QByteArray> result { QByteArray("UTC"), @@ -55,7 +54,7 @@ static QList<QByteArray> enoughZones() result << QByteArray("Vulcan/ShiKahr"); // invalid: also worth testing return result; } - +#if QT_CONFIG(timezone) void tst_QTimeZone::isTimeZoneIdAvailable() { const QList<QByteArray> available = QTimeZone::availableTimeZoneIds(); @@ -71,7 +70,6 @@ void tst_QTimeZone::systemTimeZone() QTimeZone::systemTimeZone(); } } - void tst_QTimeZone::zoneByName_data() { QTest::addColumn<QByteArray>("name"); @@ -142,6 +140,7 @@ void tst_QTimeZone::transitionsReverse() tran = zone.previousTransition(tran.atUtc); } } +#endif QTEST_MAIN(tst_QTimeZone) diff --git a/tests/benchmarks/corelib/tools/containers-associative/tst_bench_containers_associative.cpp b/tests/benchmarks/corelib/tools/containers-associative/tst_bench_containers_associative.cpp index ee711abf85..a5618cfcaf 100644 --- a/tests/benchmarks/corelib/tools/containers-associative/tst_bench_containers_associative.cpp +++ b/tests/benchmarks/corelib/tools/containers-associative/tst_bench_containers_associative.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QString> #include <QMap> #include <QHash> diff --git a/tests/benchmarks/corelib/tools/containers-sequential/tst_bench_containers_sequential.cpp b/tests/benchmarks/corelib/tools/containers-sequential/tst_bench_containers_sequential.cpp index 5f3e147313..78c8016664 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/tst_bench_containers_sequential.cpp +++ b/tests/benchmarks/corelib/tools/containers-sequential/tst_bench_containers_sequential.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // This file contains benchmarks for comparing QList against std::vector #include <QtCore> diff --git a/tests/benchmarks/corelib/tools/qcontiguouscache/tst_bench_qcontiguouscache.cpp b/tests/benchmarks/corelib/tools/qcontiguouscache/tst_bench_qcontiguouscache.cpp index e23e762154..ae2cf471b0 100644 --- a/tests/benchmarks/corelib/tools/qcontiguouscache/tst_bench_qcontiguouscache.cpp +++ b/tests/benchmarks/corelib/tools/qcontiguouscache/tst_bench_qcontiguouscache.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QObject> #include <QTest> diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp index 8066650b32..9f2d1c57f2 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // Copyright (C) 2017 Intel Corporation. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QByteArray> #include <QCryptographicHash> diff --git a/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt b/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt index 1958f86dd5..9002cc0723 100644 --- a/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt @@ -9,6 +9,8 @@ qt_internal_add_benchmark(tst_bench_qhash SOURCES tst_bench_qhash.cpp outofline.cpp + NO_PCH_SOURCES + tst_bench_qhash.cpp # undef QT_NO_FOREACH INCLUDE_DIRECTORIES . LIBRARIES diff --git a/tests/benchmarks/corelib/tools/qhash/outofline.cpp b/tests/benchmarks/corelib/tools/qhash/outofline.cpp index aa861d2e42..5b16c36ffb 100644 --- a/tests/benchmarks/corelib/tools/qhash/outofline.cpp +++ b/tests/benchmarks/corelib/tools/qhash/outofline.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "tst_bench_qhash.h" QT_BEGIN_NAMESPACE -size_t qHash(const Qt4String &str) +size_t qHash(const Qt4String &str, size_t /* never used */) { qsizetype n = str.size(); const QChar *p = str.unicode(); @@ -40,7 +40,7 @@ size_t qHash(const Qt50String &key, size_t seed) // Still, we can avoid writing the multiplication as "(h << 5) - h" // -- the compiler will turn it into a shift and an addition anyway // (for instance, gcc 4.4 does that even at -O0). -size_t qHash(const JavaString &str) +size_t qHash(const JavaString &str, size_t /* never used */) { const auto *p = reinterpret_cast<const char16_t *>(str.constData()); const qsizetype len = str.size(); diff --git a/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.cpp b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.cpp index fd0a74b52a..1a62a48437 100644 --- a/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.cpp +++ b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2016 Intel Corporation. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses #include "tst_bench_qhash.h" @@ -11,6 +13,8 @@ #include <QUuid> #include <QTest> +static constexpr quint64 RandomSeed32 = 1045982819; +static constexpr quint64 RandomSeed64 = QtPrivate::QHashCombine{}(RandomSeed32, RandomSeed32); class tst_QHash : public QObject { @@ -29,6 +33,8 @@ private slots: void hashing_current_data() { data(); } void hashing_current() { hashing_template<QString>(); } + void hashing_qbytearray_data() { data(); } + void hashing_qbytearray() { hashing_template<QByteArray>(); } void hashing_qt50_data() { data(); } void hashing_qt50() { hashing_template<Qt50String>(); } void hashing_qt4_data() { data(); } @@ -36,15 +42,25 @@ private slots: void hashing_javaString_data() { data(); } void hashing_javaString() { hashing_template<JavaString>(); } + void hashing_nonzero_current_data() { data(); } + void hashing_nonzero_current() { hashing_nonzero_template<QString>(); } + void hashing_nonzero_qbytearray_data() { data(); } + void hashing_nonzero_qbytearray() { hashing_nonzero_template<QByteArray>(); } + void hashing_nonzero_qlatin1string_data() { data(); } + void hashing_nonzero_qlatin1string() { hashing_nonzero_template<OwningLatin1String>(); } + private: void data(); template <typename String> void qhash_template(); - template <typename String> void hashing_template(); + template <typename String, size_t Seed = 0> void hashing_template(); + template <typename String> void hashing_nonzero_template() + { hashing_template<String, size_t(RandomSeed64)>(); } QStringList smallFilePaths; QStringList uuids; QStringList dict; QStringList numbers; + QStringList longstrings; }; ///////////////////// QHash ///////////////////// @@ -53,6 +69,8 @@ private: void tst_QHash::initTestCase() { + QHashSeed::setDeterministicGlobalSeed(); + // small list of strings (that happen to look like file paths produced long // ago by cd ../.. && find . -print, but that's irrelevant). QFile smallPathsData(QFINDTESTDATA("paths_small_data.txt")); @@ -64,10 +82,12 @@ void tst_QHash::initTestCase() // guaranteed to be completely random, generated by http://xkcd.com/221/ QUuid ns = QUuid("{f43d2ef3-2fe9-4563-a6f5-5a0100c2d699}"); uuids.reserve(smallFilePaths.size()); + longstrings.reserve(smallFilePaths.size()); foreach (const QString &path, smallFilePaths) uuids.append(QUuid::createUuidV5(ns, path).toString()); - + for (qsizetype i = 0; i < uuids.size(); ++i) + longstrings.append(uuids.at(i).repeated(8)); // lots of strings with alphabetical characters, vaguely reminiscent of // a dictionary. @@ -108,6 +128,7 @@ void tst_QHash::data() QTest::addColumn<QStringList>("items"); QTest::newRow("paths-small") << smallFilePaths; QTest::newRow("uuids-list") << uuids; + QTest::newRow("longstrings-list") << longstrings; QTest::newRow("dictionary") << dict; QTest::newRow("numbers") << numbers; } @@ -128,19 +149,30 @@ template <typename String> void tst_QHash::qhash_template() } } -template <typename String> void tst_QHash::hashing_template() +template <typename String, size_t Seed> void tst_QHash::hashing_template() { // just the hashing function QFETCH(QStringList, items); QList<String> realitems; realitems.reserve(items.size()); - foreach (const QString &s, items) - realitems.append(s); + foreach (const QString &s, items) { + if constexpr (std::is_same_v<QString::value_type, typename String::value_type>) { + realitems.append(s); + } else if constexpr (sizeof(typename String::value_type) == 1) { + realitems.append(String(s.toLatin1())); + } + } QBENCHMARK { - for (int i = 0, n = realitems.size(); i != n; ++i) - (void)qHash(realitems.at(i)); + for (int i = 0, n = realitems.size(); i != n; ++i) { + volatile size_t h = qHash(realitems.at(i), Seed); + (void)h; +#ifdef Q_CC_GNU + // "use" h + asm ("" : "+r" (h)); +#endif + } } } diff --git a/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h index f8a9d65f96..501b4a8b7f 100644 --- a/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h +++ b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h @@ -1,8 +1,20 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include <QHashFunctions> #include <QString> +struct OwningLatin1String : QByteArray +{ + OwningLatin1String() = default; + OwningLatin1String(const QByteArray &a) : QByteArray(a) {} + OwningLatin1String(QByteArray &&a) : QByteArray(std::move(a)) {} +}; +QT_BEGIN_NAMESPACE +inline size_t qHash(const OwningLatin1String &s, size_t seed = 0) +{ return qHash(QLatin1StringView(s), seed); } +QT_END_NAMESPACE + struct Qt4String : QString { Qt4String() {} @@ -10,7 +22,7 @@ struct Qt4String : QString }; QT_BEGIN_NAMESPACE -size_t qHash(const Qt4String &); +size_t qHash(const Qt4String &, size_t = 0); QT_END_NAMESPACE struct Qt50String : QString @@ -31,6 +43,6 @@ struct JavaString : QString }; QT_BEGIN_NAMESPACE -size_t qHash(const JavaString &); +size_t qHash(const JavaString &, size_t = 0); QT_END_NAMESPACE diff --git a/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist.cpp b/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist.cpp index 7c014e7bc7..24691d1f71 100644 --- a/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist.cpp +++ b/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QList> #include <QTest> diff --git a/tests/benchmarks/corelib/tools/qmap/tst_bench_qmap.cpp b/tests/benchmarks/corelib/tools/qmap/tst_bench_qmap.cpp index f44d58edc5..db3c4fc7a2 100644 --- a/tests/benchmarks/corelib/tools/qmap/tst_bench_qmap.cpp +++ b/tests/benchmarks/corelib/tools/qmap/tst_bench_qmap.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QFile> #include <QMap> diff --git a/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp b/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp index dbf4c2db6c..0ba9e15963 100644 --- a/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp +++ b/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp @@ -1,7 +1,9 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // This file contains benchmarks for QRect/QRectF functions. +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses + #include <QDebug> #include <qtest.h> diff --git a/tests/benchmarks/corelib/tools/qringbuffer/tst_bench_qringbuffer.cpp b/tests/benchmarks/corelib/tools/qringbuffer/tst_bench_qringbuffer.cpp index 7acb0005ef..f352cd56a9 100644 --- a/tests/benchmarks/corelib/tools/qringbuffer/tst_bench_qringbuffer.cpp +++ b/tests/benchmarks/corelib/tools/qringbuffer/tst_bench_qringbuffer.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <private/qringbuffer_p.h> #include <QByteArray> diff --git a/tests/benchmarks/corelib/tools/qset/tst_bench_qset.cpp b/tests/benchmarks/corelib/tools/qset/tst_bench_qset.cpp index 9ac1a0449f..5bbec05aab 100644 --- a/tests/benchmarks/corelib/tools/qset/tst_bench_qset.cpp +++ b/tests/benchmarks/corelib/tools/qset/tst_bench_qset.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QSet> #include <QTest> @@ -9,12 +9,22 @@ class tst_QSet : public QObject Q_OBJECT private slots: + void initTestCase(); void intersect_int_data(); void intersect_int(); void intersect_complexType_data(); void intersect_complexType(); + void unite_int_data(); + void unite_int(); + void contains_then_insert_int_data(); + void contains_then_insert_int(); }; +void tst_QSet::initTestCase() +{ + QHashSeed::setDeterministicGlobalSeed(); +} + void tst_QSet::intersect_int_data() { QTest::addColumn<int>("lhsSize"); @@ -98,6 +108,70 @@ void tst_QSet::intersect_complexType() } } +void tst_QSet::unite_int_data() +{ + QTest::addColumn<int>("lhsSize"); + QTest::addColumn<int>("rhsSize"); + QTest::addColumn<int>("overlap"); + + QTest::newRow("1000000.unite(1000) - 0 overlap") << 1000000 << 1000 << 0; + QTest::newRow("1000000.unite(1000) - 100 overlap") << 1000000 << 1000 << 100; + QTest::newRow("1000000.unite(1000) - 1000 overlap") << 1000000 << 1000 << 1000; + QTest::newRow("1000.unite(1000000) - 0 overlap") << 1000 << 1000000 << 0; + QTest::newRow("1000.unite(1000000) - 100 overlap") << 1000 << 1000000 << 100; + QTest::newRow("1000.unite(1000000) - 1000 overlap") << 1000 << 1000000 << 1000; +} + +auto build_sets(int lhsSize, int rhsSize, int overlap) +{ + QSet<int> lhs; + for (int i = 0; i < lhsSize; ++i) + lhs.insert(i); + + QSet<int> rhs; + for (int i = lhsSize - overlap; i < rhsSize + lhsSize - overlap; ++i) + rhs.insert(i); + + return std::make_pair(lhs, rhs); +} + +void tst_QSet::unite_int() +{ + QFETCH(int, lhsSize); + QFETCH(int, rhsSize); + QFETCH(int, overlap); + + auto [lhs, rhs] = build_sets(lhsSize, rhsSize, overlap); + + QBENCHMARK { + QSet united = QSet(lhs).unite(rhs); + QCOMPARE(united.size(), lhsSize + rhsSize - overlap); + } +} + +void tst_QSet::contains_then_insert_int_data() +{ + unite_int_data(); +} + +void tst_QSet::contains_then_insert_int() +{ + QFETCH(int, lhsSize); + QFETCH(int, rhsSize); + QFETCH(int, overlap); + + auto [lhs, rhs] = build_sets(lhsSize, rhsSize, overlap); + + QBENCHMARK { + QSet copy(lhs); + for (auto i : rhs) { + if (!copy.contains(i)) + copy.insert(i); + } + QCOMPARE(copy.size(), lhsSize + rhsSize - overlap); + } +} + QTEST_MAIN(tst_QSet) #include "tst_bench_qset.moc" diff --git a/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp b/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp index b00bef96d4..6197863601 100644 --- a/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp +++ b/tests/benchmarks/corelib/tools/qsharedpointer/tst_bench_shared_ptr.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QObject> #include <QScopeGuard> diff --git a/tests/benchmarks/corelib/tools/qstack/tst_bench_qstack.cpp b/tests/benchmarks/corelib/tools/qstack/tst_bench_qstack.cpp index 468fb4b820..e0c8cda18c 100644 --- a/tests/benchmarks/corelib/tools/qstack/tst_bench_qstack.cpp +++ b/tests/benchmarks/corelib/tools/qstack/tst_bench_qstack.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2015 Robin Burchell <robin.burchell@viroteck.net> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QStack> #include <QDebug> diff --git a/tests/benchmarks/corelib/tools/qvector/outofline.cpp b/tests/benchmarks/corelib/tools/qvector/outofline.cpp index e2421e14e0..eb4756f710 100644 --- a/tests/benchmarks/corelib/tools/qvector/outofline.cpp +++ b/tests/benchmarks/corelib/tools/qvector/outofline.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QList> #include "qrawvector.h" diff --git a/tests/benchmarks/corelib/tools/qvector/qrawvector.h b/tests/benchmarks/corelib/tools/qvector/qrawvector.h index 606e3268e3..9e68b81285 100644 --- a/tests/benchmarks/corelib/tools/qvector/qrawvector.h +++ b/tests/benchmarks/corelib/tools/qvector/qrawvector.h @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef QRAWVECTOR_H #define QRAWVECTOR_H diff --git a/tests/benchmarks/corelib/tools/qvector/tst_bench_qvector.cpp b/tests/benchmarks/corelib/tools/qvector/tst_bench_qvector.cpp index 2e2036110d..0486beed4e 100644 --- a/tests/benchmarks/corelib/tools/qvector/tst_bench_qvector.cpp +++ b/tests/benchmarks/corelib/tools/qvector/tst_bench_qvector.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QVector> #include <QDebug> diff --git a/tests/benchmarks/dbus/qdbusperformance/server/server.cpp b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp index 93ad13354e..5bf4ac1ec3 100644 --- a/tests/benchmarks/dbus/qdbusperformance/server/server.cpp +++ b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/QtCore> diff --git a/tests/benchmarks/dbus/qdbusperformance/serverobject.h b/tests/benchmarks/dbus/qdbusperformance/serverobject.h index cdf6aa5f13..da12a56308 100644 --- a/tests/benchmarks/dbus/qdbusperformance/serverobject.h +++ b/tests/benchmarks/dbus/qdbusperformance/serverobject.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SERVEROBJECT_H diff --git a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp index 2cd00f3c37..7f1957b87f 100644 --- a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp +++ b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QTestEventLoop> diff --git a/tests/benchmarks/dbus/qdbustype/main.cpp b/tests/benchmarks/dbus/qdbustype/main.cpp index 93b5dce5cd..d3ee0da14c 100644 --- a/tests/benchmarks/dbus/qdbustype/main.cpp +++ b/tests/benchmarks/dbus/qdbustype/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtCore/QCoreApplication> diff --git a/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp b/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp index a36e3d9300..a877cca838 100644 --- a/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp +++ b/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "dummyanimation.h" #include "dummyobject.h" diff --git a/tests/benchmarks/gui/animation/qanimation/dummyanimation.h b/tests/benchmarks/gui/animation/qanimation/dummyanimation.h index 331d66e151..5ac0e6431b 100644 --- a/tests/benchmarks/gui/animation/qanimation/dummyanimation.h +++ b/tests/benchmarks/gui/animation/qanimation/dummyanimation.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> diff --git a/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp b/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp index e8156e3c6b..a69c73a90b 100644 --- a/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp +++ b/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "dummyobject.h" diff --git a/tests/benchmarks/gui/animation/qanimation/dummyobject.h b/tests/benchmarks/gui/animation/qanimation/dummyobject.h index e860219d50..3bae6407ba 100644 --- a/tests/benchmarks/gui/animation/qanimation/dummyobject.h +++ b/tests/benchmarks/gui/animation/qanimation/dummyobject.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> diff --git a/tests/benchmarks/gui/animation/qanimation/main.cpp b/tests/benchmarks/gui/animation/qanimation/main.cpp index d91fa2e358..26c188bb4a 100644 --- a/tests/benchmarks/gui/animation/qanimation/main.cpp +++ b/tests/benchmarks/gui/animation/qanimation/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtWidgets> #include <qtest.h> diff --git a/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp b/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp index 72ca25932b..ec2fc340cf 100644 --- a/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp +++ b/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "rectanimation.h" #include "dummyobject.h" diff --git a/tests/benchmarks/gui/animation/qanimation/rectanimation.h b/tests/benchmarks/gui/animation/qanimation/rectanimation.h index f4a9f3017a..359c9a8a9b 100644 --- a/tests/benchmarks/gui/animation/qanimation/rectanimation.h +++ b/tests/benchmarks/gui/animation/qanimation/rectanimation.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp index 23365bad47..4aaf89d029 100644 --- a/tests/benchmarks/gui/image/blendbench/main.cpp +++ b/tests/benchmarks/gui/image/blendbench/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> #include <QString> diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp index a87d794c37..0c4243637c 100644 --- a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp +++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QImage> diff --git a/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt b/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt index 1255cebfaf..ba3c2a7ec4 100644 --- a/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt +++ b/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt @@ -7,8 +7,9 @@ qt_internal_add_benchmark(tst_bench_qimagereader SOURCES - tst_qimagereader.cpp + tst_bench_qimagereader.cpp LIBRARIES + Qt::CorePrivate Qt::Gui Qt::Test ) diff --git a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp index 76e3e919f3..9b23741405 100644 --- a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp @@ -1,7 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> + #include <QBuffer> #include <QDebug> #include <QFile> @@ -9,6 +10,8 @@ #include <QImageReader> #include <QImageWriter> #include <QPixmap> + +#include <QtCore/private/qfactoryloader_p.h> #include <QSet> #include <QTimer> @@ -17,20 +20,20 @@ typedef QList<int> QIntList; Q_DECLARE_METATYPE(QStringMap) Q_DECLARE_METATYPE(QIntList) -class tst_QImageReader : public QObject +class tst_bench_QImageReader : public QObject { Q_OBJECT public: - tst_QImageReader(); - virtual ~tst_QImageReader(); + tst_bench_QImageReader(); public slots: void initTestCase(); - void init(); - void cleanup(); private slots: + void rawFactoryLoader_keyMap(); + void rawFactoryLoader_instance(); + void readImage_data(); void readImage(); @@ -46,9 +49,10 @@ private slots: private: QList< QPair<QString, QByteArray> > images; // filename, format QString prefix; + QFactoryLoader m_loader{QImageIOHandlerFactoryInterface_iid, "/imageformats"}; }; -tst_QImageReader::tst_QImageReader() +tst_bench_QImageReader::tst_bench_QImageReader() { images << QPair<QString, QByteArray>(QLatin1String("colorful.bmp"), QByteArray("bmp")); images << QPair<QString, QByteArray>(QLatin1String("font.bmp"), QByteArray("bmp")); @@ -75,26 +79,38 @@ tst_QImageReader::tst_QImageReader() #endif } -tst_QImageReader::~tst_QImageReader() -{ -} - -void tst_QImageReader::initTestCase() +void tst_bench_QImageReader::initTestCase() { prefix = QFINDTESTDATA("images/"); if (prefix.isEmpty()) QFAIL("Can't find images directory!"); } -void tst_QImageReader::init() +void tst_bench_QImageReader::rawFactoryLoader_keyMap() { + if (m_loader.keyMap().isEmpty()) + QSKIP("No image plugins found."); + + QBENCHMARK { + [[maybe_unused]] auto r = m_loader.keyMap(); + } } -void tst_QImageReader::cleanup() +void tst_bench_QImageReader::rawFactoryLoader_instance() { + if (m_loader.keyMap().isEmpty()) + QSKIP("No image plugins found."); + + const auto numInstances = m_loader.keyMap().uniqueKeys().size(); + + QBENCHMARK { + for (int i = 0; i < numInstances; ++i) + delete m_loader.instance(i); + } } -void tst_QImageReader::readImage_data() + +void tst_bench_QImageReader::readImage_data() { QTest::addColumn<QString>("fileName"); QTest::addColumn<QByteArray>("format"); @@ -106,7 +122,7 @@ void tst_QImageReader::readImage_data() } } -void tst_QImageReader::readImage() +void tst_bench_QImageReader::readImage() { QFETCH(QString, fileName); QFETCH(QByteArray, format); @@ -118,7 +134,7 @@ void tst_QImageReader::readImage() } } -void tst_QImageReader::setScaledSize_data() +void tst_bench_QImageReader::setScaledSize_data() { QTest::addColumn<QString>("fileName"); QTest::addColumn<QByteArray>("format"); @@ -136,7 +152,7 @@ void tst_QImageReader::setScaledSize_data() } } -void tst_QImageReader::setScaledSize() +void tst_bench_QImageReader::setScaledSize() { QFETCH(QString, fileName); QFETCH(QSize, newSize); @@ -150,7 +166,7 @@ void tst_QImageReader::setScaledSize() } } -void tst_QImageReader::setClipRect_data() +void tst_bench_QImageReader::setClipRect_data() { QTest::addColumn<QString>("fileName"); QTest::addColumn<QByteArray>("format"); @@ -163,7 +179,7 @@ void tst_QImageReader::setClipRect_data() } } -void tst_QImageReader::setClipRect() +void tst_bench_QImageReader::setClipRect() { QFETCH(QString, fileName); QFETCH(QRect, newRect); @@ -177,12 +193,12 @@ void tst_QImageReader::setClipRect() } } -void tst_QImageReader::setScaledClipRect_data() +void tst_bench_QImageReader::setScaledClipRect_data() { setClipRect_data(); } -void tst_QImageReader::setScaledClipRect() +void tst_bench_QImageReader::setScaledClipRect() { QFETCH(QString, fileName); QFETCH(QRect, newRect); @@ -197,5 +213,5 @@ void tst_QImageReader::setScaledClipRect() } } -QTEST_MAIN(tst_QImageReader) -#include "tst_qimagereader.moc" +QTEST_MAIN(tst_bench_QImageReader) +#include "tst_bench_qimagereader.moc" diff --git a/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp b/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp index 3a52cd60ae..2819dc1c11 100644 --- a/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp +++ b/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QImage> diff --git a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp index c1fa79aeb4..7a6e4a2b3f 100644 --- a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QBitmap> diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp index 5b8c7465e7..0c93e6d2ec 100644 --- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QPixmapCache> diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp index 46c82d3014..2f7d278e87 100644 --- a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp +++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore/qmetatype.h> diff --git a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp index 675f4eb1ef..9c49e467ce 100644 --- a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp +++ b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore/qvariant.h> diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp index b5905d5a64..ebc61495dd 100644 --- a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp +++ b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtGui/qmatrix4x4.h> diff --git a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp index 7ff3ca0d51..07b47d6401 100644 --- a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp +++ b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QQuaternion> diff --git a/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp b/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp index 530e11fef4..4ab0a2db1e 100644 --- a/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp +++ b/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QPainter> diff --git a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp index a16299250b..67bef8ebfe 100644 --- a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp +++ b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "paintcommands.h" diff --git a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp index 192ece2aff..02fe3f986e 100644 --- a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QColor> diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp index cccf9c703c..7954e964b3 100644 --- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp @@ -1,5 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses #include <qtest.h> #include <QPainter> @@ -195,6 +197,9 @@ private slots: void drawTransformedSemiTransparentImage(); void drawTransformedFilledImage(); + void drawPathExceedingDevice_data(); + void drawPathExceedingDevice(); + private: void setupBrushes(); void createPrimitives(); @@ -1659,6 +1664,56 @@ void tst_QPainter::drawTransformedFilledImage() } } +void tst_QPainter::drawPathExceedingDevice_data() +{ + QTest::addColumn<int>("dim"); + QTest::addColumn<QPainterPath>("path"); + + const int dim = 512; + QPainterPath p; + const int ext = 10 * dim; + for (int i = 0; i < ext; i += (ext / 50)) { + p.lineTo(ext, i); + p.lineTo(0, dim); + p.moveTo(0, 0); + } + + { + QPainterPath preClip; + preClip.addRect(0, 0, dim, dim); + QTest::newRow("devicesize") << dim << p.intersected(preClip); + } + + { + QPainterPath preClip; + preClip.addRect(0, 0, 2*dim, 2*dim); + QTest::newRow("devicesizex2") << dim << p.intersected(preClip); + } + + { + QPainterPath preClip; + preClip.addRect(0, 0, 5*dim, 5*dim); + QTest::newRow("devicesizex5") << dim << p.intersected(preClip); + } + + QTest::newRow("devicesizex10") << dim << p; +} + +void tst_QPainter::drawPathExceedingDevice() +{ + QFETCH(int, dim); + QFETCH(QPainterPath, path); + + QImage img(dim, dim, QImage::Format_RGB32); + QPainter p(&img); + p.setRenderHint(QPainter::Antialiasing); + p.setPen(QPen(Qt::black, 3)); + p.setBrush(Qt::NoBrush); + + QBENCHMARK { + p.drawPath(path); + } +} QTEST_MAIN(tst_QPainter) diff --git a/tests/benchmarks/gui/painting/qregion/main.cpp b/tests/benchmarks/gui/painting/qregion/main.cpp index b01956c08e..696972c140 100644 --- a/tests/benchmarks/gui/painting/qregion/main.cpp +++ b/tests/benchmarks/gui/painting/qregion/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // This file contains benchmarks for QRegion functions. #include <QDebug> diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h index 03fb01f177..9d890f1577 100644 --- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h +++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef BENCHMARKTESTS_H #define BENCHMARKTESTS_H diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp index f24c48c0e1..45b7045f94 100644 --- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp +++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp @@ -1,5 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses #include <qtest.h> @@ -107,9 +109,13 @@ class tst_QtBench : public QObject { Q_OBJECT + QList<Benchmark *> benchmarks; + private slots: void qtBench(); void qtBench_data(); + + void cleanupTestCase() { qDeleteAll(benchmarks); } }; QString makeString(int length) @@ -159,7 +165,6 @@ void tst_QtBench::qtBench_data() "i erat, sed pellentesque\n" "mi. Curabitur sed."; - QList<Benchmark *> benchmarks; benchmarks << (new DrawText(shortString, DrawText::PainterMode)); benchmarks << (new DrawText(middleString, DrawText::PainterMode)); benchmarks << (new DrawText(longString, DrawText::PainterMode)); diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp index 9892d53559..e6442d0dff 100644 --- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp +++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QTransform> diff --git a/tests/benchmarks/gui/text/qfontmetrics/main.cpp b/tests/benchmarks/gui/text/qfontmetrics/main.cpp index b5bb1db0f3..8aafa809f8 100644 --- a/tests/benchmarks/gui/text/qfontmetrics/main.cpp +++ b/tests/benchmarks/gui/text/qfontmetrics/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QObject> #include <QFont> diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp index 146b40676b..9a2740253c 100644 --- a/tests/benchmarks/gui/text/qtext/main.cpp +++ b/tests/benchmarks/gui/text/qtext/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QTextDocument> @@ -25,7 +25,9 @@ public: private slots: void loadHtml_data(); +#ifndef QT_NO_TEXTHTMLPARSER void loadHtml(); +#endif void shaping_data(); void shaping(); @@ -47,9 +49,11 @@ private slots: void paintLayoutToPixmap(); void paintLayoutToPixmap_painterFill(); +#ifndef QT_NO_TEXTHTMLPARSER void document(); void paintDocToPixmap(); void paintDocToPixmap_painterFill(); +#endif private: QSize setupTextLayout(QTextLayout *layout, bool wrap = true, int wrapWidth = 100); @@ -76,6 +80,7 @@ void tst_QText::loadHtml_data() + parag; } +#ifndef QT_NO_TEXTHTMLPARSER void tst_QText::loadHtml() { QFETCH(QString, source); @@ -84,6 +89,7 @@ void tst_QText::loadHtml() doc.setHtml(source); } } +#endif void tst_QText::shaping_data() { @@ -371,6 +377,7 @@ void tst_QText::paintLayoutToPixmap_painterFill() } } +#ifndef QT_NO_TEXTHTMLPARSER void tst_QText::document() { QTextDocument *doc = new QTextDocument; @@ -413,6 +420,7 @@ void tst_QText::paintDocToPixmap_painterFill() doc->drawContents(&p); } } +#endif QTEST_MAIN(tst_QText) diff --git a/tests/benchmarks/gui/text/qtextdocument/main.cpp b/tests/benchmarks/gui/text/qtextdocument/main.cpp index 17036d96ca..7bdff95235 100644 --- a/tests/benchmarks/gui/text/qtextdocument/main.cpp +++ b/tests/benchmarks/gui/text/qtextdocument/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 Robin Burchell <robin.burchell@viroteck.net> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QTextDocument> diff --git a/tests/benchmarks/network/access/CMakeLists.txt b/tests/benchmarks/network/access/CMakeLists.txt index 88e0b667f7..bc5148af55 100644 --- a/tests/benchmarks/network/access/CMakeLists.txt +++ b/tests/benchmarks/network/access/CMakeLists.txt @@ -2,9 +2,12 @@ # SPDX-License-Identifier: BSD-3-Clause add_subdirectory(qfile_vs_qnetworkaccessmanager) +add_subdirectory(qhttpheaders) add_subdirectory(qnetworkreply) -add_subdirectory(qnetworkreply_from_cache) -add_subdirectory(qnetworkdiskcache) +if(QT_FEATURE_networkdiskcache) + add_subdirectory(qnetworkreply_from_cache) + add_subdirectory(qnetworkdiskcache) +endif() if(QT_FEATURE_private_tests) add_subdirectory(qdecompresshelper) endif() diff --git a/tests/benchmarks/network/access/qdecompresshelper/main.cpp b/tests/benchmarks/network/access/qdecompresshelper/main.cpp index ea85aef42b..7f8b09ef0e 100644 --- a/tests/benchmarks/network/access/qdecompresshelper/main.cpp +++ b/tests/benchmarks/network/access/qdecompresshelper/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtNetwork/private/qdecompresshelper_p.h> @@ -51,13 +51,14 @@ void tst_QDecompressHelper::decompress() file.seek(0); QDecompressHelper helper; helper.setEncoding(encoding); + helper.setDecompressedSafetyCheckThreshold(-1); QVERIFY(helper.isValid()); helper.feed(file.readAll()); qsizetype bytes = 0; + QByteArray out(64 * 1024, Qt::Uninitialized); while (helper.hasData()) { - QByteArray out(64 * 1024, Qt::Uninitialized); qsizetype bytesRead = helper.read(out.data(), out.size()); bytes += bytesRead; } diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp index de4c68619f..372158163f 100644 --- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp +++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <qtest.h> #include <QTest> diff --git a/tests/benchmarks/network/access/qhttpheaders/CMakeLists.txt b/tests/benchmarks/network/access/qhttpheaders/CMakeLists.txt new file mode 100644 index 0000000000..6e89259141 --- /dev/null +++ b/tests/benchmarks/network/access/qhttpheaders/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_benchmark(tst_bench_qhttpheaders + SOURCES + tst_bench_qhttpheaders.cpp + LIBRARIES + Qt::Test + Qt::Network +) diff --git a/tests/benchmarks/network/access/qhttpheaders/tst_bench_qhttpheaders.cpp b/tests/benchmarks/network/access/qhttpheaders/tst_bench_qhttpheaders.cpp new file mode 100644 index 0000000000..424b475b27 --- /dev/null +++ b/tests/benchmarks/network/access/qhttpheaders/tst_bench_qhttpheaders.cpp @@ -0,0 +1,266 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtNetwork/qhttpheaders.h> + +#include <QtCore/qstring.h> +#include <QTest> + +using namespace Qt::StringLiterals; + +class tst_QHttpHeaders : public QObject +{ + Q_OBJECT +private slots: + void initTestCase(); + + void append_enum(); + void append_string_data(); + void append_string(); + + void contains_enum_data() { setupBasicEnumData(); } + void contains_enum(); + void contains_string_data() { setupBasicStringData(); } + void contains_string(); + + void values_enum_data() { setupBasicEnumData(); } + void values_enum(); + void values_string_data() { setupBasicStringData(); } + void values_string(); + + void combinedValue_enum_data() { setupBasicEnumData(); } + void combinedValue_enum(); + void combinedValue_string_data() { setupBasicStringData(); } + void combinedValue_string(); + + void removeAll_enum_data() { setupBasicEnumData(); } + void removeAll_enum(); + void removeAll_string_data() { setupBasicStringData(); } + void removeAll_string(); + +private: + using WKH = QHttpHeaders::WellKnownHeader; + + void setupBasicEnumData() + { + QTest::addColumn<WKH>("name"); + QTest::addColumn<bool>("exists"); + + QTest::newRow("Nonexistent enum") << WKH::CDNLoop << false; + QTest::newRow("Existent enum") << WKH::Accept << true; + } + + void setupBasicStringData() + { + QTest::addColumn<QString>("name"); + QTest::addColumn<bool>("exists"); + + QTest::newRow("Nonexistent string") << "cdn-loop" << false; + QTest::newRow("Existent wellknown string") << "accept" << true; + QTest::newRow("Existent custom string") << "customheader" << true; + } + + const QString customNameLowCase = u"customm-name"_s; // Not a typo, same length as knownName + const QString customNameMixCase = u"Customm-Name"_s; + const QString knownNameLowCase = u"content-type"_s; + const QString knownNameMixCase = u"Content-Type"_s; + static constexpr QAnyStringView value1{"value1"}; + static constexpr QAnyStringView value2{"value2"}; + static constexpr QAnyStringView value3{"value3"}; + static constexpr QAnyStringView value4{"value4"}; + + QHttpHeaders m_complexHeaders; + QHttpHeaders m_simpleHeaders; +}; + +void tst_QHttpHeaders::initTestCase() +{ + // A mix of known and custom headers in non-alphabetical order. + // "accept" (wellknown header) and "customheader" (custom header) + // have four values and in same order: value3, value1, value2, value4 + m_complexHeaders.append(WKH::Upgrade, value1); + m_complexHeaders.append("timeout", value1); + m_complexHeaders.append(WKH::KeepAlive, value1); + m_complexHeaders.append("nel", value1); + m_complexHeaders.append(WKH::Date, value1); + m_complexHeaders.append("accept", value3); + m_complexHeaders.append("customheader", value3); + m_complexHeaders.append(WKH::SoapAction, value1); + m_complexHeaders.append("foobar", value1); + m_complexHeaders.append(WKH::Accept, value1); + m_complexHeaders.append("customheader", value1); + m_complexHeaders.append(WKH::Cookie, value1); + m_complexHeaders.append("cookie", value1); + m_complexHeaders.append(WKH::ProxyStatus, value1); + m_complexHeaders.append("cookie", value1); + m_complexHeaders.append(WKH::Accept, value2); + m_complexHeaders.append("customheader", value2); + m_complexHeaders.append(WKH::Authorization, value1); + m_complexHeaders.append("content-type", value1); + m_complexHeaders.append(WKH::Destination, value1); + m_complexHeaders.append("rover", value1); + m_complexHeaders.append("accept", value4); + m_complexHeaders.append("customheader", value4); + m_complexHeaders.append(WKH::Range, value1); + m_complexHeaders.append("destination", value1); + m_complexHeaders.append(WKH::Location, value1); + m_complexHeaders.append("font", value1); + + // Simple headers with one value-less entry; having at least one entry ensures + // we don't include initial memory allocation into a test, and having + // as few as possible reduces cost of copying (header re-set) + m_simpleHeaders.append(WKH::Accept, ""); +} + +void tst_QHttpHeaders::append_enum() +{ + QHttpHeaders headers; + QBENCHMARK { + headers = m_simpleHeaders; // (Re-)set as we'll modify the headers + headers.append(WKH::Link, value1); + } + QCOMPARE(headers.size(), m_simpleHeaders.size() + 1); + QCOMPARE(headers.nameAt(headers.size() - 1), "link"); +} + +void tst_QHttpHeaders::append_string_data() +{ + QTest::addColumn<QString>("name"); + QTest::newRow("Custom lowcase string") << customNameLowCase; + QTest::newRow("WellKnown lowcase string") << knownNameLowCase; + QTest::newRow("Custom mixcase string") << customNameMixCase; + QTest::newRow("WellKnown mixcase string") << knownNameMixCase; +} + +void tst_QHttpHeaders::append_string() +{ + QFETCH(QString, name); + + QHttpHeaders headers; + QBENCHMARK { + headers = m_simpleHeaders; // (Re-)set as we'll modify the headers + headers.append(name, value1); + } + QCOMPARE(headers.size(), m_simpleHeaders.size() + 1); + QCOMPARE(headers.nameAt(headers.size() - 1), name.toLower()); +} + +void tst_QHttpHeaders::contains_enum() +{ + QFETCH(WKH, name); + QFETCH(bool, exists); + + bool result; + QBENCHMARK { + result = m_complexHeaders.contains(name); + } + QCOMPARE(result, exists); +} + +void tst_QHttpHeaders::contains_string() +{ + QFETCH(QString, name); + QFETCH(bool, exists); + + bool result; + QBENCHMARK { + result = m_complexHeaders.contains(name); + } + QCOMPARE(result, exists); +} + +void tst_QHttpHeaders::values_enum() +{ + QFETCH(WKH, name); + QFETCH(bool, exists); + + QList<QByteArray> result; + const QList<QByteArray> expectedResult{"value3", "value1", "value2", "value4"}; + QBENCHMARK { + result = m_complexHeaders.values(name); + } + if (exists) + QCOMPARE(result, expectedResult); + else + QVERIFY(result.isEmpty()); +} + +void tst_QHttpHeaders::values_string() +{ + QFETCH(QString, name); + QFETCH(bool, exists); + + QList<QByteArray> result; + const QList<QByteArray> expectedResult{"value3", "value1", "value2", "value4"}; + QBENCHMARK { + result = m_complexHeaders.values(name); + } + if (exists) + QCOMPARE(result, expectedResult); + else + QVERIFY(result.isEmpty()); +} + +void tst_QHttpHeaders::combinedValue_enum() +{ + QFETCH(WKH, name); + QFETCH(bool, exists); + + QByteArray result; + constexpr QByteArrayView expectedResult = "value3, value1, value2, value4"; + QBENCHMARK { + result = m_complexHeaders.combinedValue(name); + } + if (exists) + QCOMPARE(result, expectedResult); + else + QVERIFY(result.isEmpty()); +} + +void tst_QHttpHeaders::combinedValue_string() +{ + QFETCH(QString, name); + QFETCH(bool, exists); + + QByteArray result; + constexpr QByteArrayView expectedResult = "value3, value1, value2, value4"; + QBENCHMARK { + result = m_complexHeaders.combinedValue(name); + } + if (exists) + QCOMPARE(result, expectedResult); + else + QVERIFY(result.isEmpty()); +} + +void tst_QHttpHeaders::removeAll_enum() +{ + QFETCH(WKH, name); + QFETCH(bool, exists); + + QHttpHeaders headers = m_complexHeaders; + QCOMPARE(headers.contains(name), exists); + QBENCHMARK { + headers = m_complexHeaders; // Restore as we'll modify the headers + headers.removeAll(name); + } + QVERIFY(!headers.contains(name)); +} + +void tst_QHttpHeaders::removeAll_string() +{ + QFETCH(QString, name); + QFETCH(bool, exists); + + QHttpHeaders headers = m_complexHeaders; + QCOMPARE(headers.contains(name), exists); + QBENCHMARK { + headers = m_complexHeaders; // Restore as we'll modify the headers + headers.removeAll(name); + } + QVERIFY(!headers.contains(name)); +} + +QTEST_MAIN(tst_QHttpHeaders) + +#include "tst_bench_qhttpheaders.moc" diff --git a/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index c88787d9de..c70248f590 100644 --- a/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QNetworkDiskCache> #include <QNetworkCacheMetaData> diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index bb11a97f40..bab2743513 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // This file contains benchmarks for QNetworkReply functions. #include <QDebug> diff --git a/tests/benchmarks/network/access/qnetworkreply_from_cache/tst_qnetworkreply_from_cache.cpp b/tests/benchmarks/network/access/qnetworkreply_from_cache/tst_qnetworkreply_from_cache.cpp index fdc2d99b12..c18daa8195 100644 --- a/tests/benchmarks/network/access/qnetworkreply_from_cache/tst_qnetworkreply_from_cache.cpp +++ b/tests/benchmarks/network/access/qnetworkreply_from_cache/tst_qnetworkreply_from_cache.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2012 Hewlett-Packard Development Company, L.P. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QBuffer> diff --git a/tests/benchmarks/network/kernel/qhostinfo/main.cpp b/tests/benchmarks/network/kernel/qhostinfo/main.cpp index 078abfaa93..66e4f52ec2 100644 --- a/tests/benchmarks/network/kernel/qhostinfo/main.cpp +++ b/tests/benchmarks/network/kernel/qhostinfo/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> diff --git a/tests/benchmarks/network/socket/CMakeLists.txt b/tests/benchmarks/network/socket/CMakeLists.txt index 034f618737..411a933dbb 100644 --- a/tests/benchmarks/network/socket/CMakeLists.txt +++ b/tests/benchmarks/network/socket/CMakeLists.txt @@ -1,6 +1,12 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -add_subdirectory(qlocalsocket) +if(QT_FEATURE_localserver) + add_subdirectory(qlocalsocket) +endif() + +if(QT_FEATURE_udpsocket) + add_subdirectory(qudpsocket) +endif() + add_subdirectory(qtcpserver) -add_subdirectory(qudpsocket) diff --git a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 6c779b6188..a28869f24c 100644 --- a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // Copyright (C) 2021 Alex Trotsenko <alex1973tr@gmail.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtTest/qtesteventloop.h> diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index 501b5c37b4..68d60261d5 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtCore/QElapsedTimer> diff --git a/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp index c41a5b3b18..d3ef636e74 100644 --- a/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtCore/qglobal.h> diff --git a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp index de7c6e186c..fd5f49863a 100644 --- a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> diff --git a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp index 4e2769ab05..d73b2477fa 100644 --- a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp +++ b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <qtest.h> diff --git a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp index 62a3f7b233..5c1bc7b88e 100644 --- a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp +++ b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtSql/QtSql> diff --git a/tests/benchmarks/sql/kernel/qsqlrecord/tst_bench_qsqlrecord.cpp b/tests/benchmarks/sql/kernel/qsqlrecord/tst_bench_qsqlrecord.cpp index 62298a6fc5..55ec1983ee 100644 --- a/tests/benchmarks/sql/kernel/qsqlrecord/tst_bench_qsqlrecord.cpp +++ b/tests/benchmarks/sql/kernel/qsqlrecord/tst_bench_qsqlrecord.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtSql/QtSql> diff --git a/tests/benchmarks/testlib/tostring/tst_tostring.cpp b/tests/benchmarks/testlib/tostring/tst_tostring.cpp index c72ec220b1..e00b12ef53 100644 --- a/tests/benchmarks/testlib/tostring/tst_tostring.cpp +++ b/tests/benchmarks/testlib/tostring/tst_tostring.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtCore/qmath.h> // pi, e diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp index 9b31bf88db..fa47ca9fa6 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> @@ -541,23 +541,11 @@ void tst_GraphicsViewBenchmark::update_data() QTest::addColumn<bool>("subtreeCache"); QTest::addColumn<int>("rotationAngle"); - QList<ListType> listTypes; - listTypes << Simple << Recycling; - - QList<int> listSizes; - listSizes << 10 << 50 << 500; - - QList<Theme::Themes> themes; - themes << Theme::Blue << Theme::Lime; - - QList<int> rotationAngles; - rotationAngles << 0 << 90; - // Generate rows: - foreach (ListType listType, listTypes) { - foreach (int listSize, listSizes) { - foreach (int angle, rotationAngles) { - foreach (Theme::Themes theme, themes) { + for (ListType listType : {Simple, Recycling}) { + for (int listSize : {10, 50, 500}) { + for (int angle : {0, 90}) { + for (Theme::Themes theme : {Theme::Blue, Theme::Lime}) { for (int toImage = 0; toImage < 2; ++toImage) { for (int cache = 0; cache < 2; ++cache) { QString string = rowString(listSize, listType, theme, toImage, cache, angle); @@ -613,27 +601,12 @@ void tst_GraphicsViewBenchmark::scroll_data() QTest::addColumn<int>("rotationAngle"); QTest::addColumn<ScrollStep>("scrollStep"); - QList<ListType> listTypes; - listTypes << Simple << Recycling; - - QList<int> listSizes; - listSizes << 10 << 50 << 500; - - QList<Theme::Themes> themes; - themes << Theme::Blue << Theme::Lime; - - QList<int> rotationAngles; - rotationAngles << 0 << 90; - - QList<ScrollStep> scrollSteps; - scrollSteps << Slow << Normal << Fast; - // Generate rows: - foreach (ListType listType, listTypes) { - foreach (int listSize, listSizes) { - foreach (int angle, rotationAngles) { - foreach (ScrollStep step, scrollSteps) { - foreach (Theme::Themes theme, themes) { + for (ListType listType : {Simple, Recycling}) { + for (int listSize : {10, 50, 500}) { + for (int angle : {0, 90}) { + for (ScrollStep step : {Slow, Normal, Fast}) { + for (Theme::Themes theme : {Theme::Blue, Theme::Lime}) { for (int cache = 0; cache < 2; ++cache) { QString string = rowString(listSize, listType, theme, cache, angle, step); QTest::newRow(string.toLatin1()) << listSize << listType << theme diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp index 18cebe4ab6..9cf6ffcaa2 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QGraphicsLayout> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h index 7c2d20be6c..d3d1b334f4 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ABSTRACTITEMCONTAINER_H #define ABSTRACTITEMCONTAINER_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp index adfe2aa64e..87350f6b62 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsLayout> #include "abstractitemview.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h index 91c3c49876..6242c9647b 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ABSTRACTITEMVIEW_H #define ABSTRACTITEMVIEW_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp index 804d613225..c390550cb9 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsSceneResizeEvent> #include <QGraphicsWidget> @@ -90,9 +90,9 @@ void AbstractScrollArea::setViewport(QGraphicsWidget *viewport) if (m_viewport) { m_viewport->setParentItem(0); - QList<QGraphicsItem*> children = m_viewport->childItems(); + const QList<QGraphicsItem*> children = m_viewport->childItems(); - foreach (QGraphicsItem *child, children) + for (QGraphicsItem *child : children) child->setParentItem(0); delete m_viewport; diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h index ba98d444c7..0fefcfe271 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ABSTRACTSCROLLAREA_H #define ABSTRACTSCROLLAREA_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp index 4517c4da2a..b12cf4c81a 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "abstractviewitem.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h index b44c07f929..c85ad3d203 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ABSTRACTVIEWITEM_H #define ABSTRACTVIEWITEM_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp index e5ec3a7dd1..16eeb25467 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QStyleOptionGraphicsItem> #include <QGraphicsSceneResizeEvent> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h index 3ff1cc8bcc..ba961e2792 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __BACKGROUNDITEM_H__ #define __BACKGROUNDITEM_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp index 0839dd2c00..d9d6e48f99 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "button.h" #include "theme.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h index c14d358ae0..0c117d2c81 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef BUTTON_H #define BUTTON_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp index b109ff2400..492eb95628 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QStringList> #include <QDebug> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h index 63f0cadd73..59be7e87f1 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef COMMANDLINE_H #define COMMANDLINE_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp index bf8f1608e1..19cbb62770 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QFile> #include <QRandomGenerator> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h index 1b6050b2e2..114380c264 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __DUMMYDATAGEN_H__ #define __DUMMYDATAGEN_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp index b4b1e261ee..efa35db679 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> #include "gvbwidget.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h index 7c87fc4629..54d7cac5a5 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef GVBWIDGET_H #define GVBWIDGET_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp index 20753d2cc0..088f517105 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> #include <QSvgRenderer> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h index 1e964a4b02..53bcce2466 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ICONITEM_H #define ICONITEM_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp index 3d7bfe0c8c..3e9669cd44 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QElapsedTimer> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h index b5fae28022..7dc6b3e224 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ITEMRECYCLINGLIST_H #define ITEMRECYCLINGLIST_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp index 41242ddae9..7406c37677 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "itemrecyclinglistview.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h index c1bb616539..b7ab0f3004 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef ITEMRECYCLINGLISTVIEW_H #define ITEMRECYCLINGLISTVIEW_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp index b2027fdb80..c09043df93 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h index 906cbcf8dd..6d6705027e 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef TEXTITEM_H #define TEXTITEM_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp index 5478f4705d..6c11effa28 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QGraphicsGridLayout> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h index e91b5175d9..01c1d61ea4 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef LISTITEM_H #define LISTITEM_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp index 646bd57b1d..ed8943aa7b 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsItem> #include <QPainter> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h index d69fc363b2..0827ae1cea 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef LISTITEMCACHE_H #define LISTITEMCACHE_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp index 3bc7562972..5815dfa103 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qmath.h> #include <QGraphicsLinearLayout> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h index a792e981bf..6c03a9e116 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef LISTITEMCONTAINER_H #define LISTITEMCONTAINER_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp index 882e5bea7b..eb10745328 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "listmodel.h" #include "recycledlistitem.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h index 0af3e67ad4..b6fdbcb837 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef LISTMODEL_H #define LISTMODEL_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp index 48a4073210..fbb82777b9 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsSceneResizeEvent> #include <QGraphicsGridLayout> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h index da92880544..cbd23ca19a 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef LISTWIDGET_H #define LISTWIDGET_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp index af5008a399..1f92107729 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QApplication> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h index edb2538e0a..d2ff03f039 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __MAINWINDOW_H__ #define __MAINWINDOW_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp index 71b12311af..8c2ff7b7ce 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsView> #include <QGraphicsWidget> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h index 94bb0de81b..fd50fe5039 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __MENU_H__ #define __MENU_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp index fe0c06d94f..a457b69be9 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsGridLayout> #include <QDebug> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h index cd9361a08c..82dd304b38 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef RECYCLEDLISTITEM_H #define RECYCLEDLISTITEM_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h index 026a9df650..6d58d139bb 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __RESOURCEMONINTERFACE_H__ #define __RESOURCEMONINTERFACE_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp index ab0b538507..3361c1e1c0 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsWidget> #include <QPainter> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h index 2bdf9eb837..9abd5d264b 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SCROLLBAR_H #define SCROLLBAR_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp index 1a0f88d339..241d752365 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QScrollBar> #include <QEvent> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h index 0bbebb9f38..db9c47d838 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SCROLLER_H #define SCROLLER_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h index 8d77f933a9..c18f4069e3 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SCROLLER_P_H #define SCROLLER_P_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp index 4e4b751912..4b0adffe5c 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "settings.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h index 0ba090287e..da961493ad 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SETTINGS_H #define SETTINGS_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp index 282bb3e262..0020e2491d 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QGraphicsLinearLayout> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h index 33b769c854..ef29d5c855 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SIMPLELIST_H_ #define SIMPLELIST_H_ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp index 198fd92192..3de5554e61 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "simplelistview.h" #include "scrollbar.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h index a46840ec4c..32ed0af937 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef SIMPLELISTVIEW_H #define SIMPLELISTVIEW_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp index 5164fe0a65..8de0b612df 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QPainter> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h index 5f246d0e6e..b78a9033f9 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef THEME_H #define THEME_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp index 24378871df..4df67b63bf 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "themeevent.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h index 00a158850a..4b06f54267 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __THEMEEVENT_H__ #define __THEMEEVENT_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp index 3f39af465b..ece0cfa66f 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGraphicsView> #include <QStyleOptionGraphicsItem> diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h index ede4320a73..152b4ba2b6 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef __TOPBAR_H__ #define __TOPBAR_H__ diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp index 0257e8b295..c3c14a6362 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "webview.h" #include "webview_p.h" diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h index e9418db73e..8eafb65048 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef WEBVIEW_H #define WEBVIEW_H diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h index 713160e0aa..f0c87e5a0f 100644 --- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h +++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef WEBVIEW_P_H #define WEBVIEW_P_H diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index d7b4d37faa..d65246a568 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtWidgets/qgraphicsanchorlayout.h> diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index efeecf4989..7556864ded 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QGraphicsItem> diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp index 066c981455..f583606266 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QGraphicsLayout> diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index db13cfc759..6dd9dc7d9a 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QGraphicsLinearLayout> diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index f88f477e18..cc53100a43 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QGraphicsItem> diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp index e469e10576..94c779658d 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "chip.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.h b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.h index 5d0cfa6588..5852b5055e 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.h +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef CHIP_H #define CHIP_H diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp index f5eaf40ce1..e2c6a943dd 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "mainwindow.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp index 880a334be3..48aa7f5d71 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "mainwindow.h" #include "view.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h index fe08c5d2f6..aae2435a32 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef MAINWINDOW_H #define MAINWINDOW_H diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp index b4e7947c3a..4689532eae 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "view.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.h b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.h index 5e34b91320..d3cbea87d9 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.h +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef VIEW_H #define VIEW_H diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp index 15e4bc1268..f6ab1c6714 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> #include "valgrind/callgrind.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp index 2c2071a6db..acd0b38ec1 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui> #include "valgrind/callgrind.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp index 5e642d6313..fc81c460ce 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "chip.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.h b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.h index 4d55341de8..ce5fb5222e 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.h +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef CHIP_H #define CHIP_H diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp index 9e92680626..d6c0b46487 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "chiptester.h" #include "chip.h" diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h index d6c0a5e767..7be17d7144 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef CHIPTESTER_H #define CHIPTESTER_H diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 4c05e36872..cefbc75e76 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore/QDebug> diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index a4c48aa6a1..fb274160fa 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QGraphicsItem> diff --git a/tests/benchmarks/widgets/itemviews/qheaderview/qheaderviewbench.cpp b/tests/benchmarks/widgets/itemviews/qheaderview/qheaderviewbench.cpp index a2851e6ccf..f04ca82cdc 100644 --- a/tests/benchmarks/widgets/itemviews/qheaderview/qheaderviewbench.cpp +++ b/tests/benchmarks/widgets/itemviews/qheaderview/qheaderviewbench.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2012 Thorbjørn Lund Martsum - tmartsum[at]gmail.com -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtWidgets/QtWidgets> diff --git a/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp index 700074ca92..2e588adc58 100644 --- a/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QListView> diff --git a/tests/benchmarks/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/benchmarks/widgets/itemviews/qtableview/tst_qtableview.cpp index 5a74c3065b..e625066800 100644 --- a/tests/benchmarks/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/benchmarks/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QDebug> @@ -233,13 +233,13 @@ void tst_QTableView::rowInsertion_data() void tst_QTableView::rowInsertion() { - QFETCH(SpanList, spans); + QFETCH(const SpanList, spans); QtTestTableModel model(10, 10); QTableView view; view.setModel(&model); - foreach (QRect span, spans) + for (QRect span : spans) view.setSpan(span.top(), span.left(), span.height(), span.width()); view.show(); QTest::qWait(50); @@ -259,13 +259,13 @@ void tst_QTableView::rowRemoval_data() void tst_QTableView::rowRemoval() { - QFETCH(SpanList, spans); + QFETCH(const SpanList, spans); QtTestTableModel model(10, 10); QTableView view; view.setModel(&model); - foreach (QRect span, spans) + for (QRect span : spans) view.setSpan(span.top(), span.left(), span.height(), span.width()); view.show(); QTest::qWait(50); @@ -282,14 +282,14 @@ void tst_QTableView::columnInsertion_data() void tst_QTableView::columnInsertion() { - QFETCH(SpanList, spans); + QFETCH(const SpanList, spans); QtTestTableModel model(10, 10); QTableView view; view.setModel(&model); // Same set as for rowInsertion, just swapping columns and rows. - foreach (QRect span, spans) + for (QRect span : spans) view.setSpan(span.left(), span.top(), span.width(), span.height()); view.show(); QTest::qWait(50); @@ -309,14 +309,14 @@ void tst_QTableView::columnRemoval_data() void tst_QTableView::columnRemoval() { - QFETCH(SpanList, spans); + QFETCH(const SpanList, spans); QtTestTableModel model(10, 10); QTableView view; view.setModel(&model); // Same set as for rowRemoval, just swapping columns and rows. - foreach (QRect span, spans) + for (QRect span : spans) view.setSpan(span.left(), span.top(), span.width(), span.height()); view.show(); QTest::qWait(50); diff --git a/tests/benchmarks/widgets/kernel/qapplication/main.cpp b/tests/benchmarks/widgets/kernel/qapplication/main.cpp index d6044cda25..5ada0728e7 100644 --- a/tests/benchmarks/widgets/kernel/qapplication/main.cpp +++ b/tests/benchmarks/widgets/kernel/qapplication/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QApplication> #include <qtest.h> diff --git a/tests/benchmarks/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/widgets/kernel/qwidget/tst_qwidget.cpp index 7e24d23c96..4f55fbc84c 100644 --- a/tests/benchmarks/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/benchmarks/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> @@ -49,7 +49,7 @@ public: void setOpaqueChildren(bool enable) { if (opaqueChildren != enable) { - foreach (QWidget *w, children) + for (QWidget *w : std::as_const(children)) w->setAttribute(Qt::WA_OpaquePaintEvent, enable); opaqueChildren = enable; processEvents(); diff --git a/tests/benchmarks/widgets/styles/qstylesheetstyle/main.cpp b/tests/benchmarks/widgets/styles/qstylesheetstyle/main.cpp index 2d7166ada8..011914dae2 100644 --- a/tests/benchmarks/widgets/styles/qstylesheetstyle/main.cpp +++ b/tests/benchmarks/widgets/styles/qstylesheetstyle/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // This file contains benchmarks for QRect/QRectF functions. #include <QtWidgets/QWidget> diff --git a/tests/benchmarks/widgets/widgets/qtextbrowser/main.cpp b/tests/benchmarks/widgets/widgets/qtextbrowser/main.cpp index 7375e5b414..ad4e370d36 100644 --- a/tests/benchmarks/widgets/widgets/qtextbrowser/main.cpp +++ b/tests/benchmarks/widgets/widgets/qtextbrowser/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDebug> #include <QTextBrowser> |