diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-03-27 11:23:35 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-03-30 08:48:35 +0000 |
commit | 0258a5593dab0ee885824fd026031ef6d0fe3ac1 (patch) | |
tree | c7f4e51808a33327b67ca0c3b2fc64d69df2dbc6 /tests | |
parent | a28735696cc09c2462a7490b77ccf4a8e7053ea6 (diff) |
Use [setL|l]oopCount in C++ for QAbstractClipAnimator
Keep the property name as loops for consistency with Qt Quick. Avoids
ambiguity in function name meaning.
Change-Id: Icf35f30d3020e77aba9db878c9dbc6e890c898ff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
4 files changed, 24 insertions, 24 deletions
diff --git a/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp b/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp index 2b26fbfce..3265de167 100644 --- a/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp +++ b/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp @@ -103,7 +103,7 @@ private Q_SLOTS: blendedClipAnimator.setRunning(true); blendedClipAnimator.setBlendTree(&blendTree); blendedClipAnimator.setChannelMapper(&mapper); - blendedClipAnimator.setLoops(10); + blendedClipAnimator.setLoopCount(10); { // WHEN diff --git a/tests/auto/animation/clipanimator/tst_clipanimator.cpp b/tests/auto/animation/clipanimator/tst_clipanimator.cpp index b5173e56d..615547405 100644 --- a/tests/auto/animation/clipanimator/tst_clipanimator.cpp +++ b/tests/auto/animation/clipanimator/tst_clipanimator.cpp @@ -52,7 +52,7 @@ private Q_SLOTS: auto clip = new Qt3DAnimation::QAnimationClipLoader(); animator.setClip(clip); - animator.setLoops(10); + animator.setLoopCount(10); // WHEN simulateInitialization(&animator, &backendAnimator); @@ -62,7 +62,7 @@ private Q_SLOTS: QCOMPARE(backendAnimator.isEnabled(), animator.isEnabled()); QCOMPARE(backendAnimator.clipId(), clip->id()); QCOMPARE(backendAnimator.isRunning(), animator.isRunning()); - QCOMPARE(backendAnimator.loops(), animator.loops()); + QCOMPARE(backendAnimator.loops(), animator.loopCount()); } void checkInitialAndCleanedUpState() @@ -84,7 +84,7 @@ private Q_SLOTS: auto clip = new Qt3DAnimation::QAnimationClipLoader(); animator.setClip(clip); animator.setRunning(true); - animator.setLoops(25); + animator.setLoopCount(25); // WHEN simulateInitialization(&animator, &backendAnimator); diff --git a/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp b/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp index 3ab8e007b..d25041886 100644 --- a/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp +++ b/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp @@ -60,7 +60,7 @@ private Q_SLOTS: QVERIFY(blendedClipAnimator.blendTree() == nullptr); QVERIFY(blendedClipAnimator.channelMapper() == nullptr); QCOMPARE(blendedClipAnimator.isRunning(), false); - QCOMPARE(blendedClipAnimator.loops(), 1); + QCOMPARE(blendedClipAnimator.loopCount(), 1); } void checkPropertyChanges() @@ -128,21 +128,21 @@ private Q_SLOTS: { // WHEN - QSignalSpy spy(&blendedClipAnimator, SIGNAL(loopsChanged(int))); + QSignalSpy spy(&blendedClipAnimator, SIGNAL(loopCountChanged(int))); const int newValue = 5; - blendedClipAnimator.setLoops(newValue); + blendedClipAnimator.setLoopCount(newValue); // THEN QVERIFY(spy.isValid()); - QCOMPARE(blendedClipAnimator.loops(), newValue); + QCOMPARE(blendedClipAnimator.loopCount(), newValue); QCOMPARE(spy.count(), 1); // WHEN spy.clear(); - blendedClipAnimator.setLoops(newValue); + blendedClipAnimator.setLoopCount(newValue); // THEN - QCOMPARE(blendedClipAnimator.loops(), newValue); + QCOMPARE(blendedClipAnimator.loopCount(), newValue); QCOMPARE(spy.count(), 0); } } @@ -180,7 +180,7 @@ private Q_SLOTS: QCOMPARE(blendedClipAnimator.isEnabled(), true); QCOMPARE(blendedClipAnimator.isEnabled(), creationChangeData->isNodeEnabled()); QCOMPARE(blendedClipAnimator.metaObject(), creationChangeData->metaObject()); - QCOMPARE(blendedClipAnimator.loops(), cloneData.loops); + QCOMPARE(blendedClipAnimator.loopCount(), cloneData.loops); } // WHEN @@ -352,14 +352,14 @@ private Q_SLOTS: { // WHEN - blendedClipAnimator.setLoops(1584); + blendedClipAnimator.setLoopCount(1584); QCoreApplication::processEvents(); // THEN QCOMPARE(arbiter.events.size(), 1); auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); QCOMPARE(change->propertyName(), "loops"); - QCOMPARE(change->value().value<int>(), blendedClipAnimator.loops()); + QCOMPARE(change->value().value<int>(), blendedClipAnimator.loopCount()); QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); arbiter.events.clear(); @@ -367,7 +367,7 @@ private Q_SLOTS: { // WHEN - blendedClipAnimator.setLoops(1584); + blendedClipAnimator.setLoopCount(1584); QCoreApplication::processEvents(); // THEN diff --git a/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp b/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp index 084e78809..1177be72a 100644 --- a/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp +++ b/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp @@ -59,7 +59,7 @@ private Q_SLOTS: // THEN QCOMPARE(animator.clip(), static_cast<Qt3DAnimation::QAbstractAnimationClip *>(nullptr)); QCOMPARE(animator.channelMapper(), static_cast<Qt3DAnimation::QChannelMapper *>(nullptr)); - QCOMPARE(animator.loops(), 1); + QCOMPARE(animator.loopCount(), 1); } void checkPropertyChanges() @@ -111,21 +111,21 @@ private Q_SLOTS: { // WHEN - QSignalSpy spy(&animator, SIGNAL(loopsChanged(int))); + QSignalSpy spy(&animator, SIGNAL(loopCountChanged(int))); const int newValue = 5; - animator.setLoops(newValue); + animator.setLoopCount(newValue); // THEN QVERIFY(spy.isValid()); - QCOMPARE(animator.loops(), newValue); + QCOMPARE(animator.loopCount(), newValue); QCOMPARE(spy.count(), 1); // WHEN spy.clear(); - animator.setLoops(newValue); + animator.setLoopCount(newValue); // THEN - QCOMPARE(animator.loops(), newValue); + QCOMPARE(animator.loopCount(), newValue); QCOMPARE(spy.count(), 0); } } @@ -159,7 +159,7 @@ private Q_SLOTS: QCOMPARE(animator.metaObject(), creationChangeData->metaObject()); QCOMPARE(animator.clip()->id(), data.clipId); QCOMPARE(animator.channelMapper()->id(), data.mapperId); - QCOMPARE(animator.loops(), data.loops); + QCOMPARE(animator.loopCount(), data.loops); } // WHEN @@ -242,7 +242,7 @@ private Q_SLOTS: { // WHEN - animator.setLoops(10); + animator.setLoopCount(10); QCoreApplication::processEvents(); // THEN @@ -250,14 +250,14 @@ private Q_SLOTS: auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); QCOMPARE(change->propertyName(), "loops"); QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().toInt(), animator.loops()); + QCOMPARE(change->value().toInt(), animator.loopCount()); arbiter.events.clear(); } { // WHEN - animator.setLoops(10); + animator.setLoopCount(10); QCoreApplication::processEvents(); // THEN |