summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/kernel/qproperty
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/kernel/qproperty')
-rw-r--r--tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/qproperty/propertytester.h29
-rw-r--r--tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp (renamed from tests/benchmarks/corelib/kernel/qproperty/main.cpp)60
3 files changed, 25 insertions, 71 deletions
diff --git a/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt
index d6fc1c5a14..1a26f28f05 100644
--- a/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt
+++ b/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt
@@ -1,8 +1,11 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_benchmark(tst_bench_qproperty
SOURCES
- main.cpp
+ tst_bench_qproperty.cpp
propertytester.h
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::Test
)
diff --git a/tests/benchmarks/corelib/kernel/qproperty/propertytester.h b/tests/benchmarks/corelib/kernel/qproperty/propertytester.h
index daf55f8396..a89d51c286 100644
--- a/tests/benchmarks/corelib/kernel/qproperty/propertytester.h
+++ b/tests/benchmarks/corelib/kernel/qproperty/propertytester.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 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) 2021 The Qt Company Ltd.
+// 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/main.cpp b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp
index 5d6db35d2b..c91ca1ea11 100644
--- a/tests/benchmarks/corelib/kernel/qproperty/main.cpp
+++ b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 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) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QScopedPointer>
#include <QProperty>
@@ -33,7 +8,7 @@
#include "propertytester.h"
-class PropertyBenchmark : public QObject
+class tst_QProperty : public QObject
{
Q_OBJECT
private slots:
@@ -53,7 +28,7 @@ private slots:
void cppNotifyingDirectReadOnce();
};
-void PropertyBenchmark::cppOldBinding()
+void tst_QProperty::cppOldBinding()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@@ -70,7 +45,7 @@ void PropertyBenchmark::cppOldBinding()
QObject::disconnect(connection);
}
-void PropertyBenchmark::cppOldBindingDirect()
+void tst_QProperty::cppOldBindingDirect()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@@ -87,7 +62,7 @@ void PropertyBenchmark::cppOldBindingDirect()
QObject::disconnect(connection);
}
-void PropertyBenchmark::cppOldBindingReadOnce()
+void tst_QProperty::cppOldBindingReadOnce()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@@ -103,7 +78,7 @@ void PropertyBenchmark::cppOldBindingReadOnce()
QObject::disconnect(connection);
}
-void PropertyBenchmark::cppOldBindingDirectReadOnce()
+void tst_QProperty::cppOldBindingDirectReadOnce()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@@ -119,7 +94,7 @@ void PropertyBenchmark::cppOldBindingDirectReadOnce()
QObject::disconnect(connection);
}
-void PropertyBenchmark::cppNewBinding()
+void tst_QProperty::cppNewBinding()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();});
@@ -133,7 +108,7 @@ void PropertyBenchmark::cppNewBinding()
}
}
-void PropertyBenchmark::cppNewBindingDirect()
+void tst_QProperty::cppNewBindingDirect()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();});
@@ -146,7 +121,7 @@ void PropertyBenchmark::cppNewBindingDirect()
}
}
-void PropertyBenchmark::cppNewBindingReadOnce()
+void tst_QProperty::cppNewBindingReadOnce()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();});
@@ -160,7 +135,7 @@ void PropertyBenchmark::cppNewBindingReadOnce()
QCOMPARE(tester->property("y").toInt(), i);
}
-void PropertyBenchmark::cppNewBindingDirectReadOnce()
+void tst_QProperty::cppNewBindingDirectReadOnce()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();});
@@ -173,7 +148,7 @@ void PropertyBenchmark::cppNewBindingDirectReadOnce()
QCOMPARE(tester->y.value(), i);
}
-void PropertyBenchmark::cppNotifying()
+void tst_QProperty::cppNotifying()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@@ -187,7 +162,7 @@ void PropertyBenchmark::cppNotifying()
}
}
-void PropertyBenchmark::cppNotifyingDirect()
+void tst_QProperty::cppNotifyingDirect()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@@ -200,7 +175,7 @@ void PropertyBenchmark::cppNotifyingDirect()
}
}
-void PropertyBenchmark::cppNotifyingReadOnce()
+void tst_QProperty::cppNotifyingReadOnce()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@@ -214,7 +189,7 @@ void PropertyBenchmark::cppNotifyingReadOnce()
QCOMPARE(tester->property("yNotified").toInt(), i);
}
-void PropertyBenchmark::cppNotifyingDirectReadOnce()
+void tst_QProperty::cppNotifyingDirectReadOnce()
{
QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@@ -227,5 +202,6 @@ void PropertyBenchmark::cppNotifyingDirectReadOnce()
QCOMPARE(tester->yNotified.value(), i);
}
-QTEST_MAIN(PropertyBenchmark)
-#include "main.moc"
+QTEST_MAIN(tst_QProperty)
+
+#include "tst_bench_qproperty.moc"