summaryrefslogtreecommitdiffstats
path: root/tests/auto/animation
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-09-20 07:32:08 +0100
committerMike Krus <mike.krus@kdab.com>2019-09-20 11:11:31 +0100
commit722425eccd099936a15b850698c5fc3047f162a2 (patch)
tree21406593fac2594c4bdfa936beaf73e3046d7138 /tests/auto/animation
parent6d65beef4118e896980ba881e270e5da50a1299a (diff)
Update QLerpClipBlend to use direct sync
Change-Id: I91ce052b27eb822e79b80fa11ccd3d4b9f76ded4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/animation')
-rw-r--r--tests/auto/animation/clipblendnodevisitor/tst_clipblendnodevisitor.cpp18
-rw-r--r--tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp35
2 files changed, 26 insertions, 27 deletions
diff --git a/tests/auto/animation/clipblendnodevisitor/tst_clipblendnodevisitor.cpp b/tests/auto/animation/clipblendnodevisitor/tst_clipblendnodevisitor.cpp
index 3f705e713..54de87b1e 100644
--- a/tests/auto/animation/clipblendnodevisitor/tst_clipblendnodevisitor.cpp
+++ b/tests/auto/animation/clipblendnodevisitor/tst_clipblendnodevisitor.cpp
@@ -73,11 +73,11 @@ private Q_SLOTS:
manager.appendNode(childBlendNode12.id(), backendChildBlendNode12);
// WHEN
- simulateInitialization(&rootBlendNode, backendRootBlendNode);
- simulateInitialization(&childBlendNode1, backendChildBlendNode1);
- simulateInitialization(&childBlendNode2, backendChildBlendNode2);
- simulateInitialization(&childBlendNode11, backendChildBlendNode11);
- simulateInitialization(&childBlendNode12, backendChildBlendNode12);
+ simulateInitializationSync(&rootBlendNode, backendRootBlendNode);
+ simulateInitializationSync(&childBlendNode1, backendChildBlendNode1);
+ simulateInitializationSync(&childBlendNode2, backendChildBlendNode2);
+ simulateInitializationSync(&childBlendNode11, backendChildBlendNode11);
+ simulateInitializationSync(&childBlendNode12, backendChildBlendNode12);
// THEN
QCOMPARE(backendRootBlendNode->allDependencyIds().size(), 2);
@@ -121,7 +121,7 @@ private Q_SLOTS:
// We purposely forgot the to do: manager.appendNode(rootBlendNode.id(), backendRootBlendNode);
// WHEN
- simulateInitialization(&rootBlendNode, backendRootBlendNode);
+ simulateInitializationSync(&rootBlendNode, backendRootBlendNode);
// THEN
QCOMPARE(backendRootBlendNode->allDependencyIds().size(), 2);
@@ -159,9 +159,9 @@ private Q_SLOTS:
// WHEN
- simulateInitialization(&rootBlendNode, backendRootBlendNode);
- simulateInitialization(&childBlendNode1, backendChildBlendNode1);
- simulateInitialization(&childBlendNode2, backendChildBlendNode2);
+ simulateInitializationSync(&rootBlendNode, backendRootBlendNode);
+ simulateInitializationSync(&childBlendNode1, backendChildBlendNode1);
+ simulateInitializationSync(&childBlendNode2, backendChildBlendNode2);
// THEN
QCOMPARE(backendRootBlendNode->allDependencyIds().size(), 2);
diff --git a/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp b/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp
index e75c4f2f8..732a87770 100644
--- a/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp
+++ b/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp
@@ -137,7 +137,7 @@ private Q_SLOTS:
{
// WHEN
LerpClipBlend backendLerpBlend;
- simulateInitialization(&lerpBlend, &backendLerpBlend);
+ simulateInitializationSync(&lerpBlend, &backendLerpBlend);
// THEN
QCOMPARE(backendLerpBlend.isEnabled(), true);
@@ -148,7 +148,7 @@ private Q_SLOTS:
// WHEN
LerpClipBlend backendLerpBlend;
lerpBlend.setEnabled(false);
- simulateInitialization(&lerpBlend, &backendLerpBlend);
+ simulateInitializationSync(&lerpBlend, &backendLerpBlend);
// THEN
QCOMPARE(backendLerpBlend.peerId(), lerpBlend.id());
@@ -159,27 +159,26 @@ private Q_SLOTS:
void checkSceneChangeEvents()
{
// GIVEN
+ Qt3DAnimation::QLerpClipBlend lerpBlend;
LerpClipBlend backendLerpBlend;
+ simulateInitializationSync(&lerpBlend, &backendLerpBlend);
+
{
- // WHEN
- const bool newValue = false;
- const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId());
- change->setPropertyName("enabled");
- change->setValue(newValue);
- backendLerpBlend.sceneChangeEvent(change);
-
- // THEN
+ // WHEN
+ const bool newValue = false;
+ lerpBlend.setEnabled(newValue);
+ backendLerpBlend.syncFromFrontEnd(&lerpBlend, false);
+
+ // THEN
QCOMPARE(backendLerpBlend.isEnabled(), newValue);
}
{
- // WHEN
- const float newValue = 0.883f;
- const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId());
- change->setPropertyName("blendFactor");
- change->setValue(QVariant::fromValue(newValue));
- backendLerpBlend.sceneChangeEvent(change);
-
- // THEN
+ // WHEN
+ const float newValue = 0.883f;
+ lerpBlend.setBlendFactor(newValue);
+ backendLerpBlend.syncFromFrontEnd(&lerpBlend, false);
+
+ // THEN
QCOMPARE(backendLerpBlend.blendFactor(), newValue);
}
}