summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpropertyanimation
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-11 09:34:15 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-11 09:35:28 (GMT)
commit26da6385e1d687cc9aef375cc9b5fb4f6fc353d0 (patch)
treef4d7652dafd1f2624851b2447e4a7e7e8c8ecd18 /tests/auto/qpropertyanimation
parented501bfc4a6510b70dc0bba17ab3da9921ab9f9f (diff)
downloadQt-26da6385e1d687cc9aef375cc9b5fb4f6fc353d0.zip
Qt-26da6385e1d687cc9aef375cc9b5fb4f6fc353d0.tar.gz
Qt-26da6385e1d687cc9aef375cc9b5fb4f6fc353d0.tar.bz2
animations now display a warning if they don't have a end value
also improved the autotests
Diffstat (limited to 'tests/auto/qpropertyanimation')
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 60bc39e..bea399c 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -473,6 +473,7 @@ void tst_QPropertyAnimation::startWhenAnotherIsRunning()
{
//normal case: the animation finishes and is deleted
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
+ anim->setEndValue(100);
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration() + 50);
@@ -482,10 +483,12 @@ void tst_QPropertyAnimation::startWhenAnotherIsRunning()
{
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
+ anim->setEndValue(100);
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration()/2);
QPointer<QVariantAnimation> anim2 = new QPropertyAnimation(&o, "ole");
+ anim2->setEndValue(100);
QCOMPARE(runningSpy.count(), 1);
QCOMPARE(anim->state(), QVariantAnimation::Running);
@@ -634,6 +637,7 @@ void tst_QPropertyAnimation::playForwardBackward()
QCOMPARE(o.property("ole").toInt(), 0);
QPropertyAnimation anim(&o, "ole");
+ anim.setStartValue(0);
anim.setEndValue(100);
anim.start();
QTest::qWait(anim.duration() + 50);
@@ -906,6 +910,7 @@ void tst_QPropertyAnimation::operationsInStates()
QObject o;
o.setProperty("ole", 42);
QPropertyAnimation anim(&o, "ole");
+ anim.setEndValue(100);
QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim.stop();