diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-09 11:40:18 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-09 02:53:10 +0100 |
commit | 9974f474e504e6406f3893fd92fcc1b13e611a82 (patch) | |
tree | 60abf4d2370bf671037d16f67861bbeefec6ebb8 /tests/auto | |
parent | b73fc1a955b3a69d1f1f28f66df996d700246f33 (diff) |
Skip tests dependent on SVG support if QtSvg is not built.
Check for the presence of an image reader instead of the module.
Change-Id: I71c0af3fdff425462897d85e0a131e58d31d6127
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index ff08ce15..6ef784bd 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -53,6 +53,7 @@ #include <QtQuick1/qdeclarativecontext.h> #include <QtQuick1/qdeclarativeexpression.h> #include <QtTest/QSignalSpy> +#include <QtGui/qimagereader.h> #include "../shared/testhttpserver.h" @@ -142,7 +143,8 @@ void tst_qdeclarativeimage::imageSource_data() << true << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << true << ""; QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << false << ""; - QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << ""; + if (QImageReader::supportedImageFormats().contains("SVG")) + QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true << false << true << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; @@ -371,6 +373,9 @@ void tst_qdeclarativeimage::mirror_data() void tst_qdeclarativeimage::svg() { + if (!QImageReader::supportedImageFormats().contains("SVG")) + QSKIP("No image reader for SVG"); + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString(); QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }"; QDeclarativeComponent component(&engine); |