QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
- if (d->t == -1) //Recycler out-smarted me and never needed to init this datum
- continue;
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 1000.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *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);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
if (d->t == -1)
- continue; //Recycling process means not all initialized/used
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 500.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
if (d->t == -1)
- continue; //Recycling process means not all initialized/used
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 500.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QVERIFY(qFuzzyCompare(d->vx, 353.55339f));
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(myFuzzyCompare(d->x, 0.0f));
QVERIFY(myFuzzyCompare(d->y, 0.0f));
QVERIFY(myFuzzyCompare(d->vx, 0.0f));
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
- if (d->t == -1) //Recycler out-smarted me and never needed to init this datum
- continue;
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 100.f);
QCOMPARE(d->y, 100.f);
QCOMPARE(d->vx, 100.f);
bool oneNonZero = false;
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 0.f);
//Filled
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(inCircle(d->x, d->y, 160, false));
QCOMPARE(d->vx, 0.f);
QCOMPARE(d->vy, 0.f);
//Just border
QCOMPARE(system->groupData[1]->size(), 500);
foreach (QSGParticleData *d, system->groupData[1]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(inCircle(d->x, d->y, 160, true));
QCOMPARE(d->vx, 0.f);
QCOMPARE(d->vy, 0.f);
//Default is just slowed a little
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(d->vx < 100.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vy, 0.f);
//Nondefault comes to a complete stop within the first half of its life
QCOMPARE(system->groupData[1]->size(), 500);
foreach (QSGParticleData *d, system->groupData[1]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
if (d->t > ((qreal)system->timeInt/1000.0) - 0.25)
continue;
QVERIFY(myFuzzyCompare(d->vx, 0.f));
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->ax, 707.10678f);
QCOMPARE(d->ay, 707.10678f);
QCOMPARE(d->lifeSpan, 0.5f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 0.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 0.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, d->y);
QCOMPARE(d->vx, 0.f);
QCOMPARE(d->vy, 0.f);
QCOMPARE(system->groupData[1]->size(), 500);
foreach (QSGParticleData *d, system->groupData[1]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x + d->y, 320.0f);
QCOMPARE(d->vx, 0.f);
QCOMPARE(d->vy, 0.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(d->x >= 100.0f && d->x <= 200.0f);
QVERIFY(d->y >= 100.0f && d->y <= 200.0f);
QCOMPARE(d->vx, 0.f);
//A frame or two worth of particles will be missed, the transition doesn't take effect on the frame it's spawned (QTBUG-21781)
QVERIFY(system->groupData[0]->size() <= 500 && system->groupData[0]->size() >= 450);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 0.f);
QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system");
QCOMPARE(system->groupData[0]->size(), 500);
+ int stillAlive = 0;
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
+ if (d->stillAlive())
+ stillAlive++;
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 0.f);
QCOMPARE(d->endSize, 32.f);
QVERIFY(d->t <= ((qreal)system->timeInt/1000.0));
}
+ QVERIFY(extremelyFuzzyCompare(stillAlive, 500, 5));//Small simulation variance is permissible.
}
QTEST_MAIN(tst_qsgparticlesystem);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(d->x != 0.f);
QVERIFY(d->y != 0.f);
QVERIFY(d->x == d->y);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 100.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(d->x >= 0.f);
QVERIFY(d->x <= 100.f);
QVERIFY(d->y >= 0.f);
QCOMPARE(system->groupData[1]->size(), 500);
foreach (QSGParticleData *d, system->groupData[1]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
if (!myFuzzyCompare(d->x, 0.f) && !myFuzzyCompare(d->x, 100.f)){
QVERIFY(d->x >= 0.f);
QVERIFY(d->x <= 100.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 0.f);
QCOMPARE(d->y, 0.f);
QCOMPARE(d->vx, 160.f);
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 4.f);
QCOMPARE(d->y, 4.f);
QCOMPARE(d->vx, 0.f);
QCOMPARE(system->groupData[1]->size(), 500);
foreach (QSGParticleData *d, system->groupData[1]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->x, 4.f);
QCOMPARE(d->y, 4.f);
QCOMPARE(d->vx, 500.f);
//of the Turbulence item remain the same
QCOMPARE(system->groupData[0]->size(), 500);
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QVERIFY(d->vx != 0.f);
QVERIFY(d->vy != 0.f);
QCOMPARE(d->lifeSpan, 0.5f);
bool vxChanged = false;
bool vyChanged = false;
foreach (QSGParticleData *d, system->groupData[0]->data) {
+ if (d->t == -1)
+ continue; //Particle data unused
+
QCOMPARE(d->ax, 0.f);
QCOMPARE(d->ay, 0.f);
QCOMPARE(d->lifeSpan, 0.5f);