summaryrefslogtreecommitdiffstats
path: root/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp')
-rw-r--r--tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
index c23d98672..12eaf1a3c 100644
--- a/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
+++ b/tests/auto/animation/clipblendvalue/tst_clipblendvalue.cpp
@@ -40,6 +40,16 @@ using namespace Qt3DAnimation::Animation;
class tst_ClipBlendValue : public Qt3DCore::QBackendNodeTester
{
Q_OBJECT
+public:
+ AnimationClipLoader *createAnimationClipLoader(Handler *handler,
+ double duration)
+ {
+ auto clipId = Qt3DCore::QNodeId::createId();
+ AnimationClipLoader *clip = handler->animationClipLoaderManager()->getOrCreateResource(clipId);
+ setPeerId(clip, clipId);
+ clip->setDuration(duration);
+ return clip;
+ }
private Q_SLOTS:
void checkInitialState()
@@ -134,6 +144,24 @@ private Q_SLOTS:
QCOMPARE(actualIds.size(), 1);
QCOMPARE(actualIds[0], anotherClipId);
}
+
+ void checkDuration()
+ {
+ // GIVEN
+ auto handler = new Handler();
+ const double expectedDuration = 123.5;
+ auto clip = createAnimationClipLoader(handler, expectedDuration);
+ ClipBlendValue clipNode;
+ clipNode.setHandler(handler);
+ clipNode.setClipBlendNodeManager(handler->clipBlendNodeManager());
+ clipNode.setClipId(clip->peerId());
+
+ // WHEN
+ double actualDuration = clipNode.duration();
+
+ // THEN
+ QCOMPARE(actualDuration, expectedDuration);
+ }
};
QTEST_MAIN(tst_ClipBlendValue)