aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp')
-rw-r--r--tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp b/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
index ea4e7a97a6..28ebbb3c05 100644
--- a/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
+++ b/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
@@ -45,6 +45,7 @@ private slots:
void test_basic();
void test_deletion();
void test_noDeletion();
+ void test_takeGive();
void test_noCrashOnReset();
void test_noLeakWhenDeleted();
};
@@ -109,6 +110,18 @@ void tst_qquickitemparticle::test_noDeletion()
delete view;
}
+void tst_qquickitemparticle::test_takeGive()
+{
+ QQuickView* view = createView(testFileUrl("takeGive.qml"), 500);
+ QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
+ QMetaObject::invokeMethod(view->rootObject(), "takeItems");
+ ensureAnimTime(1000, system->m_animation);
+ QVERIFY(system->property("acc").toInt() == 100);
+ QMetaObject::invokeMethod(view->rootObject(), "giveItems");
+ QTRY_VERIFY(system->property("acc").toInt() == 0);
+ delete view;
+}
+
void tst_qquickitemparticle::test_noCrashOnReset()
{
QQuickView* view = createView(testFileUrl("basic.qml"), 600);