aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickspriteimage/data/advance.qml66
-rw-r--r--tests/auto/quick/qquickspriteimage/data/basic.qml60
-rw-r--r--tests/auto/quick/qquickspriteimage/data/squarefacesprite.pngbin496 -> 0 bytes
-rw-r--r--tests/auto/quick/qquickspriteimage/qquickspriteimage.pro13
-rw-r--r--tests/auto/quick/qquickspriteimage/tst_qquickspriteimage.cpp98
-rw-r--r--tests/testapplications/elements/content/GridViewElement.qml2
-rw-r--r--tests/testapplications/elements/content/SpriteSequenceElement.qml (renamed from tests/testapplications/elements/content/SpriteImageElement.qml)24
7 files changed, 13 insertions, 250 deletions
diff --git a/tests/auto/quick/qquickspriteimage/data/advance.qml b/tests/auto/quick/qquickspriteimage/data/advance.qml
deleted file mode 100644
index 46a49ca673..0000000000
--- a/tests/auto/quick/qquickspriteimage/data/advance.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- color: "black"
- width: 320
- height: 320
-
- SpriteImage {
- objectName: "sprite"
- sprites: [Sprite {
- name: "firstState"
- source: "squarefacesprite.png"
- frames: 3
- frameSync: true
- to: {"secondState":1}
- }, Sprite {
- name: "secondState"
- source: "squarefacesprite.png"
- frames: 6
- frameSync: true
- } ]
- width: 160
- height: 160
- }
-}
diff --git a/tests/auto/quick/qquickspriteimage/data/basic.qml b/tests/auto/quick/qquickspriteimage/data/basic.qml
deleted file mode 100644
index 2f2b1c96fa..0000000000
--- a/tests/auto/quick/qquickspriteimage/data/basic.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- color: "black"
- width: 320
- height: 320
-
- SpriteImage {
- objectName: "sprite"
- sprites: Sprite {
- name: "happy"
- source: "squarefacesprite.png"
- frames: 6
- frameDuration: 120
- }
- width: 160
- height: 160
- }
-}
diff --git a/tests/auto/quick/qquickspriteimage/data/squarefacesprite.png b/tests/auto/quick/qquickspriteimage/data/squarefacesprite.png
deleted file mode 100644
index f9a5d5fcce..0000000000
--- a/tests/auto/quick/qquickspriteimage/data/squarefacesprite.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/quick/qquickspriteimage/qquickspriteimage.pro b/tests/auto/quick/qquickspriteimage/qquickspriteimage.pro
deleted file mode 100644
index 02d45b97c4..0000000000
--- a/tests/auto/quick/qquickspriteimage/qquickspriteimage.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qquickspriteimage
-SOURCES += tst_qquickspriteimage.cpp
-
-include (../../shared/util.pri)
-
-macx:CONFIG -= app_bundle
-
-TESTDATA = data/*
-
-CONFIG += parallel_test
-
-QT += core-private gui-private qml-private quick-private network testlib
diff --git a/tests/auto/quick/qquickspriteimage/tst_qquickspriteimage.cpp b/tests/auto/quick/qquickspriteimage/tst_qquickspriteimage.cpp
deleted file mode 100644
index 7aff77334d..0000000000
--- a/tests/auto/quick/qquickspriteimage/tst_qquickspriteimage.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QtTest/QtTest>
-#include "../../shared/util.h"
-#include <QtQuick/qquickview.h>
-#include <private/qquickspriteimage_p.h>
-
-class tst_qquickspriteimage : public QQmlDataTest
-{
- Q_OBJECT
-public:
- tst_qquickspriteimage(){}
-
-private slots:
- void test_properties();
- void test_framerateAdvance();//Separate codepath for QQuickSpriteEngine
-};
-
-void tst_qquickspriteimage::test_properties()
-{
- QQuickView *canvas = new QQuickView(0);
-
- canvas->setSource(testFileUrl("basic.qml"));
- canvas->show();
- QTest::qWaitForWindowShown(canvas);
-
- QVERIFY(canvas->rootObject());
- QQuickSpriteImage* sprite = canvas->rootObject()->findChild<QQuickSpriteImage*>("sprite");
- QVERIFY(sprite);
-
- QVERIFY(sprite->running());
- QVERIFY(sprite->interpolate());
-
- sprite->setRunning(false);
- QVERIFY(!sprite->running());
- sprite->setInterpolate(false);
- QVERIFY(!sprite->interpolate());
-
- delete canvas;
-}
-
-void tst_qquickspriteimage::test_framerateAdvance()
-{
- QQuickView *canvas = new QQuickView(0);
-
- canvas->setSource(testFileUrl("advance.qml"));
- canvas->show();
- QTest::qWaitForWindowShown(canvas);
-
- QVERIFY(canvas->rootObject());
- QQuickSpriteImage* sprite = canvas->rootObject()->findChild<QQuickSpriteImage*>("sprite");
- QVERIFY(sprite);
-
- QTRY_COMPARE(sprite->currentSprite(), QLatin1String("secondState"));
- delete canvas;
-}
-
-QTEST_MAIN(tst_qquickspriteimage)
-
-#include "tst_qquickspriteimage.moc"
diff --git a/tests/testapplications/elements/content/GridViewElement.qml b/tests/testapplications/elements/content/GridViewElement.qml
index 0e0eaba312..a276b61efc 100644
--- a/tests/testapplications/elements/content/GridViewElement.qml
+++ b/tests/testapplications/elements/content/GridViewElement.qml
@@ -123,6 +123,6 @@ Rectangle {
ListElement { label: "Shape"; help: "The Shape element allows you to specify an area for affectors and emitter." }
ListElement { label: "TrailEmitter"; help: "The TrailEmitter element allows you to emit logical particles from other logical particles." }
ListElement { label: "Direction"; help: "The Direction elements allow you to specify a vector space." }
- ListElement { label: "SpriteImage"; help: "The SpriteImage element plays stochastic sprite animations." }
+ ListElement { label: "SpriteSequence"; help: "The SpriteSequence element plays stochastic sprite animations." }
}
}
diff --git a/tests/testapplications/elements/content/SpriteImageElement.qml b/tests/testapplications/elements/content/SpriteSequenceElement.qml
index 1270aef62c..8b0a93bb87 100644
--- a/tests/testapplications/elements/content/SpriteImageElement.qml
+++ b/tests/testapplications/elements/content/SpriteSequenceElement.qml
@@ -45,61 +45,61 @@ Item {
id: spriteimageelementtest
anchors.fill: parent
property string testtext: ""
- SpriteImage {
+ SpriteSequence {
id: spriteimage
sprites: [Sprite {
name: "happy"
source: "pics/squarefacesprite2.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"silly": 1, "sad":0}
}, Sprite {
name: "silly"
source: "pics/squarefacesprite.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"happy": 1, "sad": 0}
}, Sprite {
name: "sad"
source: "pics/squarefacesprite3.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"evil": 0.5, "sad": 1, "cyclops" : 0}
}, Sprite {
name: "cyclops"
source: "pics/squarefacesprite4.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"love": 0.1, "boggled": 0.1, "cyclops" : 0.1}
}, Sprite {
name: "evil"
source: "pics/squarefacesprite5.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"sad": 1.0, "cyclops" : 0}
}, Sprite {
name: "love"
source: "pics/squarefacesprite6.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"love": 0.1, "boggled": 0.1, "cyclops" : 0.1}
}, Sprite {
name: "boggled"
source: "pics/squarefacesprite7.png"
frames: 6
- duration: 120
+ frameDuration: 120
to: {"love": 0.1, "boggled": 0.1, "cyclops" : 0.1, "dying":0}
}, Sprite {
name: "dying"
source: "pics/squarefacespriteX.png"
frames: 4
- duration: 120
+ frameDuration: 120
to: {"dead":1.0}
}, Sprite {
name: "dead"
source: "pics/squarefacespriteXX.png"
frames: 1
- duration: 10000
+ frameDuration: 10000
}]
width: 300
@@ -118,7 +118,7 @@ Item {
State { name: "start"; when: statenum == 1
StateChangeScript { script: spriteimage.jumpTo("happy"); }
PropertyChanges { target: spriteimageelementtest
- testtext: "This is a SpriteImage element. It should be animating currently."+
+ testtext: "This is a SpriteSequence element. It should be animating currently."+
"It should alternate between winking and sticking out its tongue." }
},
State { name: "stochastic2"; when: statenum == 2
@@ -136,7 +136,7 @@ Item {
"When it does, it should first animate to and play through the 'big eyes' animation (if it is not currently playing that animation) before it enters the dying animation."}
},
State { name: "dead"; when: statenum == 4
- PropertyChanges { target: spriteimage; goalState: "dead" }
+ PropertyChanges { target: spriteimage; goalSprite: "dead" }
PropertyChanges { target: spriteimageelementtest
testtext: "After a brief dying animation, the image should now be static.\n"+
"Advance to restart the test." }