Fix imageSource and svg tests after change to how QtSvg interprets image size

These tests were blacklisted after QtSvg/4bd5d6ced07d2d0e643a13e7cebb228c521d2046.
in order to integrate qt5.git. Now, fix the tests to match the new
behavior, and remove the blacklisting.

Task-number: QTBUG-58082
Change-Id: I77abe995095ee52978c5957e49e1547b3af7708b
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Robin Burchell 2017-01-12 21:42:57 +01:00 committed by Liang Qi
parent 60300fda46
commit ed024294c5
2 changed files with 6 additions and 12 deletions

View File

@ -1,6 +0,0 @@
#QTBUG-58082
[svg]
*
#QTBUG-58082
[imageSource]
*

View File

@ -145,9 +145,9 @@ void tst_qquickimage::imageSource_data()
QTest::newRow("remote") << "/colors.png" << 120.0 << 120.0 << true << false << true << "";
QTest::newRow("remote redirected") << "/oldcolors.png" << 120.0 << 120.0 << true << false << false << "";
if (QImageReader::supportedImageFormats().contains("svg"))
QTest::newRow("remote svg") << "/heart.svg" << 550.0 << 500.0 << true << false << false << "";
QTest::newRow("remote svg") << "/heart.svg" << 595.0 << 841.0 << true << false << false << "";
if (QImageReader::supportedImageFormats().contains("svgz"))
QTest::newRow("remote svgz") << "/heart.svgz" << 550.0 << 500.0 << true << false << false << "";
QTest::newRow("remote svgz") << "/heart.svgz" << 595.0 << 841.0 << true << false << false << "";
QTest::newRow("remote not found") << "/no-such-file.png" << 0.0 << 0.0 << true
<< false << true << "<Unknown File>:2:1: QML Image: Error transferring {{ServerBaseUrl}}/no-such-file.png - server replied: Not found";
@ -402,12 +402,12 @@ void tst_qquickimage::svg()
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickImage *obj = qobject_cast<QQuickImage*>(component.create());
QVERIFY(obj != 0);
QCOMPARE(obj->width(), 300.0);
QCOMPARE(obj->height(), 273.0);
QCOMPARE(obj->width(), 212.0);
QCOMPARE(obj->height(), 300.0);
obj->setSourceSize(QSize(200,200));
QCOMPARE(obj->width(), 200.0);
QCOMPARE(obj->height(), 182.0);
QCOMPARE(obj->width(), 141.0);
QCOMPARE(obj->height(), 200.0);
delete obj;
}