diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-18 10:39:16 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-18 10:39:16 (GMT) |
commit | 0b96a20f201dbd91599ee890f42dd8e452d15f79 (patch) | |
tree | fbefbfe77e669f7d58a39c2be612a7098e6f7e17 /tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp | |
parent | 379073630202d37cf8e3927dc9745134ac2f5512 (diff) | |
parent | 7a64a3f67d53a99e6e2200f6481c98013004b4e4 (diff) | |
download | Qt-0b96a20f201dbd91599ee890f42dd8e452d15f79.zip Qt-0b96a20f201dbd91599ee890f42dd8e452d15f79.tar.gz Qt-0b96a20f201dbd91599ee890f42dd8e452d15f79.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qtscript-jsc-backend
Conflicts:
src/script/qscriptclass.cpp
src/script/qscriptcontext.cpp
src/script/qscriptengine.cpp
src/script/qscriptvalue.cpp
Diffstat (limited to 'tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp')
-rw-r--r-- | tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp index 5af6f39..3ff177a 100644 --- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp @@ -113,6 +113,7 @@ private slots: void oneKeyValue(); void updateOnSetKeyValues(); void restart(); + void valueChanged(); }; tst_QPropertyAnimation::tst_QPropertyAnimation() @@ -1052,6 +1053,33 @@ void tst_QPropertyAnimation::restart() anim.start(); } +void tst_QPropertyAnimation::valueChanged() +{ + qRegisterMetaType<QVariant>("QVariant"); + + //we check that we receive the valueChanged signal + MyErrorObject o; + o.setOle(0); + QCOMPARE(o.property("ole").toInt(), 0); + QPropertyAnimation anim(&o, "ole"); + anim.setEndValue(5); + anim.setDuration(1000); + QSignalSpy spy(&anim, SIGNAL(valueChanged(QVariant))); + anim.start(); + + QTest::qWait(anim.duration() + 50); + + QCOMPARE(anim.state(), QAbstractAnimation::Stopped); + QCOMPARE(anim.currentTime(), anim.duration()); + + //let's check that the values go forward + QCOMPARE(spy.count(), 6); //we should have got everything from 0 to 5 + for (int i = 0; i < spy.count(); ++i) { + QCOMPARE(qvariant_cast<QVariant>(spy.at(i).first()).toInt(), i); + } +} + + QTEST_MAIN(tst_QPropertyAnimation) #include "tst_qpropertyanimation.moc" |