diff options
Diffstat (limited to 'tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp')
-rw-r--r-- | tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp b/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp index 155b109ff9..4230bc529f 100644 --- a/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp +++ b/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp @@ -42,6 +42,7 @@ #include <QtTest/QtTest> #include "../shared/particlestestsshared.h" #include <private/qsgparticlesystem_p.h> +#include <private/qabstractanimation_p.h> class tst_qsgturbulence : public QObject { @@ -55,12 +56,14 @@ private slots: tst_qsgturbulence::tst_qsgturbulence() { + QUnifiedTimer::instance()->setConsistentTiming(true); } void tst_qsgturbulence::test_basic() { QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); + ensureAnimTime(600, system->m_animation); //Note that the noise image built-in provides the 'randomness', so this test should be stable so long as it and the size //of the Turbulence item remain the same @@ -74,7 +77,7 @@ void tst_qsgturbulence::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))); } } |