From af3b3cd20060f7a55d64bd7b7533854267d133f7 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 17 Oct 2011 12:02:22 +1000 Subject: Stabilize Particles Tests A couple of targeted fixes, plus enabling QUnifiedTimer::consistentTiming. Task-number: QTBUG-21867 Change-Id: I62acf524eb2c6491bc88fd687a0065866d7ce8aa Reviewed-by: Martin Jones --- tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp') diff --git a/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp b/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp index d5ae596ce5..2b36d318c5 100644 --- a/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp +++ b/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp @@ -42,6 +42,7 @@ #include #include "../shared/particlestestsshared.h" #include +#include class tst_qsgcustomaffector : public QObject { @@ -55,12 +56,14 @@ private slots: tst_qsgcustomaffector::tst_qsgcustomaffector() { + QUnifiedTimer::instance()->setConsistentTiming(true); } void tst_qsgcustomaffector::test_basic() { QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild("system"); + ensureAnimTime(600, system->m_animation); QCOMPARE(system->groupData[0]->size(), 500); foreach (QSGParticleData *d, system->groupData[0]->data) { @@ -76,7 +79,7 @@ void tst_qsgcustomaffector::test_basic() QCOMPARE(d->lifeSpan, 0.5f); QCOMPARE(d->size, 100.f); QCOMPARE(d->endSize, 100.f); - QVERIFY(d->t <= ((qreal)system->timeInt/1000.0)); + QVERIFY(myFuzzyLEQ(d->t, ((qreal)system->timeInt/1000.0))); } } -- cgit v1.2.3