diff options
Diffstat (limited to 'tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp')
-rw-r--r-- | tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp index 859854dfbc..cb2ede7db6 100644 --- a/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp +++ b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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> @@ -34,9 +9,7 @@ #include <numeric> #include <string> -#if QT_CONFIG(cxx11_future) -# include <thread> -#endif +#include <thread> // COM interface #if defined(Q_OS_WIN) && defined(interface) @@ -116,12 +89,12 @@ void tst_QByteArrayMatcher::interface() QCOMPARE(matcher5.indexIn(haystack), 42); QCOMPARE(matcher6.indexIn(haystack), 42); - QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.length()), 42); + QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.size()), 42); QCOMPARE(matcher1.indexIn(haystack, 43), 84); - QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.length(), 43), 84); + QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.size(), 43), 84); QCOMPARE(matcher1.indexIn(haystack, 85), -1); - QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.length(), 85), -1); + QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.size(), 85), -1); QByteArrayMatcher matcher7(QByteArray("123")); QCOMPARE(matcher7.indexIn(haystack), 6); @@ -278,14 +251,7 @@ void tst_QByteArrayMatcher::haystacksWithMoreThan4GiBWork() QCOMPARE(large.size(), BaseSize + needle.size()); qDebug("created dataset in %lld ms", timer.elapsed()); -# if QT_CONFIG(cxx11_future) using MaybeThread = std::thread; -# else - struct MaybeThread { - std::function<void()> func; - void join() { func(); } - }; -# endif // // WHEN: trying to match an occurrence past the 4GiB mark |