diff options
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" |