summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index c09f7fc..ace6712 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -124,8 +124,8 @@ void tst_qdeclarativeimage::noSource()
void tst_qdeclarativeimage::imageSource_data()
{
QTest::addColumn<QString>("source");
- QTest::addColumn<qreal>("width");
- QTest::addColumn<qreal>("height");
+ QTest::addColumn<double>("width");
+ QTest::addColumn<double>("height");
QTest::addColumn<bool>("remote");
QTest::addColumn<bool>("async");
QTest::addColumn<QString>("error");
@@ -146,8 +146,8 @@ void tst_qdeclarativeimage::imageSource_data()
void tst_qdeclarativeimage::imageSource()
{
QFETCH(QString, source);
- QFETCH(qreal, width);
- QFETCH(qreal, height);
+ QFETCH(double, width);
+ QFETCH(double, height);
QFETCH(bool, remote);
QFETCH(bool, async);
QFETCH(QString, error);
@@ -178,8 +178,8 @@ void tst_qdeclarativeimage::imageSource()
if (error.isEmpty()) {
TRY_WAIT(obj->status() == QDeclarativeImage::Ready);
- QCOMPARE(obj->width(), width);
- QCOMPARE(obj->height(), height);
+ QCOMPARE(obj->width(), qreal(width));
+ QCOMPARE(obj->height(), qreal(height));
QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
QCOMPARE(obj->progress(), 1.0);
} else {
@@ -308,7 +308,10 @@ void tst_qdeclarativeimage::svg()
#elif defined(Q_OS_WIN32)
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart-win32.png"));
#else
- QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
+ if (sizeof(qreal) == sizeof(double))
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
+ else
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart-float.png"));
#endif
obj->setSourceSize(QSize(200,200));
@@ -322,7 +325,10 @@ void tst_qdeclarativeimage::svg()
#elif defined(Q_OS_WIN32)
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200-win32.png"));
#else
- QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200.png"));
+ if (sizeof(qreal) == sizeof(double))
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200.png"));
+ else
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200-float.png"));
#endif
delete obj;
}