diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-10-28 08:26:20 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-10-28 08:26:20 (GMT) |
commit | 07e1b6615e868af6434bb8e42dc2d44a51075204 (patch) | |
tree | 5bc94729576e561eae6bb9470dda0ab61b439f18 /tests/auto/declarative/animations | |
parent | 1d14bbef27945d7823e9c32745e51d187093f1b7 (diff) | |
parent | 30d8810bfab9c8157f80e5e38beda1ad8c0acfb0 (diff) | |
download | Qt-07e1b6615e868af6434bb8e42dc2d44a51075204.zip Qt-07e1b6615e868af6434bb8e42dc2d44a51075204.tar.gz Qt-07e1b6615e868af6434bb8e42dc2d44a51075204.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
doc/src/declarative/globalobject.qdoc
Diffstat (limited to 'tests/auto/declarative/animations')
-rw-r--r-- | tests/auto/declarative/animations/animations.pro | 1 | ||||
-rw-r--r-- | tests/auto/declarative/animations/tst_animations.cpp | 25 |
2 files changed, 18 insertions, 8 deletions
diff --git a/tests/auto/declarative/animations/animations.pro b/tests/auto/declarative/animations/animations.pro index 419da4e..e13ecb9 100644 --- a/tests/auto/declarative/animations/animations.pro +++ b/tests/auto/declarative/animations/animations.pro @@ -1,5 +1,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative SOURCES += tst_animations.cpp +macx:CONFIG -= app_bundle DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 336f0d3..a6f67b8 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -21,6 +21,15 @@ private slots: void mixedTypes(); }; +#define QTIMED_COMPARE(lhs, rhs) do { \ + for (int ii = 0; ii < 5; ++ii) { \ + if (lhs == rhs) \ + break; \ + QTest::qWait(50); \ + } \ + QCOMPARE(lhs, rhs); \ +} while (false) + void tst_animations::simpleNumber() { QFxRect rect; @@ -29,8 +38,8 @@ void tst_animations::simpleNumber() animation.setProperty("x"); animation.setTo(200); animation.start(); - QTest::qWait(animation.duration() + 50); - QCOMPARE(rect.x(), qreal(200)); + QTest::qWait(animation.duration()); + QTIMED_COMPARE(rect.x(), qreal(200)); rect.setX(0); animation.start(); @@ -47,8 +56,8 @@ void tst_animations::simpleColor() animation.setProperty("color"); animation.setTo(QColor("red")); animation.start(); - QTest::qWait(animation.duration() + 50); - QCOMPARE(rect.color(), QColor("red")); + QTest::qWait(animation.duration()); + QTIMED_COMPARE(rect.color(), QColor("red")); rect.setColor(QColor("blue")); animation.start(); @@ -71,8 +80,8 @@ void tst_animations::alwaysRunToEnd() QTest::qWait(1500); animation.stop(); QVERIFY(rect.x() != qreal(200)); - QTest::qWait(500 + 50); - QCOMPARE(rect.x(), qreal(200)); + QTest::qWait(500); + QTIMED_COMPARE(rect.x(), qreal(200)); } void tst_animations::dotProperty() @@ -83,8 +92,8 @@ void tst_animations::dotProperty() animation.setProperty("border.width"); animation.setTo(10); animation.start(); - QTest::qWait(animation.duration() + 50); - QCOMPARE(rect.border()->width(), 10); + QTest::qWait(animation.duration()); + QTIMED_COMPARE(rect.border()->width(), 10); rect.border()->setWidth(0); animation.start(); |