summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-10-03 11:10:40 +0100
committerMike Krus <mike.krus@kdab.com>2019-10-08 12:48:24 +0100
commite504957c8437a24c30a9525a04cba91c91049a4f (patch)
tree1c55bfa56d5a17e9f6452bfade4e98aff3e4d99e /tests
parent06567dc188c9302c5f2a4f9f86e8157051448f03 (diff)
Move skeleton loading code to job
Also removes last couple of messages updating backend to frontend. Change-Id: I65056c7cf5ff06efab9c9a205f843ed882f9c0be Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/render/skeleton/tst_skeleton.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/auto/render/skeleton/tst_skeleton.cpp b/tests/auto/render/skeleton/tst_skeleton.cpp
index c72f98a89..6af055fb0 100644
--- a/tests/auto/render/skeleton/tst_skeleton.cpp
+++ b/tests/auto/render/skeleton/tst_skeleton.cpp
@@ -220,30 +220,6 @@ private Q_SLOTS:
QTest::newRow("inverseBind") << m << localPose << name << joint;
}
- void checkCreateFrontendJoint()
- {
- // GIVEN
- Skeleton backendSkeleton;
- QFETCH(QMatrix4x4, inverseBindMatrix);
- QFETCH(Qt3DCore::Sqt, localPose);
- QFETCH(QString, jointName);
- QFETCH(QJoint *, expectedJoint);
-
- // WHEN
- const QJoint *actualJoint = backendSkeleton.createFrontendJoint(jointName, localPose, inverseBindMatrix);
-
- // THEN
- QCOMPARE(actualJoint->scale(), expectedJoint->scale());
- QCOMPARE(actualJoint->rotation(), expectedJoint->rotation());
- QCOMPARE(actualJoint->translation(), expectedJoint->translation());
- QCOMPARE(actualJoint->inverseBindMatrix(), expectedJoint->inverseBindMatrix());
- QCOMPARE(actualJoint->name(), expectedJoint->name());
-
- // Cleanup
- delete actualJoint;
- delete expectedJoint;
- }
-
void checkCreateFrontendJoints_data()
{
QTest::addColumn<SkeletonData>("skeletonData");
@@ -307,46 +283,6 @@ private Q_SLOTS:
QTest::newRow("deep") << skeletonData << rootJoint;
}
-
- void checkCreateFrontendJoints()
- {
- // GIVEN
- Skeleton backendSkeleton;
- QFETCH(SkeletonData, skeletonData);
- QFETCH(QJoint *, expectedRootJoint);
-
- // WHEN
- QJoint *actualRootJoint = backendSkeleton.createFrontendJoints(skeletonData);
-
- // THEN
- if (skeletonData.joints.isEmpty()) {
- QVERIFY(actualRootJoint == expectedRootJoint); // nullptr
- return;
- }
-
- // Linearise the tree of joints and check them against the skeletonData
- QVector<QJoint *> joints = linearizeTree(actualRootJoint);
- QCOMPARE(joints.size(), skeletonData.joints.size());
- for (int i = 0; i < joints.size(); ++i) {
- // Check the translations match
- QCOMPARE(joints[i]->translation(), skeletonData.localPoses[i].translation);
- }
-
- // Now we know the order of Joints match. Check the parents match too
- for (int i = 0; i < joints.size(); ++i) {
- // Get parent index from joint info
- const int parentIndex = skeletonData.joints[i].parentIndex;
- if (parentIndex == -1) {
- QVERIFY(joints[i]->parent() == nullptr);
- } else {
- QCOMPARE(joints[i]->parent(), joints[parentIndex]);
- }
- }
-
- // Cleanup
- delete actualRootJoint;
- delete expectedRootJoint;
- }
};
QTEST_APPLESS_MAIN(tst_Skeleton)