diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-10-31 11:47:13 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-31 04:29:03 +0100 |
commit | f32e5f51dd00a0ff6d5864e150d5daa894fe8404 (patch) | |
tree | af1df471ecd4363e35302572340e19439c40b037 /tests/auto/particles/qquickage | |
parent | f0e6418fc1c237c1c1d71834c26a396f0b8ab28e (diff) |
Stabilize Particles tests some more
Odd timings can lead to slight variances in the particle groups size,
this is allowable in autotests. Also fixes incorrect use of
extremelyFuzzyCompare in tst_qquickage.
Change-Id: Ibea3a2b2a3a31ab1fe6d908c1676d865db9ba968
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/particles/qquickage')
-rw-r--r-- | tests/auto/particles/qquickage/tst_qquickage.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/particles/qquickage/tst_qquickage.cpp b/tests/auto/particles/qquickage/tst_qquickage.cpp index 73db409de3..74cd29729d 100644 --- a/tests/auto/particles/qquickage/tst_qquickage.cpp +++ b/tests/auto/particles/qquickage/tst_qquickage.cpp @@ -68,7 +68,7 @@ void tst_qquickage::test_kill() QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); - QCOMPARE(system->groupData[0]->size(), 500); + QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 500, 10)); foreach (QQuickParticleData *d, system->groupData[0]->data) { if (d->t == -1) continue; //Particle data unused @@ -92,14 +92,14 @@ void tst_qquickage::test_jump() QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); - QCOMPARE(system->groupData[0]->size(), 500); + QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 500, 10)); foreach (QQuickParticleData *d, system->groupData[0]->data) { if (d->t == -1) continue; //Particle data unused - //Allow for a small variance because jump is trying to simulate off wall time - extremelyFuzzyCompare(d->x, -100.f, 5.0f); - extremelyFuzzyCompare(d->y, -100.f, 5.0f); + //Allow for variance because jump is trying to simulate off wall time and things have emitted 'continuously' before first affect + QVERIFY(d->x <= -50.f); + QVERIFY(d->y <= -50.f); QCOMPARE(d->vx, 500.f); QCOMPARE(d->vy, 500.f); QCOMPARE(d->ax, 0.f); @@ -117,7 +117,7 @@ void tst_qquickage::test_onceOff() QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); - QCOMPARE(system->groupData[0]->size(), 500); + QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 500, 10)); foreach (QQuickParticleData *d, system->groupData[0]->data) { if (d->t == -1) continue; //Particle data unused @@ -142,7 +142,7 @@ void tst_qquickage::test_sustained() ensureAnimTime(600, system->m_animation); //TODO: Ensure some particles have lived to 0.4s point despite unified timer - QCOMPARE(system->groupData[0]->size(), 500); + QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 500, 10)); foreach (QQuickParticleData *d, system->groupData[0]->data) { if (d->t == -1) continue; //Particle data unused |