summaryrefslogtreecommitdiffstats
path: root/tests/auto/animation
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-10-08 08:01:10 +0100
committerMike Krus <mike.krus@kdab.com>2019-10-21 15:38:45 +0100
commit1e499f548a24482a0809a34767a04c91a940ffe8 (patch)
tree70bab2e2613540b5d0d40a01beeeb2e2fe4eef77 /tests/auto/animation
parentae88eeee627664b06935004cc0d2868b65905d62 (diff)
Remove old code from animation classes & update tests
Change-Id: Ic91a4f168172d6f34d858488e6fc170e8ed875f9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/animation')
-rw-r--r--tests/auto/animation/channelmapping/tst_channelmapping.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/tests/auto/animation/channelmapping/tst_channelmapping.cpp b/tests/auto/animation/channelmapping/tst_channelmapping.cpp
index e108e3d26..26a57449d 100644
--- a/tests/auto/animation/channelmapping/tst_channelmapping.cpp
+++ b/tests/auto/animation/channelmapping/tst_channelmapping.cpp
@@ -38,7 +38,6 @@
#include <Qt3DCore/qskeleton.h>
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/private/qscene_p.h>
-#include <Qt3DCore/qpropertyupdatedchange.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include "testpostmanarbiter.h"
@@ -181,16 +180,31 @@ private Q_SLOTS:
const char *testName = "translation";
QCOMPARE(qstrcmp(testName, backendMapping.propertyName()), 0);
+ }
-// // WHEN
-// const auto skeletonId = Qt3DCore::QNodeId::createId();
-// updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
-// updateChange->setPropertyName("skeleton");
-// updateChange->setValue(QVariant::fromValue(skeletonId));
-// backendMapping.sceneChangeEvent(updateChange);
+ void checkSkeletonPropertyUpdate()
+ {
+ // GIVEN
+ Qt3DAnimation::QSkeletonMapping mapping;
+ Qt3DAnimation::Animation::Handler handler;
+ Qt3DAnimation::Animation::ChannelMapping backendMapping;
+ backendMapping.setHandler(&handler);
+ simulateInitializationSync(&mapping, &backendMapping);
-// // THEN
-// QCOMPARE(backendMapping.skeletonId(), skeletonId);
+ // WHEN
+ mapping.setEnabled(false);
+ backendMapping.syncFromFrontEnd(&mapping, false);
+
+ // THEN
+ QCOMPARE(backendMapping.isEnabled(), false);
+
+ // WHEN
+ auto skeleton = new Qt3DCore::QSkeleton;
+ mapping.setSkeleton(skeleton);
+ backendMapping.syncFromFrontEnd(&mapping, false);
+
+ // THEN
+ QCOMPARE(backendMapping.skeletonId(), skeleton->id());
}
};