diff options
Diffstat (limited to 'tests/auto/other/qcomplextext')
-rw-r--r-- | tests/auto/other/qcomplextext/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tests/auto/other/qcomplextext/bidireorderstring.h | 29 | ||||
-rw-r--r-- | tests/auto/other/qcomplextext/qcomplextext.pro | 14 | ||||
-rw-r--r-- | tests/auto/other/qcomplextext/tst_qcomplextext.cpp | 49 |
4 files changed, 24 insertions, 85 deletions
diff --git a/tests/auto/other/qcomplextext/CMakeLists.txt b/tests/auto/other/qcomplextext/CMakeLists.txt index 2b5f951267..74996c7ad7 100644 --- a/tests/auto/other/qcomplextext/CMakeLists.txt +++ b/tests/auto/other/qcomplextext/CMakeLists.txt @@ -1,16 +1,23 @@ -# Generated from qcomplextext.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qcomplextext Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qcomplextext LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data list(APPEND test_data "data") -qt_add_test(tst_qcomplextext +qt_internal_add_test(tst_qcomplextext SOURCES tst_qcomplextext.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Gui Qt::GuiPrivate @@ -27,7 +34,7 @@ if(ANDROID) "data/BidiTest.txt" ) - qt_add_resource(tst_qcomplextext "android_testdata" + qt_internal_add_resource(tst_qcomplextext "android_testdata" PREFIX "/android_testdata" FILES @@ -35,7 +42,7 @@ if(ANDROID) ) endif() -qt_extend_target(tst_qcomplextext CONDITION builtin_testdata +qt_internal_extend_target(tst_qcomplextext CONDITION builtin_testdata DEFINES BUILTIN_TESTDATA ) diff --git a/tests/auto/other/qcomplextext/bidireorderstring.h b/tests/auto/other/qcomplextext/bidireorderstring.h index b537bf45e4..831fd34883 100644 --- a/tests/auto/other/qcomplextext/bidireorderstring.h +++ b/tests/auto/other/qcomplextext/bidireorderstring.h @@ -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 struct LV { const char *name; const char *logical; diff --git a/tests/auto/other/qcomplextext/qcomplextext.pro b/tests/auto/other/qcomplextext/qcomplextext.pro deleted file mode 100644 index 5135b48fee..0000000000 --- a/tests/auto/other/qcomplextext/qcomplextext.pro +++ /dev/null @@ -1,14 +0,0 @@ -CONFIG += testcase -TARGET = tst_qcomplextext -QT += testlib -QT += core-private gui-private -SOURCES += tst_qcomplextext.cpp - -TESTDATA += data - -android { - RESOURCES += \ - android_testdata.qrc -} - -builtin_testdata: DEFINES += BUILTIN_TESTDATA diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp index 1ba211aa0a..b8014126ed 100644 --- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp +++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp @@ -1,32 +1,7 @@ -/**************************************************************************** -** -** 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> +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QTest> #include <QtGui/QtGui> #include <private/qtextengine_p.h> @@ -109,7 +84,7 @@ void tst_QComplexText::bidiReorderString() if (si.analysis.bidiLevel % 2) { // reverse sub QChar *a = sub.data(); - QChar *b = a + sub.length() - 1; + QChar *b = a + sub.size() - 1; while (a < b) { QChar tmp = *a; *a = *b; @@ -118,7 +93,7 @@ void tst_QComplexText::bidiReorderString() --b; } a = (QChar *)sub.unicode(); - b = a + sub.length(); + b = a + sub.size(); while (a<b) { *a = a->mirroredChar(); ++a; @@ -340,7 +315,7 @@ static void testBidiString(const QString &data, int paragraphDirection, if (si.analysis.bidiLevel % 2) { // reverse sub QChar *a = sub.data(); - QChar *b = a + sub.length() - 1; + QChar *b = a + sub.size() - 1; while (a < b) { QChar tmp = *a; *a = *b; @@ -349,7 +324,7 @@ static void testBidiString(const QString &data, int paragraphDirection, --b; } a = (QChar *)sub.unicode(); - b = a + sub.length(); + b = a + sub.size(); // while (a<b) { // *a = a->mirroredChar(); // ++a; @@ -372,9 +347,7 @@ void tst_QComplexText::bidiCharacterTest() { QString testFile = QFINDTESTDATA("data/BidiCharacterTest.txt"); QFile f(testFile); - QVERIFY(f.exists()); - - f.open(QIODevice::ReadOnly); + QVERIFY(f.open(QIODevice::ReadOnly)); int linenum = 0; while (!f.atEnd()) { @@ -466,9 +439,7 @@ void tst_QComplexText::bidiTest() { QString testFile = QFINDTESTDATA("data/BidiTest.txt"); QFile f(testFile); - QVERIFY(f.exists()); - - f.open(QIODevice::ReadOnly); + QVERIFY(f.open(QIODevice::ReadOnly)); int linenum = 0; QList<int> resolvedLevels; |