diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-08 09:27:37 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-08 09:27:38 +0100 |
commit | 332ce6734d29fb03852d04de6bc648289ff1c35d (patch) | |
tree | 30713dba37e3a98c7606c18f044ab4a815863288 /tests/auto/other | |
parent | 2056bc6bc51efa1da61098ba3d213a4e25d9e7d8 (diff) | |
parent | caa5a20479bd58fda4380181691f772a1f3c1da4 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/other.pro | 2 | ||||
-rw-r--r-- | tests/auto/other/qobjectperformance/.gitignore | 1 | ||||
-rw-r--r-- | tests/auto/other/qobjectperformance/qobjectperformance.pro | 7 | ||||
-rw-r--r-- | tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp | 110 |
4 files changed, 0 insertions, 120 deletions
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro index 4119a40279..ea2e1dabf2 100644 --- a/tests/auto/other/other.pro +++ b/tests/auto/other/other.pro @@ -16,7 +16,6 @@ SUBDIRS=\ qcomplextext \ qfocusevent \ qnetworkaccessmanager_and_qprogressdialog \ - qobjectperformance \ qobjectrace \ qsharedpointer_and_qwidget \ qprocess_and_guieventloop \ @@ -44,7 +43,6 @@ SUBDIRS=\ lancelot \ networkselftest \ qnetworkaccessmanager_and_qprogressdialog \ - qobjectperformance cross_compile: SUBDIRS -= \ atwrapper \ diff --git a/tests/auto/other/qobjectperformance/.gitignore b/tests/auto/other/qobjectperformance/.gitignore deleted file mode 100644 index 028ca89aad..0000000000 --- a/tests/auto/other/qobjectperformance/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qobjectperformance diff --git a/tests/auto/other/qobjectperformance/qobjectperformance.pro b/tests/auto/other/qobjectperformance/qobjectperformance.pro deleted file mode 100644 index 189f8eeb2a..0000000000 --- a/tests/auto/other/qobjectperformance/qobjectperformance.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG += testcase -TARGET = tst_qobjectperformance -SOURCES += tst_qobjectperformance.cpp - -QT = core network testlib - - diff --git a/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp b/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp deleted file mode 100644 index cbff6b7caf..0000000000 --- a/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - - -#include <QtTest/QtTest> - -#include <qcoreapplication.h> - -#include <qobject.h> - -class tst_QObjectPerformance : public QObject -{ - Q_OBJECT - -public: - -private slots: - void emitToManyReceivers(); -}; - -class SimpleSenderObject : public QObject -{ - Q_OBJECT - -signals: - void signal(); - -public: - void emitSignal() - { - emit signal(); - } -}; - -class SimpleReceiverObject : public QObject -{ - Q_OBJECT - -public slots: - void slot() - { - } -}; - -void tst_QObjectPerformance::emitToManyReceivers() -{ - // ensure that emission times remain mostly linear as the number of receivers increase - - SimpleSenderObject sender; - int elapsed = 0; - const int increase = 3000; - const int base = 5000; - - for (int i = 0; i < 4; ++i) { - const int size = base + i * increase; - const double increaseRatio = double(size) / (double)(size - increase); - - QList<SimpleReceiverObject *> receivers; - for (int k = 0; k < size; ++k) { - SimpleReceiverObject *receiver = new SimpleReceiverObject; - QObject::connect(&sender, SIGNAL(signal()), receiver, SLOT(slot())); - receivers.append(receiver); - } - - QTime timer; - timer.start(); - sender.emitSignal(); - int e = timer.elapsed(); - - if (elapsed > 1) { - qDebug() << size << "receivers, elapsed time" << e << "compared to previous time" << elapsed; - QVERIFY(double(e) / double(elapsed) <= increaseRatio * 2.0); - } else { - qDebug() << size << "receivers, elapsed time" << e << "cannot be compared to previous, unmeasurable time"; - } - elapsed = e; - - qDeleteAll(receivers); - receivers.clear(); - } -} - - -QTEST_MAIN(tst_QObjectPerformance) -#include "tst_qobjectperformance.moc" |