diff options
Diffstat (limited to 'tests/auto/widgets/kernel/qsizepolicy')
-rw-r--r-- | tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp | 36 |
2 files changed, 15 insertions, 32 deletions
diff --git a/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt b/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt index 36450d4f80..efdd72db73 100644 --- a/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt +++ b/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt @@ -1,13 +1,20 @@ -# Generated from qsizepolicy.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qsizepolicy Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qsizepolicy LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qsizepolicy SOURCES tst_qsizepolicy.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::Widgets Qt::WidgetsPrivate diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp index d6a5ec218d..19d267f7e5 100644 --- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp +++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp @@ -1,32 +1,6 @@ -/**************************************************************************** -** -** 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 -#include <QTest> #include <qsizepolicy.h> Q_DECLARE_METATYPE(Qt::Orientations) @@ -34,6 +8,8 @@ Q_DECLARE_METATYPE(QSizePolicy) Q_DECLARE_METATYPE(QSizePolicy::Policy) Q_DECLARE_METATYPE(QSizePolicy::ControlType) +#include <QTest> + class tst_QSizePolicy : public QObject { Q_OBJECT @@ -109,7 +85,7 @@ void tst_QSizePolicy::constExpr() { /* gcc < 4.8.0 has problems with init'ing variant members in constexpr ctors */ /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54922 */ -#if !defined(Q_CC_GNU) || defined(Q_CC_INTEL) || defined(Q_CC_CLANG) || Q_CC_GNU >= 408 +#if !defined(Q_CC_GNU) || defined(Q_CC_CLANG) || Q_CC_GNU >= 408 // check that certain ctors are constexpr (compile-only): { constexpr QSizePolicy sp; Q_UNUSED(sp); } { constexpr QSizePolicy sp = QSizePolicy(); Q_UNUSED(sp); } @@ -119,7 +95,7 @@ void tst_QSizePolicy::constExpr() { // QTBUG-69983: For ControlType != QSizePolicy::DefaultType, qCountTrailingZeroBits() // is used, which MSVC 15.8.1 does not consider constexpr due to built-ins -# if defined(QT_HAS_CONSTEXPR_BUILTINS) && (!defined(Q_CC_MSVC) || _MSC_VER < 1915) +# if defined(QT_HAS_CONSTEXPR_BITOPS) constexpr auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::CheckBox); # else constexpr auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType); |