diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-02-11 05:25:39 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-02-11 05:25:39 (GMT) |
commit | a4a464283851f062ad98b07755e1922c9fcfa7d5 (patch) | |
tree | c835eedf6b88615536bba6a68f6f60d4c9a821f1 /tests/auto | |
parent | dfb33cf9739a6dd0a6c90961c65f71692f093a38 (diff) | |
download | Qt-a4a464283851f062ad98b07755e1922c9fcfa7d5.zip Qt-a4a464283851f062ad98b07755e1922c9fcfa7d5.tar.gz Qt-a4a464283851f062ad98b07755e1922c9fcfa7d5.tar.bz2 |
Fix BorderImage tests on Windows.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp b/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp index b723c6b..1ae0227 100644 --- a/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp +++ b/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp @@ -119,8 +119,8 @@ void tst_qmlgraphicsborderimage::imageSource_data() QTest::addColumn<bool>("remote"); QTest::addColumn<QString>("error"); - QTest::newRow("local") << SRCDIR "/data/colors.png" << false << ""; - QTest::newRow("local not found") << SRCDIR "/data/no-such-file.png" << false + QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << false << ""; + QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << false << "Cannot open QUrl( \"" + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() + "\" ) "; QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true @@ -152,7 +152,7 @@ void tst_qmlgraphicsborderimage::imageSource() if (remote) TRY_WAIT(obj->status() == QmlGraphicsBorderImage::Loading); - QCOMPARE(obj->source(), remote ? source : QUrl::fromLocalFile(source)); + QCOMPARE(obj->source(), remote ? source : QUrl(source)); if (error.isEmpty()) { TRY_WAIT(obj->status() == QmlGraphicsBorderImage::Ready); @@ -172,7 +172,7 @@ void tst_qmlgraphicsborderimage::clearSource() { QString componentStr = "import Qt 4.6\nBorderImage { source: srcImage }"; QmlContext *ctxt = engine.rootContext(); - ctxt->setContextProperty("srcImage", SRCDIR "/data/colors.png"); + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); QmlComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QmlGraphicsBorderImage *obj = qobject_cast<QmlGraphicsBorderImage*>(component.create()); @@ -190,7 +190,7 @@ void tst_qmlgraphicsborderimage::clearSource() void tst_qmlgraphicsborderimage::resized() { - QString componentStr = "import Qt 4.6\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }"; + QString componentStr = "import Qt 4.6\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() + "\"; width: 300; height: 300 }"; QmlComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QmlGraphicsBorderImage *obj = qobject_cast<QmlGraphicsBorderImage*>(component.create()); @@ -271,7 +271,7 @@ void tst_qmlgraphicsborderimage::sciSource() if (remote) TRY_WAIT(obj->status() == QmlGraphicsBorderImage::Loading); - QCOMPARE(obj->source(), remote ? source : QUrl::fromLocalFile(source)); + QCOMPARE(obj->source(), remote ? source : QUrl(source)); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); @@ -296,8 +296,8 @@ void tst_qmlgraphicsborderimage::sciSource_data() QTest::addColumn<QString>("source"); QTest::addColumn<bool>("valid"); - QTest::newRow("local") << SRCDIR "/data/colors-round.sci" << true; - QTest::newRow("local not found") << SRCDIR "/data/no-such-file.sci" << false; + QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors-round.sci").toString() << true; + QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.sci").toString() << false; QTest::newRow("remote") << SERVER_ADDR "/colors-round.sci" << true; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.sci" << false; } @@ -307,7 +307,7 @@ void tst_qmlgraphicsborderimage::invalidSciFile() QTest::ignoreMessage(QtWarningMsg, "Unknown tile rule specified. Using Stretch "); // for "Roun" QTest::ignoreMessage(QtWarningMsg, "Unknown tile rule specified. Using Stretch "); // for "Repea" - QString componentStr = "import Qt 4.6\nBorderImage { source: \"" SRCDIR "/data/invalid.sci\"; width: 300; height: 300 }"; + QString componentStr = "import Qt 4.6\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/invalid.sci").toString() +"\"; width: 300; height: 300 }"; QmlComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QmlGraphicsBorderImage *obj = qobject_cast<QmlGraphicsBorderImage*>(component.create()); |