diff options
Diffstat (limited to 'tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp')
-rw-r--r-- | tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp | 59 |
1 files changed, 16 insertions, 43 deletions
diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 04e6282ca9..975658005e 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.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 <private/qfontengine_p.h> #include <private/qtextengine_p.h> #include <qtextlayout.h> @@ -142,7 +117,7 @@ static void doShapingTests() if (e->fontEngine(e->layoutData->items[0])->type() == QFontEngine::Box) QSKIP("OpenType support missing for script"); - QCOMPARE(e->fontEngine(e->layoutData->items[0])->fontDef.family, font.family()); + QCOMPARE(e->fontEngine(e->layoutData->items[0])->fontDef.families.first(), font.family()); ushort nglyphs = glyphs.size(); if (!glyphs.isEmpty()) { @@ -1078,8 +1053,7 @@ void tst_QTextScriptEngine::mirroredChars() void tst_QTextScriptEngine::controlInSyllable_qtbug14204() { - QFontDatabase db; - if (!db.families().contains(QStringLiteral("Aparajita"))) + if (!QFontDatabase::families().contains(QStringLiteral("Aparajita"))) QSKIP("couldn't find 'Aparajita' font"); QFont font(QStringLiteral("Aparajita")); @@ -1099,7 +1073,7 @@ void tst_QTextScriptEngine::controlInSyllable_qtbug14204() QFontEngine *fe = e->fontEngine(e->layoutData->items[0]); if (fe->type() == QFontEngine::Box) QSKIP("OpenType support missing for script"); - QCOMPARE(fe->fontDef.family, font.family()); + QCOMPARE(fe->fontDef.families.first(), font.family()); e->shape(0); QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(3)); @@ -1120,11 +1094,12 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675_data() bool hasTests = false; - QStringList families; - families << QStringLiteral("Monaco"); - families << QStringLiteral("DejaVu Sans Mono"); + const QString families[] = { + QStringLiteral("Monaco"), + QStringLiteral("DejaVu Sans Mono"), + }; - foreach (const QString &family, families) { + for (const QString &family : families) { QFont font(family); font.setStyleStrategy(QFont::NoFontMerging); if (QFontInfo(font).family() != family) @@ -1157,7 +1132,7 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675() QFontEngine *fe = e->fontEngine(e->layoutData->items[0]); if (fe->type() == QFontEngine::Box) QSKIP("OpenType support missing for script"); - QCOMPARE(fe->fontDef.family, font.family()); + QCOMPARE(fe->fontDef.families.first(), font.family()); e->shape(0); const int diff = e->layoutData->items[0].num_glyphs - string.size(); @@ -1181,8 +1156,7 @@ void tst_QTextScriptEngine::combiningMarks_qtbug15675() void tst_QTextScriptEngine::thaiIsolatedSaraAm() { - QFontDatabase db; - if (!db.families().contains("Waree")) + if (!QFontDatabase::families().contains("Waree")) QSKIP("couldn't find 'Waree' font"); QFont font(QStringLiteral("Waree")); @@ -1199,7 +1173,7 @@ void tst_QTextScriptEngine::thaiIsolatedSaraAm() QFontEngine *fe = e->fontEngine(e->layoutData->items[0]); if (fe->type() == QFontEngine::Box) QSKIP("OpenType support missing for script"); - QCOMPARE(fe->fontDef.family, font.family()); + QCOMPARE(fe->fontDef.families.first(), font.family()); e->shape(0); QVERIFY(e->layoutData->items[0].num_glyphs > 0); @@ -1214,8 +1188,7 @@ void tst_QTextScriptEngine::thaiWithZWJ() QSKIP("Requires up-to-date Harfbuzz"); #endif - QFontDatabase db; - if (!db.families().contains("Waree")) + if (!QFontDatabase::families().contains("Waree")) QSKIP("couldn't find 'Waree' font"); QFont font(QStringLiteral("Waree")); |