diff options
Diffstat (limited to 'tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp')
-rw-r--r-- | tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp b/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp index 55c1e72a3e..f03086342c 100644 --- a/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp +++ b/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.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 <QTest> @@ -1087,7 +1062,7 @@ void tst_QByteArrayApiSymmetry::toInt_data() const QTest::newRow("base 0-1") << QByteArray("0x10") << 0 << 16 << true; QTest::newRow("base 0-2") << QByteArray("10") << 0 << 10 << true; QTest::newRow("base 0-3") << QByteArray("010") << 0 << 8 << true; - QTest::newRow("empty") << QByteArray() << 0 << 0 << false; + QTest::newRow("base 0 empty") << QByteArray() << 0 << 0 << false; QTest::newRow("leading space") << QByteArray(" 100") << 10 << 100 << true; QTest::newRow("trailing space") << QByteArray("100 ") << 10 << 100 << true; @@ -1196,8 +1171,13 @@ void tst_QByteArrayApiSymmetry::toLong_data() const QTest::newRow("int32 max dec") << QByteArray("2147483647") << 10 << long(B32::max()) << true; if constexpr (sizeof(long) < sizeof(qlonglong)) { + QT_WARNING_PUSH + // See: https://github.com/llvm/llvm-project/issues/59448 + QT_WARNING_DISABLE_CLANG("-Winteger-overflow") const qlonglong longMaxPlusOne = static_cast<qlonglong>(Bounds::max()) + 1; const qlonglong longMinMinusOne = static_cast<qlonglong>(Bounds::min()) - 1; + QT_WARNING_POP + QTest::newRow("long max + 1") << QByteArray::number(longMaxPlusOne) << 10 << 0L << false; QTest::newRow("long min - 1") << QByteArray::number(longMinMinusOne) << 10 << 0L << false; } |