aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qdeclarativesmoothedanimation
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-12-21 09:06:26 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-21 15:35:22 +0100
commit8249c72213bc7d212c05aa086b3145a5742706a3 (patch)
tree4a34b97b0d57a05707c65b7328d5ab1bf4254920 /tests/auto/qtquick2/qdeclarativesmoothedanimation
parent3c211558f6b571555558bd1fc59774e36a6da710 (diff)
QDeclarative tests: Introduce base class for data tests.
In tests/auto/shared/util.* replace macros/find functions by a base class QDeclarativeDataTest with accessors for the data directory helper functions to create URLs from it. The class relies on QFINDTESTDATA, which is the standard way of locating test data. Using the class should reduce the number of calls to QFileInfo.exists(), etc significantly. In addition, provide utility functions for messages. Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Change-Id: Id2beacb157922ee9412f9e45cf9695cec1f8379a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qdeclarativesmoothedanimation')
-rw-r--r--tests/auto/qtquick2/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro4
-rw-r--r--tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp12
2 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/qtquick2/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/qtquick2/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
index 1e8a7d5ba6..044a7968f3 100644
--- a/tests/auto/qtquick2/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
+++ b/tests/auto/qtquick2/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
@@ -2,7 +2,9 @@ CONFIG += testcase
TARGET = tst_qdeclarativesmoothedanimation
macx:CONFIG -= app_bundle
-SOURCES += tst_qdeclarativesmoothedanimation.cpp
+SOURCES += tst_qdeclarativesmoothedanimation.cpp \
+ ../../shared/util.cpp
+HEADERS += ../../shared/util.h
testDataFiles.files = data
testDataFiles.path = .
diff --git a/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
index 632bcda091..2736377218 100644
--- a/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
+++ b/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
@@ -46,7 +46,7 @@
#include <private/qdeclarativevaluetype_p.h>
#include "../../shared/util.h"
-class tst_qdeclarativesmoothedanimation : public QObject
+class tst_qdeclarativesmoothedanimation : public QDeclarativeDataTest
{
Q_OBJECT
public:
@@ -71,7 +71,7 @@ tst_qdeclarativesmoothedanimation::tst_qdeclarativesmoothedanimation()
void tst_qdeclarativesmoothedanimation::defaultValues()
{
QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimation1.qml")));
+ QDeclarativeComponent c(&engine, testFileUrl("smoothedanimation1.qml"));
QDeclarativeSmoothedAnimation *obj = qobject_cast<QDeclarativeSmoothedAnimation*>(c.create());
QVERIFY(obj != 0);
@@ -88,7 +88,7 @@ void tst_qdeclarativesmoothedanimation::defaultValues()
void tst_qdeclarativesmoothedanimation::values()
{
QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimation2.qml")));
+ QDeclarativeComponent c(&engine, testFileUrl("smoothedanimation2.qml"));
QDeclarativeSmoothedAnimation *obj = qobject_cast<QDeclarativeSmoothedAnimation*>(c.create());
QVERIFY(obj != 0);
@@ -105,7 +105,7 @@ void tst_qdeclarativesmoothedanimation::values()
void tst_qdeclarativesmoothedanimation::disabled()
{
QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimation3.qml")));
+ QDeclarativeComponent c(&engine, testFileUrl("smoothedanimation3.qml"));
QDeclarativeSmoothedAnimation *obj = qobject_cast<QDeclarativeSmoothedAnimation*>(c.create());
QVERIFY(obj != 0);
@@ -148,7 +148,7 @@ void tst_qdeclarativesmoothedanimation::valueSource()
{
QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimationValueSource.qml")));
+ QDeclarativeComponent c(&engine, testFileUrl("smoothedanimationValueSource.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
QVERIFY(rect);
@@ -180,7 +180,7 @@ void tst_qdeclarativesmoothedanimation::behavior()
{
QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimationBehavior.qml")));
+ QDeclarativeComponent c(&engine, testFileUrl("smoothedanimationBehavior.qml"));
QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
QVERIFY(rect);