summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/tools/qrect
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/tools/qrect')
-rw-r--r--tests/benchmarks/corelib/tools/qrect/CMakeLists.txt10
-rw-r--r--tests/benchmarks/corelib/tools/qrect/qrect.pro6
-rw-r--r--tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp (renamed from tests/benchmarks/corelib/tools/qrect/main.cpp)85
3 files changed, 35 insertions, 66 deletions
diff --git a/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt b/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt
index 30234c7055..e28ca82c74 100644
--- a/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt
+++ b/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qrect.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qrect Binary:
@@ -6,10 +7,7 @@
qt_internal_add_benchmark(tst_bench_qrect
SOURCES
- main.cpp
- PUBLIC_LIBRARIES
+ tst_bench_qrect.cpp
+ LIBRARIES
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qrect.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/tools/qrect/qrect.pro b/tests/benchmarks/corelib/tools/qrect/qrect.pro
deleted file mode 100644
index 211cdc5bcc..0000000000
--- a/tests/benchmarks/corelib/tools/qrect/qrect.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE = app
-QT = core testlib
-CONFIG += benchmark
-
-TARGET = tst_bench_qrect
-SOURCES += main.cpp
diff --git a/tests/benchmarks/corelib/tools/qrect/main.cpp b/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp
index 485e0290f8..0ba9e15963 100644
--- a/tests/benchmarks/corelib/tools/qrect/main.cpp
+++ b/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp
@@ -1,36 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// 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>
-class tst_qrect : public QObject
+class tst_QRect : public QObject
{
Q_OBJECT
private slots:
@@ -159,12 +136,12 @@ static void addRectPointData(bool includeProperArg = false)
}
}
-void tst_qrect::contains_point_data()
+void tst_QRect::contains_point_data()
{
addRectPointData(true);
}
-void tst_qrect::contains_point()
+void tst_QRect::contains_point()
{
QFETCH(QRectF, rf);
QFETCH(QPointF, pf);
@@ -176,12 +153,12 @@ void tst_qrect::contains_point()
}
}
-void tst_qrect::contains_rect_data()
+void tst_QRect::contains_rect_data()
{
addRectRectData(true);
}
-void tst_qrect::contains_rect()
+void tst_QRect::contains_rect()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
@@ -193,12 +170,12 @@ void tst_qrect::contains_rect()
}
}
-void tst_qrect::intersects_data()
+void tst_QRect::intersects_data()
{
addRectRectData();
}
-void tst_qrect::intersects()
+void tst_QRect::intersects()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
@@ -209,44 +186,44 @@ void tst_qrect::intersects()
}
}
-void tst_qrect::intersected_data()
+void tst_QRect::intersected_data()
{
addRectRectData();
}
-void tst_qrect::intersected()
+void tst_QRect::intersected()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
QRect r1(rf1.toRect());
QRect r2(rf2.toRect());
QBENCHMARK {
- r1.intersected(r2);
+ Q_UNUSED(r1.intersected(r2))
}
}
-void tst_qrect::united_data()
+void tst_QRect::united_data()
{
addRectRectData();
}
-void tst_qrect::united()
+void tst_QRect::united()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
QRect r1(rf1.toRect());
QRect r2(rf2.toRect());
QBENCHMARK {
- r1.united(r2);
+ Q_UNUSED(r1.united(r2))
}
}
-void tst_qrect::contains_point_f_data()
+void tst_QRect::contains_point_f_data()
{
addRectPointData();
}
-void tst_qrect::contains_point_f()
+void tst_QRect::contains_point_f()
{
QFETCH(QRectF, rf);
QFETCH(QPointF, pf);
@@ -255,12 +232,12 @@ void tst_qrect::contains_point_f()
}
}
-void tst_qrect::contains_rect_f_data()
+void tst_QRect::contains_rect_f_data()
{
addRectRectData();
}
-void tst_qrect::contains_rect_f()
+void tst_QRect::contains_rect_f()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
@@ -269,12 +246,12 @@ void tst_qrect::contains_rect_f()
}
}
-void tst_qrect::intersects_f_data()
+void tst_QRect::intersects_f_data()
{
addRectRectData();
}
-void tst_qrect::intersects_f()
+void tst_QRect::intersects_f()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
@@ -283,34 +260,34 @@ void tst_qrect::intersects_f()
}
}
-void tst_qrect::intersected_f_data()
+void tst_QRect::intersected_f_data()
{
addRectRectData();
}
-void tst_qrect::intersected_f()
+void tst_QRect::intersected_f()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
QBENCHMARK {
- rf1.intersected(rf2);
+ Q_UNUSED(rf1.intersected(rf2))
}
}
-void tst_qrect::united_f_data()
+void tst_QRect::united_f_data()
{
addRectRectData();
}
-void tst_qrect::united_f()
+void tst_QRect::united_f()
{
QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2);
QBENCHMARK {
- rf1.united(rf2);
+ Q_UNUSED(rf1.united(rf2))
}
}
-QTEST_MAIN(tst_qrect)
+QTEST_MAIN(tst_QRect)
-#include "main.moc"
+#include "tst_bench_qrect.moc"