summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpropertyanimation
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-22 15:29:24 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-22 15:30:20 +0200
commit770208fd7e26bf2b7a257a0865f38532144f1c2c (patch)
tree1eded551ae0f11ef4522d362cc8921f127b85090 /tests/auto/qpropertyanimation
parentde6380c8da3e22d30b0ec292da8da1db96d721ef (diff)
Fix to the autotests of Animations to spit less warnings
Diffstat (limited to 'tests/auto/qpropertyanimation')
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index bea399c385..b92e14012e 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -75,6 +75,20 @@ private:
qreal m_x;
};
+class DummyPropertyAnimation : public QPropertyAnimation
+{
+public:
+ DummyPropertyAnimation(QObject *parent = 0) : QPropertyAnimation(parent)
+ {
+ setTargetObject(&o);
+ this->setPropertyName("x");
+ setEndValue(100);
+ }
+
+ MyObject o;
+};
+
+
class tst_QPropertyAnimation : public QObject
{
Q_OBJECT
@@ -224,7 +238,11 @@ void tst_QPropertyAnimation::statesAndSignals_data()
void tst_QPropertyAnimation::statesAndSignals()
{
QFETCH(bool, uncontrolled);
- QPropertyAnimation *anim = uncontrolled ? new UncontrolledAnimation : new QPropertyAnimation;
+ QPropertyAnimation *anim;
+ if (uncontrolled)
+ anim = new UncontrolledAnimation;
+ else
+ anim = new DummyPropertyAnimation;
anim->setDuration(100);
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
@@ -833,7 +851,7 @@ void tst_QPropertyAnimation::setStartEndValues()
void tst_QPropertyAnimation::zeroDurationStart()
{
- QPropertyAnimation anim;
+ DummyPropertyAnimation anim;
QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
anim.setDuration(0);
QCOMPARE(anim.state(), QAbstractAnimation::Stopped);