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>
This commit is contained in:
parent
f0e6418fc1
commit
f32e5f51dd
|
@ -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
|
||||
|
|
|
@ -66,7 +66,7 @@ void tst_qquickangleddirection::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickcumulativedirection::test_basic()
|
|||
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
|
||||
|
|
|
@ -66,7 +66,7 @@ void tst_qquickcustomaffector::test_basic()
|
|||
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
|
||||
|
@ -90,7 +90,7 @@ void tst_qquickcustomaffector::test_move()
|
|||
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
|
||||
|
|
|
@ -67,7 +67,7 @@ void tst_qquickcustomparticle::test_basic()
|
|||
ensureAnimTime(600, system->m_animation);
|
||||
|
||||
bool oneNonZero = false;
|
||||
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
|
||||
|
|
|
@ -82,7 +82,7 @@ void tst_qquickellipseextruder::test_basic()
|
|||
ensureAnimTime(600, system->m_animation);
|
||||
|
||||
//Filled
|
||||
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
|
||||
|
|
|
@ -67,7 +67,7 @@ void tst_qquickfriction::test_basic()
|
|||
ensureAnimTime(600, system->m_animation);
|
||||
|
||||
//Default is just slowed a little
|
||||
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
|
||||
|
@ -110,7 +110,7 @@ void tst_qquickfriction::test_threshold()
|
|||
ensureAnimTime(600, system->m_animation);
|
||||
|
||||
//Speed capped at 50, but it might take a frame or two to get there
|
||||
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.0f)
|
||||
continue; //Particle data unused
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickgravity::test_basic()
|
|||
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
|
||||
|
|
|
@ -71,7 +71,7 @@ void tst_qquickimageparticle::test_basic()
|
|||
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
|
||||
|
@ -114,7 +114,7 @@ void tst_qquickimageparticle::test_colored()
|
|||
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
|
||||
|
@ -157,7 +157,7 @@ void tst_qquickimageparticle::test_deformed()
|
|||
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
|
||||
|
@ -200,7 +200,7 @@ void tst_qquickimageparticle::test_tabled()
|
|||
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
|
||||
|
@ -244,7 +244,7 @@ void tst_qquickimageparticle::test_sprite()
|
|||
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
|
||||
|
|
|
@ -66,7 +66,7 @@ void tst_qquickitemparticle::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquicklineextruder::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickmaskextruder::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickparticlesystem::test_basic()
|
|||
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));
|
||||
int stillAlive = 0;
|
||||
foreach (QQuickParticleData *d, system->groupData[0]->data) {
|
||||
if (d->t == -1)
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickpointattractor::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickpointdirection::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickrectangleextruder::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquicktargetdirection::test_basic()
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquicktrailemitter::test_basic()
|
|||
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
|
||||
|
|
|
@ -67,7 +67,7 @@ void tst_qquickturbulence::test_basic()
|
|||
|
||||
//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
|
||||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ void tst_qquickwander::test_basic()
|
|||
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));
|
||||
//Since Wander is random perturbations, the compromise between stability and actual testing is to hope that one of
|
||||
//the 500 was randomly changed from 0.0 in velocity
|
||||
bool vxChanged = false;
|
||||
|
|
Loading…
Reference in New Issue