From 2fef4636aaf00832effdff6045005df0cfb71937 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 16 Dec 2021 08:15:32 +0100 Subject: [PATCH] tst_QPropertyAnimation: fix wrong comment ... and add some additional checks that hopefully leave the next reader of the code a little less confused than this one was. Pick-to: 6.3 6.2 5.15 Change-Id: I73c1b9b1ed1683e3b2de0d811d9b20d65464dff4 Reviewed-by: Fabian Kosmale Reviewed-by: Sona Kurazyan --- .../animation/qpropertyanimation/tst_qpropertyanimation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp index 1da69f83385..5612e2ce716 100644 --- a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp @@ -421,9 +421,10 @@ void tst_QPropertyAnimation::deletion1() void tst_QPropertyAnimation::deletion2() { TestAnimationDriver timeDriver; - //test that the animation get deleted if the object is deleted + // test that the animation does not get deleted if the object is deleted QObject *object = new QWidget; QPointer anim = new QPropertyAnimation(object,"minimumWidth"); + QVERIFY(anim->parent() != object); anim->setStartValue(10); anim->setEndValue(20); anim->setDuration(200); @@ -450,7 +451,10 @@ void tst_QPropertyAnimation::deletion2() QTimer::singleShot(0, object, SLOT(deleteLater())); timeDriver.wait(50); + QVERIFY(anim); QVERIFY(!anim->targetObject()); + + delete anim; } void tst_QPropertyAnimation::deletion3()