diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-10 01:42:00 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-10 01:42:00 (GMT) |
commit | 2b1617e7e6050bef8de0f6d2129f4414a1b3ec28 (patch) | |
tree | 0e7fca9239079df3f734a32259efdf3e181daa7c /tests/auto/declarative/animations | |
parent | 80cc666f4f3c7cc2fc6aed806951564066011e09 (diff) | |
download | Qt-2b1617e7e6050bef8de0f6d2129f4414a1b3ec28.zip Qt-2b1617e7e6050bef8de0f6d2129f4414a1b3ec28.tar.gz Qt-2b1617e7e6050bef8de0f6d2129f4414a1b3ec28.tar.bz2 |
Test (and fix) animation actions.
Diffstat (limited to 'tests/auto/declarative/animations')
-rw-r--r-- | tests/auto/declarative/animations/tst_animations.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 372658e..61f0e0a 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -44,6 +44,7 @@ #include <QtDeclarative/qmlview.h> #include <private/qmlgraphicsrectangle_p.h> #include <private/qmlanimation_p.h> +#include <QVariantAnimation> class tst_animations : public QObject { @@ -61,6 +62,7 @@ private slots: void mixedTypes(); void properties(); void propertiesTransition(); + void easingStringConversion(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -384,6 +386,22 @@ void tst_animations::propertiesTransition() } } +void tst_animations::easingStringConversion() +{ + QmlNumberAnimation *animation = new QmlNumberAnimation; + animation->setEasing("easeInOutQuad"); + QCOMPARE(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve(), QEasingCurve(QEasingCurve::InOutQuad)); + + animation->setEasing("OutQuad"); + QCOMPARE(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve(), QEasingCurve(QEasingCurve::OutQuad)); + + animation->setEasing("easeOutBounce(amplitude: 5)"); + QCOMPARE(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve().type(), QEasingCurve::OutBounce); + QCOMPARE(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve().amplitude(), qreal(5)); + + delete animation; +} + QTEST_MAIN(tst_animations) #include "tst_animations.moc" |