diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-07-02 04:21:38 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-07-02 04:21:38 (GMT) |
commit | e4e6b49f555eae41fac024c1b733736a28812e2e (patch) | |
tree | 7a7774224081779ee222b0fce648701f0279547f /tests/auto/declarative/qdeclarativeimage | |
parent | 00dedffa8ad1fdec14e9e0a9184f49343c42c846 (diff) | |
download | Qt-e4e6b49f555eae41fac024c1b733736a28812e2e.zip Qt-e4e6b49f555eae41fac024c1b733736a28812e2e.tar.gz Qt-e4e6b49f555eae41fac024c1b733736a28812e2e.tar.bz2 |
Make autotests work with qreal == float (in addition to double).
Task-number: QTBUG-11853
Diffstat (limited to 'tests/auto/declarative/qdeclarativeimage')
-rw-r--r-- | tests/auto/declarative/qdeclarativeimage/data/heart-float.png | bin | 0 -> 12621 bytes | |||
-rw-r--r-- | tests/auto/declarative/qdeclarativeimage/data/heart200-float.png | bin | 0 -> 8063 bytes | |||
-rw-r--r-- | tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp | 22 |
3 files changed, 14 insertions, 8 deletions
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart-float.png b/tests/auto/declarative/qdeclarativeimage/data/heart-float.png Binary files differnew file mode 100644 index 0000000..65bd89f --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimage/data/heart-float.png diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200-float.png b/tests/auto/declarative/qdeclarativeimage/data/heart200-float.png Binary files differnew file mode 100644 index 0000000..786e75d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimage/data/heart200-float.png 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; } |