aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-10-20 13:07:21 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-10-24 10:41:20 +0200
commitd21c096f358eaf4dd7245680f38b836bebe43da5 (patch)
tree134a43cf5efd2efce20c7b1b04f7375027f711ff /tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
parent4e7c588f027f6a846fc343975bc8bcce5f69f6ff (diff)
Fix crash in SpriteSequence
When QML declares sprites and goalSprite in wrong order the goalsprite attempts to set it on null spriteEngine. This patch ensures that the order doesn't matter anymore. Task-number: QTBUG-40595 Change-Id: I57f1c8754b2e2af91e0c7f72d1d67fec3ad4ede5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp')
-rw-r--r--tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp b/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
index 6cfdc90364..26ddff1009 100644
--- a/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
+++ b/tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp
@@ -46,6 +46,8 @@ private slots:
void test_framerateAdvance();//Separate codepath for QQuickSpriteEngine
void test_huge();//Separate codepath for QQuickSpriteEngine
void test_jumpToCrash();
+ void test_spriteBeforeGoal();
+ void test_spriteAfterGoal();
};
void tst_qquickspritesequence::test_properties()
@@ -119,6 +121,30 @@ void tst_qquickspritesequence::test_jumpToCrash()
delete window;
}
+void tst_qquickspritesequence::test_spriteBeforeGoal()
+{
+ QQuickView *window = new QQuickView(0);
+
+ window->setSource(testFileUrl("spritebeforegoal.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+ //verify: Don't crash
+
+ delete window;
+}
+
+void tst_qquickspritesequence::test_spriteAfterGoal()
+{
+ QQuickView *window = new QQuickView(0);
+
+ window->setSource(testFileUrl("spriteaftergoal.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+ //verify: Don't crash
+
+ delete window;
+}
+
QTEST_MAIN(tst_qquickspritesequence)
#include "tst_qquickspritesequence.moc"