summaryrefslogtreecommitdiffstats
path: root/tests/auto/animation/clock/tst_clock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/animation/clock/tst_clock.cpp')
-rw-r--r--tests/auto/animation/clock/tst_clock.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/animation/clock/tst_clock.cpp b/tests/auto/animation/clock/tst_clock.cpp
index 547ec6a12..a81adfe7b 100644
--- a/tests/auto/animation/clock/tst_clock.cpp
+++ b/tests/auto/animation/clock/tst_clock.cpp
@@ -75,6 +75,35 @@ private Q_SLOTS:
// THEN
QCOMPARE(backendClock.playbackRate(), 1.0);
}
+
+ void checkSceneChangeEvents()
+ {
+ // GIVEN
+ Qt3DAnimation::Animation::Clock backendClock;
+
+ {
+ // WHEN
+ const bool newValue = false;
+ const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId());
+ change->setPropertyName("enabled");
+ change->setValue(newValue);
+ backendClock.sceneChangeEvent(change);
+
+ // THEN
+ QCOMPARE(backendClock.isEnabled(), newValue);
+ }
+ {
+ // WHEN
+ const double newPlaybackRateValue = 2.0;
+ const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId());
+ change->setPropertyName("playbackRate");
+ change->setValue(newPlaybackRateValue);
+ backendClock.sceneChangeEvent(change);
+
+ // THEN
+ QCOMPARE(backendClock.playbackRate(), newPlaybackRateValue);
+ }
+ }
};
QTEST_APPLESS_MAIN(tst_Clock)