aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-14 15:49:12 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2019-02-26 04:00:18 +0000
commitea17082234d9921c1fdf34a1f34fa28eeb7faf88 (patch)
treee5a0c21b2fe31f67e24a90bb9baf4037df684d88 /tests/auto
parent3992bfea550f2caae9750e3fb8d456335248dc87 (diff)
QAnimationGroupJob: Notify about removed children on clear()
Derived classes, such as QSequentialAnimationGroupJob, might keep additional pointers to the children. Those need to be cleared, too. Therefore, use the regular removeAnimation() method for clearing. Fixes: QTBUG-73828 Change-Id: I64cc1fe4da59f10b29f27012b10f93b4289b6e5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp
index 974357dc8e..6bd8c2a2e0 100644
--- a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp
+++ b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp
@@ -261,15 +261,18 @@ void tst_QAnimationGroupJob::addChildTwice()
{
QAbstractAnimationJob *subGroup;
QAbstractAnimationJob *subGroup2;
- QAnimationGroupJob *parent = new QSequentialAnimationGroupJob();
+ auto *parent = new QSequentialAnimationGroupJob();
subGroup = new QAbstractAnimationJob;
parent->appendAnimation(subGroup);
parent->appendAnimation(subGroup);
- QVERIFY(parent->firstChild() && !parent->firstChild()->nextSibling());
+ QVERIFY(parent->firstChild());
+ QVERIFY(!parent->firstChild()->nextSibling());
+ QVERIFY(!parent->firstChild()->previousSibling());
parent->clear();
+ QCOMPARE(parent->currentAnimation(), nullptr);
QVERIFY(!parent->firstChild());
// adding the same item twice to a group will remove the item from its current position