diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qframe/tst_qframe.cpp')
-rw-r--r-- | tests/auto/widgets/widgets/qframe/tst_qframe.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/tests/auto/widgets/widgets/qframe/tst_qframe.cpp b/tests/auto/widgets/widgets/qframe/tst_qframe.cpp index 81a6ba2ee3..432f4474c5 100644 --- a/tests/auto/widgets/widgets/qframe/tst_qframe.cpp +++ b/tests/auto/widgets/widgets/qframe/tst_qframe.cpp @@ -1,32 +1,27 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** 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$ ** @@ -73,22 +68,24 @@ static void provideFrameData() for (int lineWidth = 0; lineWidth < 3; ++lineWidth) { for (int midLineWidth = 0; midLineWidth < 3; ++midLineWidth) { - QTest::newRow(qPrintable(QStringLiteral("box_noshadow_%1_%2").arg(lineWidth).arg(midLineWidth))) - << "box_noshadow" << lineWidth << midLineWidth << QFrame::Box << (QFrame::Shadow)0; - QTest::newRow(qPrintable(QStringLiteral("box_plain_%1_%2").arg(lineWidth).arg(midLineWidth))) + const QByteArray postFix = '_' + QByteArray::number(lineWidth) + '_' + + QByteArray::number(midLineWidth); + QTest::newRow(("box_noshadow" + postFix).constData()) + << "box_noshadow" << lineWidth << midLineWidth << QFrame::Box << (QFrame::Shadow)0; + QTest::newRow(("box_plain" + postFix).constData()) << "box_plain" << lineWidth << midLineWidth << QFrame::Box << QFrame::Plain; - QTest::newRow(qPrintable(QStringLiteral("box_raised_%1_%2").arg(lineWidth).arg(midLineWidth))) + QTest::newRow(("box_raised" + postFix).constData()) << "box_raised" << lineWidth << midLineWidth << QFrame::Box << QFrame::Raised; - QTest::newRow(qPrintable(QStringLiteral("box_sunken_%1_%2").arg(lineWidth).arg(midLineWidth))) + QTest::newRow(("box_sunken" + postFix).constData()) << "box_sunken" << lineWidth << midLineWidth << QFrame::Box << QFrame::Sunken; - QTest::newRow(qPrintable(QStringLiteral("winpanel_noshadow_%1_%2").arg(lineWidth).arg(midLineWidth))) + QTest::newRow(("winpanel_noshadow" + postFix).constData()) << "winpanel_noshadow" << lineWidth << midLineWidth << QFrame::WinPanel << (QFrame::Shadow)0; - QTest::newRow(qPrintable(QStringLiteral("winpanel_plain_%1_%2").arg(lineWidth).arg(midLineWidth))) + QTest::newRow(("winpanel_plain" + postFix).constData()) << "winpanel_plain" << lineWidth << midLineWidth << QFrame::WinPanel << QFrame::Plain; - QTest::newRow(qPrintable(QStringLiteral("winpanel_raised_%1_%2").arg(lineWidth).arg(midLineWidth))) + QTest::newRow(("winpanel_raised" + postFix).constData()) << "winpanel_raised" << lineWidth << midLineWidth << QFrame::WinPanel << QFrame::Raised; - QTest::newRow(qPrintable(QStringLiteral("winpanel_sunken_%1_%2").arg(lineWidth).arg(midLineWidth))) + QTest::newRow(("winpanel_sunken" + postFix).constData()) << "winpanel_sunken" << lineWidth << midLineWidth << QFrame::WinPanel << QFrame::Sunken; } } @@ -174,7 +171,10 @@ void tst_QFrame::testPainting() const QPixmap pixmap = frame.grab(); - const QString referenceFilePath = QFINDTESTDATA(QStringLiteral("images/%1_%2_%3.png").arg(basename).arg(lineWidth).arg(midLineWidth)); + const QString fileName = QLatin1String("images/") + basename + QLatin1Char('_') + + QString::number(lineWidth) + QLatin1Char('_') + QString::number(midLineWidth) + + QLatin1String(".png"); + const QString referenceFilePath = QFINDTESTDATA(fileName); const QPixmap referencePixmap(referenceFilePath); QVERIFY2(!referencePixmap.isNull(), qPrintable(QStringLiteral("Could not load reference pixmap %1").arg(referenceFilePath))); QCOMPARE(pixmap, referencePixmap); |