From bb86abefa742f82f30fd07aee23e5f3164a47875 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 29 Mar 2010 11:50:23 +1000 Subject: Fix svg and big image auto tests on win32. --- .../declarative/qdeclarativeimage/data/heart-win32.png | Bin 0 -> 12621 bytes .../qdeclarativeimage/data/heart200-win32.png | Bin 0 -> 8062 bytes .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 10 ++++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeimage/data/heart-win32.png create mode 100644 tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png b/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png new file mode 100644 index 0000000..351da13 Binary files /dev/null and b/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png differ diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png b/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png new file mode 100644 index 0000000..4976ff9 Binary files /dev/null and b/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png differ diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index c1bf2b8..21a513b 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -260,7 +260,8 @@ void tst_qdeclarativeimage::pixmap() void tst_qdeclarativeimage::svg() { - QString componentStr = "import Qt 4.6\nImage { source: \"" SRCDIR "/data/heart.svg\"; sourceSize.width: 300; sourceSize.height: 300 }"; + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString(); + QString componentStr = "import Qt 4.6\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeImage *obj = qobject_cast(component.create()); @@ -271,6 +272,8 @@ void tst_qdeclarativeimage::svg() QCOMPARE(obj->height(), 500.0); #if defined(Q_OS_MAC) QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart-mac.png")); +#elif defined(Q_OS_WIN32) + QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart-win32.png")); #else QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png")); #endif @@ -283,6 +286,8 @@ void tst_qdeclarativeimage::svg() QCOMPARE(obj->height(), 500.0); #if defined(Q_OS_MAC) QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200-mac.png")); +#elif defined(Q_OS_WIN32) + QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200-win32.png")); #else QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200.png")); #endif @@ -291,7 +296,8 @@ void tst_qdeclarativeimage::svg() void tst_qdeclarativeimage::big() { - QString componentStr = "import Qt 4.6\nImage { source: \"" SRCDIR "/data/big.jpeg\"; sourceSize.width: 256; sourceSize.height: 256 }"; + QString src = QUrl::fromLocalFile(SRCDIR "/data/big.jpeg").toString(); + QString componentStr = "import Qt 4.6\nImage { source: \"" + src + "\"; sourceSize.width: 256; sourceSize.height: 256 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeImage *obj = qobject_cast(component.create()); -- cgit v0.12