summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/image/qpixmap/tst_qpixmap.cpp')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp58
1 files changed, 21 insertions, 37 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 4ffe357d09..6adfe05fb0 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** 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: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$
**
@@ -64,12 +59,8 @@ class tst_QPixmap : public QObject
public:
tst_QPixmap();
- virtual ~tst_QPixmap();
-
public slots:
- void init();
- void cleanup();
void initTestCase();
void cleanupTestCase();
@@ -213,18 +204,6 @@ tst_QPixmap::tst_QPixmap()
{
}
-tst_QPixmap::~tst_QPixmap()
-{
-}
-
-void tst_QPixmap::init()
-{
-}
-
-void tst_QPixmap::cleanup()
-{
-}
-
void tst_QPixmap::initTestCase()
{
QVERIFY(!m_prefix.isEmpty());
@@ -446,7 +425,8 @@ void tst_QPixmap::scroll()
else
QVERIFY(pixmap.cacheKey() != oldKey);
- QString fileName = QString(":/images/%1.png").arg(QTest::currentDataTag());
+ const QString fileName = QLatin1String(":/images/") + QLatin1String(QTest::currentDataTag())
+ + QLatin1String(".png");
QPixmap output(fileName);
QCOMPARE(input.isNull(), output.isNull());
QVERIFY(lenientCompare(pixmap, output));
@@ -459,7 +439,7 @@ void tst_QPixmap::fill_data()
QTest::addColumn<bool>("syscolor");
QTest::addColumn<bool>("bitmap");
for (int color = Qt::black; color < Qt::darkYellow; ++color)
- QTest::newRow(QString("syscolor_%1").arg(color).toLatin1())
+ QTest::newRow(("syscolor_" + QByteArray::number(color)).constData())
<< uint(color) << true << false;
#if defined (Q_OS_WINCE)
@@ -1001,7 +981,9 @@ void tst_QPixmap::toWinHICON()
HBITMAP bitmap = qt_pixmapToWinHBITMAP(empty, Alpha);
SelectObject(bitmap_dc, bitmap);
- QImage imageFromFile(image + QString(QLatin1String("_%1x%2.png")).arg(width).arg(height));
+ const QString fileName = image + QLatin1Char('_') + QString::number(width) + QLatin1Char('x')
+ + QString::number(height) + QLatin1String(".png");
+ QImage imageFromFile(fileName);
imageFromFile = imageFromFile.convertToFormat(QImage::Format_ARGB32_Premultiplied);
HICON icon = qt_pixmapToWinHICON(QPixmap::fromImage(imageFromFile));
@@ -1037,7 +1019,9 @@ void tst_QPixmap::fromWinHICON()
QImage imageFromHICON = qt_pixmapFromWinHICON(icon).toImage();
DestroyIcon(icon);
- QImage imageFromFile(image + QString(QLatin1String("_%1x%2.png")).arg(width).arg(height));
+ const QString fileName = image + QLatin1Char('_') + QString::number(width) + QLatin1Char('x')
+ + QString::number(height) + QLatin1String(".png");
+ QImage imageFromFile(fileName);
imageFromFile = imageFromFile.convertToFormat(QImage::Format_ARGB32_Premultiplied);
// fuzzy comparison must be used, as the pixel values change slightly during conversion