diff options
Diffstat (limited to 'tests/auto/core/qjoint/tst_qjoint.cpp')
-rw-r--r-- | tests/auto/core/qjoint/tst_qjoint.cpp | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/tests/auto/core/qjoint/tst_qjoint.cpp b/tests/auto/core/qjoint/tst_qjoint.cpp index ec1a45f90..436814f7f 100644 --- a/tests/auto/core/qjoint/tst_qjoint.cpp +++ b/tests/auto/core/qjoint/tst_qjoint.cpp @@ -317,69 +317,54 @@ private Q_SLOTS: { // WHEN joint.setScale(QVector3D(2.0f, 1.0f, 3.0f)); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "scale"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<QVector3D>(), joint.scale()); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &joint); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); // WHEN joint.setScale(QVector3D(2.0f, 1.0f, 3.0f)); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } { // WHEN const auto newValue = QQuaternion::fromAxisAndAngle(1.0f, 1.0f, 1.0f, 45.0f); joint.setRotation(newValue); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "rotation"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<QQuaternion>(), newValue); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &joint); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); // WHEN joint.setRotation(newValue); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } { // WHEN const QVector3D newValue(1.0f, 2.0f, 3.0f); joint.setTranslation(newValue); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "translation"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<QVector3D>(), newValue); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &joint); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); // WHEN joint.setTranslation(newValue); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } { @@ -387,23 +372,18 @@ private Q_SLOTS: QMatrix4x4 newValue; newValue.rotate(90.0f, 1.0f, 0.0f, 0.0f); joint.setInverseBindMatrix(newValue); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "inverseBindMatrix"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<QMatrix4x4>(), newValue); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &joint); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); // WHEN joint.setInverseBindMatrix(newValue); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } } }; |