diff options
Diffstat (limited to 'tests/auto/corelib/global/qglobalstatic')
-rw-r--r-- | tests/auto/corelib/global/qglobalstatic/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp | 39 |
2 files changed, 19 insertions, 31 deletions
diff --git a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt index ea978bdadb..6707e46dff 100644 --- a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt +++ b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt @@ -1,14 +1,21 @@ -# Generated from qglobalstatic.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qglobalstatic Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qglobalstatic LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qglobalstatic EXCEPTIONS SOURCES tst_qglobalstatic.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::TestPrivate ) diff --git a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp index 626c3757da..b8836668f5 100644 --- a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp +++ b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp @@ -1,31 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Thiago Macieira <thiago@kde.org> -** Copyright (C) 2016 Intel Corporation. -** 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 Thiago Macieira <thiago@kde.org> +// Copyright (C) 2016 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/QThread> #include <QTest> @@ -148,7 +123,7 @@ void tst_QGlobalStatic::exception() exceptionCaught = true; } QVERIFY(exceptionCaught); - QCOMPARE(Q_QGS_throwingGS::guard.loadRelaxed(), 0); + QCOMPARE(QtGlobalStatic::Holder<Q_QGS_throwingGS>::guard.loadRelaxed(), 0); QVERIFY(!throwingGS.exists()); QVERIFY(!throwingGS.isDestroyed()); } @@ -206,7 +181,13 @@ void tst_QGlobalStatic::threadStressTest() if (expectedConstructionCount <= 0) QSKIP("This test cannot be run more than once"); +#ifdef Q_OS_INTEGRITY + // OPEN_REALTIME_THREADS = 123 on current INTEGRITY environment + // if try to create more, app is halted + const int numThreads = 122; +#else const int numThreads = 200; +#endif ThreadStressTestThread threads[numThreads]; QReadWriteLock lock; lock.lockForWrite(); |