Rename speed -> velocity in the particle system
[profile/ivi/qtdeclarative.git] / tests / auto / particles / qquickfriction / tst_qquickfriction.cpp
index 7cdfac5..2beccd7 100644 (file)
@@ -1,7 +1,6 @@
 /****************************************************************************
 **
 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
 ** Contact: http://www.qt-project.org/
 **
 ** This file is part of the test suite of the Qt Toolkit.
@@ -35,6 +34,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
 #include <private/qquickparticlesystem_p.h>
 #include <private/qabstractanimation_p.h>
 
-class tst_qquickfriction : public QObject
+#include "../../shared/util.h"
+
+class tst_qquickfriction : public QQmlDataTest
 {
     Q_OBJECT
 public:
-    tst_qquickfriction();
+    tst_qquickfriction() {}
 
 private slots:
+    void initTestCase();
     void test_basic();
     void test_threshold();
 };
 
-tst_qquickfriction::tst_qquickfriction()
+void tst_qquickfriction::initTestCase()
 {
+    QQmlDataTest::initTestCase();
     QUnifiedTimer::instance()->setConsistentTiming(true);
 }
 
 void tst_qquickfriction::test_basic()
 {
-    QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600);
+    QQuickView* view = createView(testFileUrl("basic.qml"), 600);
     QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
     ensureAnimTime(600, system->m_animation);
 
@@ -106,11 +110,11 @@ void tst_qquickfriction::test_basic()
 
 void tst_qquickfriction::test_threshold()
 {
-    QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/threshold.qml", 600);
+    QQuickView* view = createView(testFileUrl("threshold.qml"), 600);
     QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
     ensureAnimTime(600, system->m_animation);
 
-    //Speed capped at 50, but it might take a frame or two to get there
+    //Velocity capped at 50, but it might take a frame or two to get there
     QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 500, 10));
     foreach (QQuickParticleData *d, system->groupData[0]->data) {
         if (d->t == -1.0f)