summaryrefslogtreecommitdiffstats
path: root/tests/auto/animation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/animation')
-rw-r--r--tests/auto/animation/animationclip/tst_animationclip.cpp1
-rw-r--r--tests/auto/animation/animationutils/tst_animationutils.cpp2
-rw-r--r--tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp2
-rw-r--r--tests/auto/animation/channelmapper/tst_channelmapper.cpp2
-rw-r--r--tests/auto/animation/channelmapping/tst_channelmapping.cpp2
-rw-r--r--tests/auto/animation/clipanimator/tst_clipanimator.cpp2
-rw-r--r--tests/auto/animation/clipblendnode/tst_clipblendnode.cpp4
-rw-r--r--tests/auto/animation/clock/tst_clock.cpp2
-rw-r--r--tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp2
-rw-r--r--tests/auto/animation/qadditiveclipblend/tst_qadditiveclipblend.cpp117
-rw-r--r--tests/auto/animation/qanimationcliploader/tst_qanimationcliploader.cpp64
-rw-r--r--tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp116
-rw-r--r--tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp83
-rw-r--r--tests/auto/animation/qchannelmapper/tst_qchannelmapper.cpp50
-rw-r--r--tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp104
-rw-r--r--tests/auto/animation/qclipanimator/tst_qclipanimator.cpp91
-rw-r--r--tests/auto/animation/qclipblendvalue/tst_qclipblendvalue.cpp66
-rw-r--r--tests/auto/animation/qclock/tst_qclock.cpp59
-rw-r--r--tests/auto/animation/qlerpclipblend/tst_qlerpclipblend.cpp90
-rw-r--r--tests/auto/animation/qskeletonmapping/tst_qskeletonmapping.cpp67
-rw-r--r--tests/auto/animation/skeleton/tst_skeleton.cpp2
21 files changed, 120 insertions, 808 deletions
diff --git a/tests/auto/animation/animationclip/tst_animationclip.cpp b/tests/auto/animation/animationclip/tst_animationclip.cpp
index d28a8fc58..3860e7726 100644
--- a/tests/auto/animation/animationclip/tst_animationclip.cpp
+++ b/tests/auto/animation/animationclip/tst_animationclip.cpp
@@ -33,7 +33,6 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
using namespace Qt3DAnimation::Animation;
diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp
index 05558192d..0ee455daf 100644
--- a/tests/auto/animation/animationutils/tst_animationutils.cpp
+++ b/tests/auto/animation/animationutils/tst_animationutils.cpp
@@ -46,7 +46,7 @@
#include <QtCore/qbitarray.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
using namespace Qt3DAnimation::Animation;
diff --git a/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp b/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp
index fb741050b..6c99579c2 100644
--- a/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp
+++ b/tests/auto/animation/blendedclipanimator/tst_blendedclipanimator.cpp
@@ -35,7 +35,7 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
#include <QtTest/QTest>
#include <Qt3DAnimation/qblendedclipanimator.h>
diff --git a/tests/auto/animation/channelmapper/tst_channelmapper.cpp b/tests/auto/animation/channelmapper/tst_channelmapper.cpp
index ad9f3c423..8b75b0a52 100644
--- a/tests/auto/animation/channelmapper/tst_channelmapper.cpp
+++ b/tests/auto/animation/channelmapper/tst_channelmapper.cpp
@@ -38,7 +38,7 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
-#include "testpostmanarbiter.h"
+#include "testarbiter.h"
class tst_ChannelMapper : public Qt3DCore::QBackendNodeTester
{
diff --git a/tests/auto/animation/channelmapping/tst_channelmapping.cpp b/tests/auto/animation/channelmapping/tst_channelmapping.cpp
index 26a57449d..9bee116d4 100644
--- a/tests/auto/animation/channelmapping/tst_channelmapping.cpp
+++ b/tests/auto/animation/channelmapping/tst_channelmapping.cpp
@@ -39,7 +39,7 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
-#include "testpostmanarbiter.h"
+#include "testarbiter.h"
class tst_TargetEntity : public Qt3DCore::QEntity
{
diff --git a/tests/auto/animation/clipanimator/tst_clipanimator.cpp b/tests/auto/animation/clipanimator/tst_clipanimator.cpp
index 5eccb0432..ce39f6469 100644
--- a/tests/auto/animation/clipanimator/tst_clipanimator.cpp
+++ b/tests/auto/animation/clipanimator/tst_clipanimator.cpp
@@ -36,7 +36,7 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_ClipAnimator: public Qt3DCore::QBackendNodeTester
{
diff --git a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp
index c8649a692..62d57206d 100644
--- a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp
+++ b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp
@@ -131,7 +131,7 @@ private Q_SLOTS:
ClipBlendNodeManager manager;
TestClipBlendNode backendClipBlendNode;
backendClipBlendNode.setClipBlendNodeManager(&manager);
- simulateInitialization(&clipBlendNode, &backendClipBlendNode);
+ simulateInitializationSync(&clipBlendNode, &backendClipBlendNode);
// THEN
QCOMPARE(backendClipBlendNode.isEnabled(), true);
@@ -146,7 +146,7 @@ private Q_SLOTS:
TestClipBlendNode backendClipBlendNode;
clipBlendNode.setEnabled(false);
backendClipBlendNode.setClipBlendNodeManager(&manager);
- simulateInitialization(&clipBlendNode, &backendClipBlendNode);
+ simulateInitializationSync(&clipBlendNode, &backendClipBlendNode);
// THEN
QCOMPARE(backendClipBlendNode.peerId(), clipBlendNode.id());
diff --git a/tests/auto/animation/clock/tst_clock.cpp b/tests/auto/animation/clock/tst_clock.cpp
index 03be85613..4cc397661 100644
--- a/tests/auto/animation/clock/tst_clock.cpp
+++ b/tests/auto/animation/clock/tst_clock.cpp
@@ -33,7 +33,7 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_Clock: public Qt3DCore::QBackendNodeTester
{
diff --git a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp
index baebf8e46..bfcaae776 100644
--- a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp
+++ b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp
@@ -41,7 +41,7 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
using namespace Qt3DAnimation::Animation;
diff --git a/tests/auto/animation/qadditiveclipblend/tst_qadditiveclipblend.cpp b/tests/auto/animation/qadditiveclipblend/tst_qadditiveclipblend.cpp
index 41f6b268a..edf147d88 100644
--- a/tests/auto/animation/qadditiveclipblend/tst_qadditiveclipblend.cpp
+++ b/tests/auto/animation/qadditiveclipblend/tst_qadditiveclipblend.cpp
@@ -33,10 +33,7 @@
#include <Qt3DAnimation/private/qadditiveclipblend_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
-#include <Qt3DAnimation/qclipblendnodecreatedchange.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include "testpostmanarbiter.h"
+#include "testarbiter.h"
class tst_QAdditiveClipBlend : public QObject
{
@@ -125,97 +122,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QAdditiveClipBlend addBlend;
- Qt3DAnimation::QAdditiveClipBlend baseClip;
- Qt3DAnimation::QAdditiveClipBlend additiveClip;
-
- addBlend.setBaseClip(&baseClip);
- addBlend.setAdditiveClip(&additiveClip);
- addBlend.setAdditiveFactor(0.8f);
-
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&addBlend);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 3); // 1 + 2 clips
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QClipBlendNodeCreatedChange<Qt3DAnimation::QAdditiveClipBlendData>>(creationChanges.first());
- const Qt3DAnimation::QAdditiveClipBlendData cloneData = creationChangeData->data;
-
- QCOMPARE(addBlend.additiveFactor(), cloneData.additiveFactor);
- QCOMPARE(addBlend.id(), creationChangeData->subjectId());
- QCOMPARE(addBlend.isEnabled(), true);
- QCOMPARE(addBlend.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(addBlend.metaObject(), creationChangeData->metaObject());
- QCOMPARE(cloneData.baseClipId, baseClip.id());
- QCOMPARE(cloneData.additiveClipId, additiveClip.id());
- }
-
- // WHEN
- addBlend.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&addBlend);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 3); // 1 + 2 clips
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QClipBlendNodeCreatedChange<Qt3DAnimation::QAdditiveClipBlendData>>(creationChanges.first());
- const Qt3DAnimation::QAdditiveClipBlendData cloneData = creationChangeData->data;
-
- QCOMPARE(addBlend.additiveFactor(), cloneData.additiveFactor);
- QCOMPARE(addBlend.id(), creationChangeData->subjectId());
- QCOMPARE(addBlend.isEnabled(), false);
- QCOMPARE(addBlend.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(addBlend.metaObject(), creationChangeData->metaObject());
- QCOMPARE(cloneData.baseClipId, baseClip.id());
- QCOMPARE(cloneData.additiveClipId, additiveClip.id());
- }
- }
-
- void checkAdditiveFactorUpdate()
- {
- // GIVEN
- TestArbiter arbiter;
- Qt3DAnimation::QAdditiveClipBlend addBlend;
- arbiter.setArbiterOnNode(&addBlend);
-
- {
- // WHEN
- addBlend.setAdditiveFactor(0.4f);
-
- // THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &addBlend);
-
- arbiter.dirtyNodes.clear();
- }
-
- {
- // WHEN
- addBlend.setAdditiveFactor(0.4f);
-
- // THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
- }
-
- }
-
void checkBaseClipUpdate()
{
// GIVEN
@@ -229,11 +135,10 @@ private Q_SLOTS:
addBlend.setBaseClip(baseClip);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &addBlend);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &addBlend);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -241,8 +146,7 @@ private Q_SLOTS:
addBlend.setBaseClip(baseClip);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -259,19 +163,16 @@ private Q_SLOTS:
addBlend.setAdditiveClip(additiveClip);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &addBlend);
- arbiter.dirtyNodes.clear();
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &addBlend);
+ arbiter.clear();
}
{
// WHEN
addBlend.setAdditiveClip(additiveClip);
- //
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
diff --git a/tests/auto/animation/qanimationcliploader/tst_qanimationcliploader.cpp b/tests/auto/animation/qanimationcliploader/tst_qanimationcliploader.cpp
index 00130add3..140235505 100644
--- a/tests/auto/animation/qanimationcliploader/tst_qanimationcliploader.cpp
+++ b/tests/auto/animation/qanimationcliploader/tst_qanimationcliploader.cpp
@@ -30,11 +30,9 @@
#include <QtTest/QTest>
#include <Qt3DAnimation/qanimationcliploader.h>
#include <Qt3DAnimation/private/qanimationcliploader_p.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_QAnimationClipLoader : public Qt3DAnimation::QAnimationClipLoader
{
@@ -78,56 +76,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QAnimationClipLoader clip;
-
- clip.setSource(QUrl(QStringLiteral("http://someRemoteURL.com")));
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&clip);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 1);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QAnimationClipLoaderData>>(creationChanges.first());
- const Qt3DAnimation::QAnimationClipLoaderData data = creationChangeData->data;
-
- QCOMPARE(clip.id(), creationChangeData->subjectId());
- QCOMPARE(clip.isEnabled(), true);
- QCOMPARE(clip.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(clip.metaObject(), creationChangeData->metaObject());
- QCOMPARE(clip.source(), data.source);
- }
-
- // WHEN
- clip.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&clip);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 1);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QAnimationClipLoaderData>>(creationChanges.first());
-
- QCOMPARE(clip.id(), creationChangeData->subjectId());
- QCOMPARE(clip.isEnabled(), false);
- QCOMPARE(clip.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(clip.metaObject(), creationChangeData->metaObject());
- }
- }
-
void checkSourceUpdate()
{
// GIVEN
@@ -140,11 +88,10 @@ private Q_SLOTS:
clip.setSource(QUrl(QStringLiteral("qrc:/toyplane.qlip")));
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &clip);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &clip);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -152,8 +99,7 @@ private Q_SLOTS:
clip.setSource(QStringLiteral("qrc:/toyplane.qlip"));
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
diff --git a/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp b/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp
index 81222292f..9aed1bf15 100644
--- a/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp
+++ b/tests/auto/animation/qblendedclipanimator/tst_qblendedclipanimator.cpp
@@ -32,11 +32,9 @@
#include <Qt3DAnimation/private/qblendedclipanimator_p.h>
#include <Qt3DAnimation/qlerpclipblend.h>
#include <Qt3DAnimation/qchannelmapper.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_QBlendedClipAnimator : public QObject
{
@@ -187,68 +185,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QBlendedClipAnimator blendedClipAnimator;
- Qt3DAnimation::QChannelMapper channelMapper;
- Qt3DAnimation::QLerpClipBlend blendRoot;
-
- blendedClipAnimator.setBlendTree(&blendRoot);
- blendedClipAnimator.setChannelMapper(&channelMapper);
- blendedClipAnimator.setRunning(true);
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&blendedClipAnimator);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 3); // 1 + mapper + blend tree root
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QBlendedClipAnimatorData>>(creationChanges.first());
- const Qt3DAnimation::QBlendedClipAnimatorData cloneData = creationChangeData->data;
-
- QCOMPARE(blendedClipAnimator.blendTree()->id(), cloneData.blendTreeRootId);
- QCOMPARE(blendedClipAnimator.channelMapper()->id(), cloneData.mapperId);
- QCOMPARE(blendedClipAnimator.isRunning(), cloneData.running);
- QCOMPARE(blendedClipAnimator.id(), creationChangeData->subjectId());
- QCOMPARE(blendedClipAnimator.isEnabled(), true);
- QCOMPARE(blendedClipAnimator.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(blendedClipAnimator.metaObject(), creationChangeData->metaObject());
- QCOMPARE(blendedClipAnimator.loopCount(), cloneData.loops);
- QCOMPARE(blendedClipAnimator.normalizedTime(), cloneData.normalizedTime);
- }
-
- // WHEN
- blendedClipAnimator.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&blendedClipAnimator);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 3); // 1 + mapper + blend tree root
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QBlendedClipAnimatorData>>(creationChanges.first());
- const Qt3DAnimation::QBlendedClipAnimatorData cloneData = creationChangeData->data;
-
- QCOMPARE(blendedClipAnimator.blendTree()->id(), cloneData.blendTreeRootId);
- QCOMPARE(blendedClipAnimator.channelMapper()->id(), cloneData.mapperId);
- QCOMPARE(blendedClipAnimator.isRunning(), cloneData.running);
- QCOMPARE(blendedClipAnimator.id(), creationChangeData->subjectId());
- QCOMPARE(blendedClipAnimator.isEnabled(), false);
- QCOMPARE(blendedClipAnimator.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(blendedClipAnimator.metaObject(), creationChangeData->metaObject());
- }
- }
-
void checkBlendTreeUpdate()
{
// GIVEN
@@ -262,11 +198,10 @@ private Q_SLOTS:
blendedClipAnimator.setBlendTree(&blendRoot);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &blendedClipAnimator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &blendedClipAnimator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -274,8 +209,7 @@ private Q_SLOTS:
blendedClipAnimator.setBlendTree(&blendRoot);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -310,11 +244,10 @@ private Q_SLOTS:
blendedClipAnimator.setChannelMapper(&channelMapper);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &blendedClipAnimator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &blendedClipAnimator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -322,8 +255,7 @@ private Q_SLOTS:
blendedClipAnimator.setChannelMapper(&channelMapper);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -357,11 +289,10 @@ private Q_SLOTS:
blendedClipAnimator.setRunning(true);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &blendedClipAnimator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &blendedClipAnimator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -369,8 +300,7 @@ private Q_SLOTS:
blendedClipAnimator.setRunning(true);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -387,11 +317,10 @@ private Q_SLOTS:
blendedClipAnimator.setLoopCount(1584);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &blendedClipAnimator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &blendedClipAnimator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -399,8 +328,7 @@ private Q_SLOTS:
blendedClipAnimator.setLoopCount(1584);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -417,11 +345,10 @@ private Q_SLOTS:
blendedClipAnimator.setNormalizedTime(0.5f);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &blendedClipAnimator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &blendedClipAnimator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -429,8 +356,7 @@ private Q_SLOTS:
blendedClipAnimator.setNormalizedTime(0.5f);
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
diff --git a/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp b/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp
index fe1a2eda8..5037937a1 100644
--- a/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp
+++ b/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp
@@ -29,13 +29,10 @@
#include <QtTest/QTest>
#include <Qt3DAnimation/qcallbackmapping.h>
#include <Qt3DAnimation/private/qcallbackmapping_p.h>
-#include <Qt3DAnimation/private/qchannelmappingcreatedchange_p.h>
#include <Qt3DCore/qentity.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class DummyCallback : public Qt3DAnimation::QAnimationCallback
{
@@ -93,66 +90,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QCallbackMapping mapping;
- auto callback = new DummyCallback();
-
- mapping.setChannelName(QStringLiteral("Location"));
- mapping.setCallback(QVariant::Vector3D, callback);
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&mapping);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 1);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QChannelMappingCreatedChange<Qt3DAnimation::QCallbackMappingData>>(creationChanges.first());
- const Qt3DAnimation::QCallbackMappingData data = creationChangeData->data;
-
- QCOMPARE(mapping.id(), creationChangeData->subjectId());
- QCOMPARE(mapping.isEnabled(), true);
- QCOMPARE(mapping.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(mapping.metaObject(), creationChangeData->metaObject());
- QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::CallbackMapping);
- QCOMPARE(mapping.channelName(), data.channelName);
- QCOMPARE(mapping.callback(), data.callback);
- QCOMPARE(int(QVariant::Vector3D), data.type);
- }
-
- // WHEN
- mapping.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&mapping);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 1);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QChannelMappingCreatedChange<Qt3DAnimation::QCallbackMappingData>>(creationChanges.first());
- const Qt3DAnimation::QCallbackMappingData data = creationChangeData->data;
-
- QCOMPARE(mapping.id(), creationChangeData->subjectId());
- QCOMPARE(mapping.isEnabled(), false);
- QCOMPARE(mapping.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(mapping.metaObject(), creationChangeData->metaObject());
- QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::CallbackMapping);
- QCOMPARE(mapping.channelName(), data.channelName);
- QCOMPARE(mapping.callback(), data.callback);
- QCOMPARE(QVariant::Vector3D, data.type);
- }
- }
-
void checkPropertyUpdateChanges()
{
// GIVEN
@@ -165,16 +102,16 @@ private Q_SLOTS:
mapping.setChannelName(QStringLiteral("Scale"));
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &mapping);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &mapping);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// WHEN
mapping.setChannelName(QStringLiteral("Scale"));
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
{
@@ -184,19 +121,17 @@ private Q_SLOTS:
QCoreApplication::processEvents();
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &mapping);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &mapping);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// WHEN
mapping.setCallback(QVariant::Vector3D, callback, Qt3DAnimation::QAnimationCallback::OnThreadPool);
QCoreApplication::processEvents();
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
};
diff --git a/tests/auto/animation/qchannelmapper/tst_qchannelmapper.cpp b/tests/auto/animation/qchannelmapper/tst_qchannelmapper.cpp
index a55a509b2..45c9c0f04 100644
--- a/tests/auto/animation/qchannelmapper/tst_qchannelmapper.cpp
+++ b/tests/auto/animation/qchannelmapper/tst_qchannelmapper.cpp
@@ -29,13 +29,12 @@
#include <QtTest/QTest>
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/private/qscene_p.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <Qt3DAnimation/qchannelmapper.h>
#include <Qt3DAnimation/private/qchannelmapper_p.h>
#include <Qt3DAnimation/qchannelmapping.h>
-#include "testpostmanarbiter.h"
+#include <testarbiter.h>
class tst_QChannelmapper : public Qt3DAnimation::QChannelMapper
{
@@ -47,47 +46,6 @@ public:
}
private Q_SLOTS:
- void checkCreationChange_data()
- {
- QTest::addColumn<Qt3DAnimation::QChannelMapper *>("mapper");
-
- Qt3DAnimation::QChannelMapper *defaultConstructed = new Qt3DAnimation::QChannelMapper;
- QTest::newRow("defaultConstructed") << defaultConstructed;
-
- Qt3DAnimation::QChannelMapper *mapperWithMappings = new Qt3DAnimation::QChannelMapper;
- mapperWithMappings->addMapping(new Qt3DAnimation::QChannelMapping);
- mapperWithMappings->addMapping(new Qt3DAnimation::QChannelMapping);
- mapperWithMappings->addMapping(new Qt3DAnimation::QChannelMapping);
- QTest::newRow("mapperWithMappings") << mapperWithMappings;
- }
-
- void checkCreationChange()
- {
- // GIVEN
- QFETCH(Qt3DAnimation::QChannelMapper *, mapper);
-
- // WHEN
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(mapper);
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges = creationChangeGenerator.creationChanges();
-
- const int mappingCount = mapper->mappings().count();
-
- // THEN
- QCOMPARE(creationChanges.size(), 1 + mappingCount);
-
- const Qt3DCore::QNodeCreatedChangePtr<Qt3DAnimation::QChannelMapperData> creationChange =
- qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QChannelMapperData>>(creationChanges.first());
- const Qt3DAnimation::QChannelMapperData &creationData = creationChange->data;
-
- // THEN
- QCOMPARE(mapper->id(), creationChange->subjectId());
- QCOMPARE(mapper->isEnabled(), creationChange->isNodeEnabled());
- QCOMPARE(mapper->metaObject(), creationChange->metaObject());
- QCOMPARE(mappingCount, creationData.mappingIds.count());
-
- for (int i = 0; i < mappingCount; ++i)
- QCOMPARE(mapper->mappings().at(i)->id(), creationData.mappingIds.at(i));
- }
void checkPropertyUpdates()
{
@@ -100,10 +58,10 @@ private Q_SLOTS:
mapper->setEnabled(false);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), mapper.data());
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), mapper.data());
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
void checkMappingBookkeeping()
diff --git a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp
index 749bc5ec7..714fbdd90 100644
--- a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp
+++ b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp
@@ -30,14 +30,11 @@
#include <Qt3DAnimation/qchannelmapping.h>
#include <Qt3DAnimation/private/qabstractchannelmapping_p.h>
#include <Qt3DAnimation/private/qchannelmapping_p.h>
-#include <Qt3DAnimation/private/qchannelmappingcreatedchange_p.h>
#include <Qt3DCore/qentity.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
#include <QQuaternion>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_QTargetEntity : public Qt3DCore::QEntity
{
@@ -169,71 +166,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QChannelMapping mapping;
- auto target = new tst_QTargetEntity;
-
- mapping.setChannelName(QStringLiteral("Location"));
- mapping.setTarget(target);
- mapping.setProperty(QStringLiteral("translation"));
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&mapping);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 2); // 1 for mapping, 1 for target
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QChannelMappingCreatedChange<Qt3DAnimation::QChannelMappingData>>(creationChanges.first());
- const Qt3DAnimation::QChannelMappingData data = creationChangeData->data;
-
- QCOMPARE(mapping.id(), creationChangeData->subjectId());
- QCOMPARE(mapping.isEnabled(), true);
- QCOMPARE(mapping.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(mapping.metaObject(), creationChangeData->metaObject());
- QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::ChannelMapping);
- QCOMPARE(mapping.channelName(), data.channelName);
- QCOMPARE(mapping.target()->id(), data.targetId);
- QVERIFY(qstrcmp(mapping.property().toLatin1().constData(), data.propertyName) == 0);
- QCOMPARE(data.type, static_cast<int>(QVariant::Vector3D));
- QCOMPARE(data.componentCount, 3);
- }
-
- // WHEN
- mapping.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&mapping);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 2); // 1 for mapping, 1 for target
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QChannelMappingCreatedChange<Qt3DAnimation::QChannelMappingData>>(creationChanges.first());
- const Qt3DAnimation::QChannelMappingData data = creationChangeData->data;
-
- QCOMPARE(mapping.id(), creationChangeData->subjectId());
- QCOMPARE(mapping.isEnabled(), false);
- QCOMPARE(mapping.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(mapping.metaObject(), creationChangeData->metaObject());
- QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::ChannelMapping);
- QCOMPARE(mapping.channelName(), data.channelName);
- QCOMPARE(mapping.target()->id(), data.targetId);
- QVERIFY(qstrcmp(mapping.property().toLatin1().constData(), data.propertyName) == 0);
- QCOMPARE(data.type, static_cast<int>(QVariant::Vector3D));
- QCOMPARE(data.componentCount, 3);
- }
- }
-
void checkPropertyUpdateChanges()
{
// GIVEN
@@ -247,16 +179,16 @@ private Q_SLOTS:
mapping.setChannelName(QStringLiteral("Scale"));
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &mapping);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &mapping);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// WHEN
mapping.setChannelName(QStringLiteral("Scale"));
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
{
@@ -264,16 +196,16 @@ private Q_SLOTS:
mapping.setTarget(target.data());
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &mapping);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &mapping);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// WHEN
mapping.setTarget(target.data());
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
{
@@ -283,19 +215,17 @@ private Q_SLOTS:
QCoreApplication::processEvents();
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &mapping);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &mapping);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// WHEN
mapping.setProperty(QStringLiteral("scale"));
QCoreApplication::processEvents();
// THEN
- QCOMPARE(arbiter.events.size(), 0);
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -341,16 +271,16 @@ private Q_SLOTS:
target->setProperty(propertyName.constData(), value);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), target.data());
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), target.data());
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// THEN
mapping.setProperty(QString::fromLatin1(propertyName));
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
}
}
diff --git a/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp b/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp
index 174cd6bce..34544d04b 100644
--- a/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp
+++ b/tests/auto/animation/qclipanimator/tst_qclipanimator.cpp
@@ -34,11 +34,9 @@
#include <Qt3DAnimation/qclipanimator.h>
#include <Qt3DAnimation/private/qanimationclip_p.h>
#include <Qt3DAnimation/private/qclipanimator_p.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_QClipAnimator : public QObject
{
@@ -181,61 +179,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QClipAnimator animator;
- auto clip = new Qt3DAnimation::QAnimationClipLoader();
- animator.setClip(clip);
- auto mapper = new Qt3DAnimation::QChannelMapper();
- animator.setChannelMapper(mapper);
- auto clock = new Qt3DAnimation::QClock();
- animator.setClock(clock);
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&animator);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 4);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QClipAnimatorData>>(creationChanges.first());
- const Qt3DAnimation::QClipAnimatorData data = creationChangeData->data;
-
- QCOMPARE(animator.id(), creationChangeData->subjectId());
- QCOMPARE(animator.isEnabled(), true);
- QCOMPARE(animator.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(animator.metaObject(), creationChangeData->metaObject());
- QCOMPARE(animator.clip()->id(), data.clipId);
- QCOMPARE(animator.channelMapper()->id(), data.mapperId);
- QCOMPARE(animator.clock()->id(), data.clockId);
- QCOMPARE(animator.loopCount(), data.loops);
- }
-
- // WHEN
- animator.setEnabled(false);
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&animator);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 4);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QClipAnimatorData>>(creationChanges.first());
-
- QCOMPARE(animator.id(), creationChangeData->subjectId());
- QCOMPARE(animator.isEnabled(), false);
- QCOMPARE(animator.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(animator.metaObject(), creationChangeData->metaObject());
- }
- }
-
void checkPropertyUpdate()
{
// GIVEN
@@ -249,10 +192,10 @@ private Q_SLOTS:
animator.setClip(clip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &animator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &animator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -260,7 +203,7 @@ private Q_SLOTS:
animator.setClip(clip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
// GIVEN
@@ -270,10 +213,10 @@ private Q_SLOTS:
animator.setChannelMapper(mapper);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &animator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &animator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -281,7 +224,7 @@ private Q_SLOTS:
animator.setChannelMapper(mapper);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
// GIVEN
@@ -291,10 +234,10 @@ private Q_SLOTS:
animator.setClock(clock);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &animator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &animator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -302,7 +245,7 @@ private Q_SLOTS:
animator.setClock(clock);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
{
@@ -310,10 +253,10 @@ private Q_SLOTS:
animator.setLoopCount(10);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &animator);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &animator);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -321,7 +264,7 @@ private Q_SLOTS:
animator.setLoopCount(10);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
diff --git a/tests/auto/animation/qclipblendvalue/tst_qclipblendvalue.cpp b/tests/auto/animation/qclipblendvalue/tst_qclipblendvalue.cpp
index b7e4f453b..d34ee0d31 100644
--- a/tests/auto/animation/qclipblendvalue/tst_qclipblendvalue.cpp
+++ b/tests/auto/animation/qclipblendvalue/tst_qclipblendvalue.cpp
@@ -33,10 +33,7 @@
#include <Qt3DAnimation/private/qclipblendvalue_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
-#include <Qt3DAnimation/qclipblendnodecreatedchange.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include "testpostmanarbiter.h"
+#include <testarbiter.h>
class tst_QClipBlendValue : public QObject
{
@@ -83,59 +80,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QClipBlendValue clipBlendNode;
- Qt3DAnimation::QAnimationClipLoader clip;
-
- clipBlendNode.setClip(&clip);
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&clipBlendNode);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 2); // 1 + 1 clip
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QClipBlendNodeCreatedChange<Qt3DAnimation::QClipBlendValueData>>(creationChanges.first());
- const Qt3DAnimation::QClipBlendValueData cloneData = creationChangeData->data;
-
- QCOMPARE(clipBlendNode.id(), creationChangeData->subjectId());
- QCOMPARE(clipBlendNode.isEnabled(), true);
- QCOMPARE(clipBlendNode.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(clipBlendNode.metaObject(), creationChangeData->metaObject());
- QCOMPARE(cloneData.clipId, clip.id());
- }
-
- // WHEN
- clipBlendNode.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&clipBlendNode);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 2); // 1 + 1 clip
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QClipBlendNodeCreatedChange<Qt3DAnimation::QClipBlendValueData>>(creationChanges.first());
- const Qt3DAnimation::QClipBlendValueData cloneData = creationChangeData->data;
-
- QCOMPARE(clipBlendNode.id(), creationChangeData->subjectId());
- QCOMPARE(clipBlendNode.isEnabled(), false);
- QCOMPARE(clipBlendNode.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(clipBlendNode.metaObject(), creationChangeData->metaObject());
- QCOMPARE(cloneData.clipId, clip.id());
- }
- }
-
void checkClipUpdate()
{
// GIVEN
@@ -149,10 +93,10 @@ private Q_SLOTS:
clipBlendNode.setClip(clip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &clipBlendNode);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &clipBlendNode);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -160,7 +104,7 @@ private Q_SLOTS:
clipBlendNode.setClip(clip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
diff --git a/tests/auto/animation/qclock/tst_qclock.cpp b/tests/auto/animation/qclock/tst_qclock.cpp
index 65c485566..04e479774 100644
--- a/tests/auto/animation/qclock/tst_qclock.cpp
+++ b/tests/auto/animation/qclock/tst_qclock.cpp
@@ -30,11 +30,9 @@
#include <QtTest/QTest>
#include <Qt3DAnimation/qclock.h>
#include <Qt3DAnimation/private/qclock_p.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_QClock : public QObject
{
@@ -79,53 +77,6 @@ private Q_SLOTS:
QCOMPARE(spy.count(), 0);
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QClock clock;
- clock.setPlaybackRate(10.f);
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&clock);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 1);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QClockData>>(creationChanges.first());
- const Qt3DAnimation::QClockData data = creationChangeData->data;
-
- QCOMPARE(clock.id(), creationChangeData->subjectId());
- QCOMPARE(clock.isEnabled(), true);
- QCOMPARE(clock.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(clock.metaObject(), creationChangeData->metaObject());
- QCOMPARE(clock.playbackRate(), data.playbackRate);
- }
-
- // WHEN
- clock.setEnabled(false);
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&clock);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 1);
-
- const auto creationChangeData = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<Qt3DAnimation::QClockData>>(creationChanges.first());
-
- QCOMPARE(clock.id(), creationChangeData->subjectId());
- QCOMPARE(clock.isEnabled(), false);
- QCOMPARE(clock.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(clock.metaObject(), creationChangeData->metaObject());
- }
- }
-
void checkPropertyUpdate()
{
// GIVEN
@@ -138,10 +89,10 @@ private Q_SLOTS:
clock.setPlaybackRate(10.5f);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &clock);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &clock);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -149,7 +100,7 @@ private Q_SLOTS:
clock.setPlaybackRate(10.5f);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
};
diff --git a/tests/auto/animation/qlerpclipblend/tst_qlerpclipblend.cpp b/tests/auto/animation/qlerpclipblend/tst_qlerpclipblend.cpp
index 68970838c..11d094596 100644
--- a/tests/auto/animation/qlerpclipblend/tst_qlerpclipblend.cpp
+++ b/tests/auto/animation/qlerpclipblend/tst_qlerpclipblend.cpp
@@ -33,10 +33,7 @@
#include <Qt3DAnimation/private/qlerpclipblend_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
-#include <Qt3DAnimation/qclipblendnodecreatedchange.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include "testpostmanarbiter.h"
+#include "testarbiter.h"
class tst_QLerpClipBlend : public QObject
{
@@ -125,67 +122,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QLerpClipBlend lerpBlend;
- Qt3DAnimation::QLerpClipBlend startClip;
- Qt3DAnimation::QLerpClipBlend endClip;
-
- lerpBlend.setStartClip(&startClip);
- lerpBlend.setEndClip(&endClip);
- lerpBlend.setBlendFactor(0.8f);
-
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&lerpBlend);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 3); // 1 + 2 clips
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QClipBlendNodeCreatedChange<Qt3DAnimation::QLerpClipBlendData>>(creationChanges.first());
- const Qt3DAnimation::QLerpClipBlendData cloneData = creationChangeData->data;
-
- QCOMPARE(lerpBlend.blendFactor(), cloneData.blendFactor);
- QCOMPARE(lerpBlend.id(), creationChangeData->subjectId());
- QCOMPARE(lerpBlend.isEnabled(), true);
- QCOMPARE(lerpBlend.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(lerpBlend.metaObject(), creationChangeData->metaObject());
- QCOMPARE(cloneData.startClipId, startClip.id());
- QCOMPARE(cloneData.endClipId, endClip.id());
- }
-
- // WHEN
- lerpBlend.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&lerpBlend);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 3); // 1 + 2 clips
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QClipBlendNodeCreatedChange<Qt3DAnimation::QLerpClipBlendData>>(creationChanges.first());
- const Qt3DAnimation::QLerpClipBlendData cloneData = creationChangeData->data;
-
- QCOMPARE(lerpBlend.blendFactor(), cloneData.blendFactor);
- QCOMPARE(lerpBlend.id(), creationChangeData->subjectId());
- QCOMPARE(lerpBlend.isEnabled(), false);
- QCOMPARE(lerpBlend.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(lerpBlend.metaObject(), creationChangeData->metaObject());
- QCOMPARE(cloneData.startClipId, startClip.id());
- QCOMPARE(cloneData.endClipId, endClip.id());
- }
- }
-
void checkBlendFactorUpdate()
{
// GIVEN
@@ -198,10 +134,10 @@ private Q_SLOTS:
lerpBlend.setBlendFactor(0.4f);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &lerpBlend);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &lerpBlend);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -209,7 +145,7 @@ private Q_SLOTS:
lerpBlend.setBlendFactor(0.4f);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -227,10 +163,10 @@ private Q_SLOTS:
lerpBlend.setStartClip(startClip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &lerpBlend);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &lerpBlend);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -238,7 +174,7 @@ private Q_SLOTS:
lerpBlend.setStartClip(startClip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
@@ -255,10 +191,10 @@ private Q_SLOTS:
lerpBlend.setEndClip(endClip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &lerpBlend);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &lerpBlend);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
}
{
@@ -266,7 +202,7 @@ private Q_SLOTS:
lerpBlend.setEndClip(endClip);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
diff --git a/tests/auto/animation/qskeletonmapping/tst_qskeletonmapping.cpp b/tests/auto/animation/qskeletonmapping/tst_qskeletonmapping.cpp
index 1eff6a568..b1d0928d8 100644
--- a/tests/auto/animation/qskeletonmapping/tst_qskeletonmapping.cpp
+++ b/tests/auto/animation/qskeletonmapping/tst_qskeletonmapping.cpp
@@ -31,11 +31,9 @@
#include <Qt3DAnimation/private/qskeletonmapping_p.h>
#include <Qt3DCore/qskeleton.h>
#include <Qt3DCore/qentity.h>
-#include <Qt3DCore/qnodecreatedchange.h>
-#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <QObject>
#include <QSignalSpy>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
class tst_QSkeletonMapping : public QObject
{
@@ -82,61 +80,6 @@ private Q_SLOTS:
}
}
- void checkCreationData()
- {
- // GIVEN
- Qt3DAnimation::QSkeletonMapping mapping;
- auto target = new Qt3DCore::QSkeleton;
-
- mapping.setSkeleton(target);
-
- // WHEN
- QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges;
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&mapping);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 2); // 1 for mapping, 1 for skeleton
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QChannelMappingCreatedChange<Qt3DAnimation::QSkeletonMappingData>>(creationChanges.first());
- const Qt3DAnimation::QSkeletonMappingData data = creationChangeData->data;
-
- QCOMPARE(mapping.id(), creationChangeData->subjectId());
- QCOMPARE(mapping.isEnabled(), true);
- QCOMPARE(mapping.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(mapping.metaObject(), creationChangeData->metaObject());
- QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::SkeletonMapping);
- QCOMPARE(mapping.skeleton()->id(), data.skeletonId);
- }
-
- // WHEN
- mapping.setEnabled(false);
-
- {
- Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(&mapping);
- creationChanges = creationChangeGenerator.creationChanges();
- }
-
- // THEN
- {
- QCOMPARE(creationChanges.size(), 2); // 1 for mapping, 1 for skeleton
-
- const auto creationChangeData = qSharedPointerCast<Qt3DAnimation::QChannelMappingCreatedChange<Qt3DAnimation::QSkeletonMappingData>>(creationChanges.first());
- const Qt3DAnimation::QSkeletonMappingData data = creationChangeData->data;
-
- QCOMPARE(mapping.id(), creationChangeData->subjectId());
- QCOMPARE(mapping.isEnabled(), false);
- QCOMPARE(mapping.isEnabled(), creationChangeData->isNodeEnabled());
- QCOMPARE(mapping.metaObject(), creationChangeData->metaObject());
- QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::SkeletonMapping);
- QCOMPARE(mapping.skeleton()->id(), data.skeletonId);
- }
- }
-
void checkPropertyUpdateChanges()
{
// GIVEN
@@ -150,16 +93,16 @@ private Q_SLOTS:
mapping.setSkeleton(target);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 1);
- QCOMPARE(arbiter.dirtyNodes.front(), &mapping);
+ QCOMPARE(arbiter.dirtyNodes().size(), 1);
+ QCOMPARE(arbiter.dirtyNodes().front(), &mapping);
- arbiter.dirtyNodes.clear();
+ arbiter.clear();
// WHEN
mapping.setSkeleton(target);
// THEN
- QCOMPARE(arbiter.dirtyNodes.size(), 0);
+ QCOMPARE(arbiter.dirtyNodes().size(), 0);
}
}
};
diff --git a/tests/auto/animation/skeleton/tst_skeleton.cpp b/tests/auto/animation/skeleton/tst_skeleton.cpp
index d9b209194..3b4b0a429 100644
--- a/tests/auto/animation/skeleton/tst_skeleton.cpp
+++ b/tests/auto/animation/skeleton/tst_skeleton.cpp
@@ -34,7 +34,7 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/private/qbackendnode_p.h>
#include <qbackendnodetester.h>
-#include <testpostmanarbiter.h>
+#include <testarbiter.h>
using namespace Qt3DCore;
using namespace Qt3DAnimation;