diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-01-23 08:57:04 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-01-27 12:34:49 +0000 |
commit | 0070276340e15872362858928d6858ae31e07f7e (patch) | |
tree | d1e13ef663ca26d2e6856755e36ea8b70c4b3401 /tests/auto/animation/clipanimator | |
parent | eda313e0855f94e317cd656ad9c83ef086e17625 (diff) |
Add running property to QClipAnimator
Change-Id: I5ef29ada7fd6584674d98162f7106177e199b720
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/animation/clipanimator')
-rw-r--r-- | tests/auto/animation/clipanimator/tst_clipanimator.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/animation/clipanimator/tst_clipanimator.cpp b/tests/auto/animation/clipanimator/tst_clipanimator.cpp index 0e6489089..b19f60da2 100644 --- a/tests/auto/animation/clipanimator/tst_clipanimator.cpp +++ b/tests/auto/animation/clipanimator/tst_clipanimator.cpp @@ -45,7 +45,9 @@ private Q_SLOTS: void checkPeerPropertyMirroring() { // GIVEN + Qt3DAnimation::Animation::Handler handler; Qt3DAnimation::Animation::ClipAnimator backendAnimator; + backendAnimator.setHandler(&handler); Qt3DAnimation::QClipAnimator animator; auto clip = new Qt3DAnimation::QAnimationClip(); @@ -58,22 +60,27 @@ private Q_SLOTS: QCOMPARE(backendAnimator.peerId(), animator.id()); QCOMPARE(backendAnimator.isEnabled(), animator.isEnabled()); QCOMPARE(backendAnimator.clipId(), clip->id()); + QCOMPARE(backendAnimator.isRunning(), animator.isRunning()); } void checkInitialAndCleanedUpState() { // GIVEN + Qt3DAnimation::Animation::Handler handler; Qt3DAnimation::Animation::ClipAnimator backendAnimator; + backendAnimator.setHandler(&handler); // THEN QVERIFY(backendAnimator.peerId().isNull()); QCOMPARE(backendAnimator.isEnabled(), false); QCOMPARE(backendAnimator.clipId(), Qt3DCore::QNodeId()); + QCOMPARE(backendAnimator.isRunning(), false); // GIVEN Qt3DAnimation::QClipAnimator animator; auto clip = new Qt3DAnimation::QAnimationClip(); animator.setClip(clip); + animator.setRunning(true); // WHEN simulateInitialization(&animator, &backendAnimator); @@ -83,12 +90,15 @@ private Q_SLOTS: // THEN QCOMPARE(backendAnimator.clipId(), Qt3DCore::QNodeId()); QCOMPARE(backendAnimator.isEnabled(), false); + QCOMPARE(backendAnimator.isRunning(), false); } void checkPropertyChanges() { // GIVEN + Qt3DAnimation::Animation::Handler handler; Qt3DAnimation::Animation::ClipAnimator backendAnimator; + backendAnimator.setHandler(&handler); Qt3DCore::QPropertyUpdatedChangePtr updateChange; // WHEN @@ -109,6 +119,15 @@ private Q_SLOTS: // THEN QCOMPARE(backendAnimator.clipId(), newClip->id()); + + // WHEN + updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId())); + updateChange->setPropertyName("running"); + updateChange->setValue(true); + backendAnimator.sceneChangeEvent(updateChange); + + // THEN + QCOMPARE(backendAnimator.isRunning(), true); } }; |