diff options
Diffstat (limited to 'tests/auto/animation/qclipanimator/tst_qclipanimator.cpp')
-rw-r--r-- | tests/auto/animation/qclipanimator/tst_qclipanimator.cpp | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp b/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp index 0b28228d9..711653819 100644 --- a/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp +++ b/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp @@ -248,25 +248,20 @@ private Q_SLOTS: { // WHEN animator.setClip(clip); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "clip"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), clip->id()); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &animator); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); } { // WHEN animator.setClip(clip); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } // GIVEN @@ -274,25 +269,20 @@ private Q_SLOTS: { // WHEN animator.setChannelMapper(mapper); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "channelMapper"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), mapper->id()); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &animator); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); } { // WHEN animator.setChannelMapper(mapper); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } // GIVEN @@ -300,49 +290,39 @@ private Q_SLOTS: { // WHEN animator.setClock(clock); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "clock"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), clock->id()); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &animator); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); } { // WHEN animator.setClock(clock); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } { // WHEN animator.setLoopCount(10); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "loops"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().toInt(), animator.loopCount()); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QCOMPARE(arbiter.dirtyNodes.front(), &animator); - arbiter.events.clear(); + arbiter.dirtyNodes.clear(); } { // WHEN animator.setLoopCount(10); - QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 0); } } |