summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-12 10:49:49 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-12 10:49:49 (GMT)
commit0b5f851adea024df6a81bb9dc69c51e000c9253e (patch)
tree9d9ce773c9641788b375a7bb55f5e82c9669838e /tests
parent0b01202d770a5847af00dc6ebba0d2a75f1a271b (diff)
downloadQt-0b5f851adea024df6a81bb9dc69c51e000c9253e.zip
Qt-0b5f851adea024df6a81bb9dc69c51e000c9253e.tar.gz
Qt-0b5f851adea024df6a81bb9dc69c51e000c9253e.tar.bz2
Don't interrupt test before animation finishes
We're testing if both animations actually run and finish, so we need to make sure one of the polished signals is emitted last, and then react to this. I've done this by setting the duration of the animation which animated the property set by s2Child, so that it's sufficient to listen to this polished signal.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index d24a945..9058cb6 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -2529,6 +2529,7 @@ void tst_QStateMachine::nestedTargetStateForAnimation()
QAbstractTransition *at = s2Child->addTransition(new EventTransition(QEvent::User, s2Child2));
QPropertyAnimation *animation = new QPropertyAnimation(object, "bar", s2);
+ animation->setDuration(2000);
connect(animation, SIGNAL(finished()), &counter, SLOT(slot()));
at->addAnimation(animation);
@@ -2541,10 +2542,11 @@ void tst_QStateMachine::nestedTargetStateForAnimation()
animation = new QPropertyAnimation(object, "bar", s2);
connect(animation, SIGNAL(finished()), &counter, SLOT(slot()));
at->addAnimation(animation);
-
+
QState *s3 = new QState(machine.rootState());
+ s2->addTransition(s2Child, SIGNAL(polished()), s3);
+
QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit()));
- s2->addTransition(s2, SIGNAL(polished()), s3);
machine.setInitialState(s1);
machine.start();