diff options
author | Marc Mutz <marc.mutz@qt.io> | 2021-12-16 08:15:32 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2021-12-17 17:24:36 +0100 |
commit | 2fef4636aaf00832effdff6045005df0cfb71937 (patch) | |
tree | 8c102a94ee5358b17dc2ca2cb7e25b4e8d346b1c /tests/auto | |
parent | c31fecd27fa1ca0bebc96d39ca01ff86578f8d7f (diff) |
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 <fabian.kosmale@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp index 1da69f8338..5612e2ce71 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<QPropertyAnimation> 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() |