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.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp b/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
index c019f2e3bb..c825591972 100644
--- a/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
+++ b/tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp
@@ -48,6 +48,8 @@ public:
private slots:
void initTestCase();
void test_basic();
+ void test_deletion();
+ void test_noDeletion();
};
void tst_qquickitemparticle::initTestCase()
@@ -87,6 +89,29 @@ void tst_qquickitemparticle::test_basic()
delete view;
}
+void tst_qquickitemparticle::test_deletion()
+{
+ QQuickView* view = createView(testFileUrl("managed.qml"), 500);
+ QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
+ ensureAnimTime(500, system->m_animation);
+
+ QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 100, 10));
+ //qDebug() << system->property("acc").toInt(); Seems to be around +15 due to the one frame delay in cleanup compared to creation
+ QVERIFY(extremelyFuzzyCompare(system->property("acc").toInt(), 100, 20));
+ delete view;
+}
+
+void tst_qquickitemparticle::test_noDeletion()
+{
+ QQuickView* view = createView(testFileUrl("unmanaged.qml"), 500);
+ QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
+ ensureAnimTime(500, system->m_animation);
+
+ QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 100, 10));
+ QVERIFY(extremelyFuzzyCompare(system->property("acc").toInt(), 100, 10));
+ delete view;
+}
+
QTEST_MAIN(tst_qquickitemparticle);
#include "tst_qquickitemparticle.moc"