diff options
Diffstat (limited to 'tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp')
-rw-r--r-- | tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp b/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp index 2d43f7b585..0f25f50089 100644 --- a/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp +++ b/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp @@ -42,6 +42,7 @@ #include <QtTest/QtTest> #include "../shared/particlestestsshared.h" #include <private/qsgparticlesystem_p.h> +#include <private/qabstractanimation_p.h> class tst_qsglineextruder : public QObject { @@ -55,12 +56,14 @@ private slots: tst_qsglineextruder::tst_qsglineextruder() { + QUnifiedTimer::instance()->setConsistentTiming(true); } void tst_qsglineextruder::test_basic() { QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); + ensureAnimTime(600, system->m_animation); QCOMPARE(system->groupData[0]->size(), 500); foreach (QSGParticleData *d, system->groupData[0]->data) { @@ -75,7 +78,7 @@ void tst_qsglineextruder::test_basic() QCOMPARE(d->lifeSpan, 0.5f); QCOMPARE(d->size, 32.f); QCOMPARE(d->endSize, 32.f); - QVERIFY(d->t <= ((qreal)system->timeInt/1000.0)); + QVERIFY(myFuzzyLEQ(d->t, ((qreal)system->timeInt/1000.0))); } QCOMPARE(system->groupData[1]->size(), 500); @@ -91,7 +94,7 @@ void tst_qsglineextruder::test_basic() QCOMPARE(d->lifeSpan, 0.5f); QCOMPARE(d->size, 32.f); QCOMPARE(d->endSize, 32.f); - QVERIFY(d->t <= ((qreal)system->timeInt/1000.0)); + QVERIFY(myFuzzyLEQ(d->t, ((qreal)system->timeInt/1000.0))); } } |