diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-10-22 08:03:42 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-10-22 15:13:37 +0100 |
commit | 4d0f8bcdea22f70dbf693545d56e1399b3ca0250 (patch) | |
tree | 6c55b0410920e494a94ce95f9a3bff5d99a921fe /tests | |
parent | 7f3bba6e8a4a3bdb36f40a636b76c02902c09d02 (diff) |
Remove remaining messaging code in QSkeletonLoader
And matching unit tests
Change-Id: Iff0b13b2ad9ff07d08c767f4b20de2a1685a5570
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp | 65 | ||||
-rw-r--r-- | tests/auto/render/skeleton/tst_skeleton.cpp | 64 |
2 files changed, 0 insertions, 129 deletions
diff --git a/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp b/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp index 7fcdc4bbe..f0f4c3872 100644 --- a/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp +++ b/tests/auto/core/qskeletonloader/tst_qskeletonloader.cpp @@ -209,71 +209,6 @@ private Q_SLOTS: QCOMPARE(arbiter.events.size(), 0); } } - - void checkStatusPropertyUpdate() - { - // GIVEN - qRegisterMetaType<Qt3DCore::QSkeletonLoader::Status>("Status"); - TestArbiter arbiter; - arbiter.setArbiterOnNode(this); - QSignalSpy spy(this, SIGNAL(statusChanged(Status))); - const QSkeletonLoader::Status newStatus = QSkeletonLoader::Error; - - // THEN - QVERIFY(spy.isValid()); - - // WHEN - QPropertyUpdatedChangePtr valueChange(new QPropertyUpdatedChange(QNodeId())); - valueChange->setPropertyName("status"); - valueChange->setValue(QVariant::fromValue(newStatus)); - sceneChangeEvent(valueChange); - - // THEN - QCOMPARE(spy.count(), 1); - QCOMPARE(arbiter.events.size(), 0); - QCOMPARE(status(), newStatus); - - // WHEN - spy.clear(); - sceneChangeEvent(valueChange); - - // THEN - QCOMPARE(spy.count(), 0); - QCOMPARE(arbiter.events.size(), 0); - QCOMPARE(status(), newStatus); - - // Cleanup - QNodePrivate::get(this)->setArbiter(nullptr); - } - - void checkRootJointPropertyUpdate() - { - // GIVEN - qRegisterMetaType<Qt3DCore::QJoint*>(); - TestArbiter arbiter; - arbiter.setArbiterOnNode(this); - QSignalSpy spy(this, SIGNAL(rootJointChanged(Qt3DCore::QJoint*))); - std::unique_ptr<QJoint> root(new QJoint()); - - // THEN - QVERIFY(spy.isValid()); - QVERIFY(rootJoint() == nullptr); - - // WHEN - auto valueChange = QJointChangePtr::create(id()); - valueChange->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); - valueChange->setPropertyName("rootJoint"); - valueChange->data = std::move(root); - sceneChangeEvent(valueChange); - - // THEN - QCOMPARE(spy.count(), 1); - QCOMPARE(arbiter.dirtyNodes.size(), 1); - QVERIFY(rootJoint() != nullptr); - - // Cleanup - QNodePrivate::get(this)->setArbiter(nullptr); - } }; QTEST_MAIN(tst_QSkeletonLoader) diff --git a/tests/auto/render/skeleton/tst_skeleton.cpp b/tests/auto/render/skeleton/tst_skeleton.cpp index 2786f27a8..63ed51058 100644 --- a/tests/auto/render/skeleton/tst_skeleton.cpp +++ b/tests/auto/render/skeleton/tst_skeleton.cpp @@ -198,70 +198,6 @@ private Q_SLOTS: joint->setName(name); QTest::newRow("inverseBind") << m << localPose << name << joint; } - - void checkCreateFrontendJoints_data() - { - QTest::addColumn<SkeletonData>("skeletonData"); - QTest::addColumn<QJoint *>("expectedRootJoint"); - - QTest::newRow("empty") << SkeletonData() << static_cast<QJoint*>(nullptr); - - SkeletonData skeletonData; - JointInfo rootJointInfo; - skeletonData.joints.push_back(rootJointInfo); - skeletonData.jointNames.push_back(QLatin1String("rootJoint")); - skeletonData.localPoses.push_back(Qt3DCore::Sqt()); - const int childCount = 10; - for (int i = 0; i < childCount; ++i) { - JointInfo childJointInfo; - childJointInfo.parentIndex = 0; - skeletonData.joints.push_back(childJointInfo); - - const float x = static_cast<float>(i); - Qt3DCore::Sqt localPose; - localPose.translation = QVector3D(x, x, x); - skeletonData.localPoses.push_back(localPose); - - skeletonData.jointNames.push_back(QString("Child-%1").arg(i)); - } - - QJoint *rootJoint = new QJoint(); - for (int i = 0; i < childCount; ++i) { - QJoint *childJoint = new QJoint(); - const float x = static_cast<float>(i); - childJoint->setTranslation(QVector3D(x, x, x)); - rootJoint->addChildJoint(childJoint); - } - - QTest::newRow("wide") << skeletonData << rootJoint; - - skeletonData.joints.clear(); - skeletonData.joints.push_back(rootJointInfo); - for (int i = 0; i < childCount; ++i) { - JointInfo childJointInfo; - childJointInfo.parentIndex = i; - skeletonData.joints.push_back(childJointInfo); - - const float x = static_cast<float>(i); - Qt3DCore::Sqt localPose; - localPose.translation = QVector3D(x, x, x); - skeletonData.localPoses.push_back(localPose); - - skeletonData.jointNames.push_back(QString("Child-%1").arg(i)); - } - - rootJoint = new QJoint(); - QJoint *previousJoint = rootJoint; - for (int i = 0; i < childCount; ++i) { - QJoint *childJoint = new QJoint(); - const float x = static_cast<float>(i); - childJoint->setTranslation(QVector3D(x, x, x)); - previousJoint->addChildJoint(childJoint); - previousJoint = childJoint; - } - - QTest::newRow("deep") << skeletonData << rootJoint; - } }; QTEST_APPLESS_MAIN(tst_Skeleton) |