tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
changeset 30 5dc02b23752f
parent 19 fcece45ef507
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp	Wed Jun 23 19:07:03 2010 +0300
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp	Tue Jul 06 15:10:48 2010 +0300
@@ -45,6 +45,7 @@
 #include <QtCore/qpropertyanimation.h>
 #include <QtCore/qvariantanimation.h>
 #include <QtGui/qwidget.h>
+#include "../../shared/util.h"
 
 //TESTED_CLASS=QPropertyAnimation
 //TESTED_FILES=
@@ -132,6 +133,7 @@
     void twoAnimations();
     void deletedInUpdateCurrentTime();
     void totalDuration();
+    void zeroLoopCount();
 };
 
 tst_QPropertyAnimation::tst_QPropertyAnimation()
@@ -1213,6 +1215,29 @@
     QCOMPARE(anim.totalDuration(), 0);
 }
 
+void tst_QPropertyAnimation::zeroLoopCount()
+{
+    DummyPropertyAnimation* anim;
+    anim = new DummyPropertyAnimation;
+    anim->setStartValue(0);
+    anim->setDuration(20);
+    anim->setLoopCount(0);
+
+    QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+    QSignalSpy finishedSpy(anim, SIGNAL(finished()));
+
+    QCOMPARE(anim->state(), QAnimationGroup::Stopped);
+    QCOMPARE(anim->currentValue().toInt(), 0);
+    QCOMPARE(runningSpy.count(), 0);
+    QCOMPARE(finishedSpy.count(), 0);
+
+    anim->start();
+
+    QCOMPARE(anim->state(), QAnimationGroup::Stopped);
+    QCOMPARE(anim->currentValue().toInt(), 0);
+    QCOMPARE(runningSpy.count(), 0);
+    QCOMPARE(finishedSpy.count(), 0);
+}
 
 QTEST_MAIN(tst_QPropertyAnimation)
 #include "tst_qpropertyanimation.moc"