summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro3
-rw-r--r--tests/auto/wbmp/tst_qwbmp.cpp78
-rw-r--r--tests/auto/wbmp/wbmp.pro11
3 files changed, 91 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