diff options
author | aavit <qt_aavit@ovi.com> | 2012-02-22 13:48:48 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-01 12:57:36 +0100 |
commit | aa48df6f9b4a431b3a802ac1a2a15db1ed5dc696 (patch) | |
tree | df899a4baaabf845ea94a6da88371456c32e9e90 /tests | |
parent | 94aed3b5808f5095ee3040e928551035a21f0a6d (diff) |
Add wbmp plugin
This is a port to Qt 5/qtimageformats of the contribution
https://qt.gitorious.org/qt/qt/merge_requests/1117
by
Dmitry Zelenkovskiy <Dmitry.Zelenkovskiy@nokia.com>
Change-Id: I9cdd249d3c58c5f922ccd2d43f92f1bd2e3fd86f
Reviewed-by: Jason Barron <jason.barron@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 3 | ||||
-rw-r--r-- | tests/auto/wbmp/tst_qwbmp.cpp | 78 | ||||
-rw-r--r-- | tests/auto/wbmp/wbmp.pro | 11 | ||||
-rw-r--r-- | tests/shared/images/wbmp.qrc | 6 | ||||
-rw-r--r-- | tests/shared/images/wbmp/qt-logo-big.wbmp | bin | 0 -> 8006 bytes | |||
-rw-r--r-- | tests/shared/images/wbmp/qt-logo-small.wbmp | bin | 0 -> 1652 bytes |
6 files changed, 97 insertions, 1 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 70ee4ae..5bde0c7 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS = \ - tga + tga \ + wbmp contains(QT_CONFIG, system-zlib): SUBDIRS += mng tiff diff --git a/tests/auto/wbmp/tst_qwbmp.cpp b/tests/auto/wbmp/tst_qwbmp.cpp new file mode 100644 index 0000000..c5ae7ed --- /dev/null +++ b/tests/auto/wbmp/tst_qwbmp.cpp @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the WBMP plugin in the Qt ImageFormats module. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt 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.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> +#include <QtGui/QtGui> + +class tst_qwbmp: public QObject +{ + Q_OBJECT + +private slots: + void readImage_data(); + void readImage(); +}; + +void tst_qwbmp::readImage_data() +{ + QTest::addColumn<QString>("fileName"); + QTest::addColumn<QSize>("size"); + + QTest::newRow("qt-logo-small") << QString("qt-logo-small.wbmp") << QSize(123, 103); + QTest::newRow("qt-logo-big") << QString("qt-logo-big.wbmp") << QSize(250, 250); +} + +void tst_qwbmp::readImage() +{ + QFETCH(QString, fileName); + QFETCH(QSize, size); + + QString path = QString(":/wbmp/") + fileName; + QImageReader reader(path); + QVERIFY(reader.canRead()); + QImage image = reader.read(); + QVERIFY(!image.isNull()); + QCOMPARE(image.size(), size); +} + +QTEST_MAIN(tst_qwbmp) + +#include "tst_qwbmp.moc" diff --git a/tests/auto/wbmp/wbmp.pro b/tests/auto/wbmp/wbmp.pro new file mode 100644 index 0000000..e557184 --- /dev/null +++ b/tests/auto/wbmp/wbmp.pro @@ -0,0 +1,11 @@ +TEMPLATE = app +TARGET = tst_qwbmp +DEPENDPATH += . +INCLUDEPATH += . + +QT = core gui testlib +CONFIG -= app_bundle +CONFIG += testcase + +SOURCES += tst_qwbmp.cpp +RESOURCES += $$PWD/../../shared/images/wbmp.qrc diff --git a/tests/shared/images/wbmp.qrc b/tests/shared/images/wbmp.qrc new file mode 100644 index 0000000..bea46a1 --- /dev/null +++ b/tests/shared/images/wbmp.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>wbmp/qt-logo-big.wbmp</file> + <file>wbmp/qt-logo-small.wbmp</file> + </qresource> +</RCC> diff --git a/tests/shared/images/wbmp/qt-logo-big.wbmp b/tests/shared/images/wbmp/qt-logo-big.wbmp Binary files differnew file mode 100644 index 0000000..c275b8f --- /dev/null +++ b/tests/shared/images/wbmp/qt-logo-big.wbmp diff --git a/tests/shared/images/wbmp/qt-logo-small.wbmp b/tests/shared/images/wbmp/qt-logo-small.wbmp Binary files differnew file mode 100644 index 0000000..fe6a238 --- /dev/null +++ b/tests/shared/images/wbmp/qt-logo-small.wbmp |