void Ut_PagedPanning::performIntegration(PagedPanning* pagedPanning) { Ut_MPhysics2DPanning physicsDriver(pagedPanning); QSignalSpy stopSpy(pagedPanning, SIGNAL(panningStopped())); int i = 0; do { physicsDriver.advancePhysicsCalculation(); i++; } while (stopSpy.count() == 0 && i < 100000); }
void CueStack_Test::postRun() { QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Futurelight", "DJScan250"); QVERIFY(def != NULL); QLCFixtureMode* mode = def->modes().first(); QVERIFY(mode != NULL); Fixture* fxi = new Fixture(m_doc); fxi->setFixtureDefinition(def, mode); fxi->setName("Test Scanner"); fxi->setAddress(10); fxi->setUniverse(0); m_doc->addFixture(fxi); MasterTimer mt(m_doc); QList<Universe*> ua; ua.append(new Universe(0, new GrandMaster())); CueStack cs(m_doc); cs.setFadeInSpeed(100); cs.setFadeOutSpeed(200); cs.setDuration(300); Cue cue; cue.setName("One"); cue.setValue(0, 255); cue.setValue(1, 255); cue.setValue(500, 255); cue.setValue(10, 255); // LTP cue.setValue(11, 255); // LTP cs.appendCue(cue); cue = Cue(); cue.setName("Two"); cue.setValue(500, 255); cue.setValue(3, 255); cue.setValue(4, 255); cue.setValue(11, 255); // LTP cs.appendCue(cue); cs.preRun(); // Switch to cue one cs.switchCue(-1, 0, ua); QCOMPARE(cs.m_fader->channels().size(), 5); QSignalSpy cueSpy(&cs, SIGNAL(currentCueChanged(int))); QSignalSpy stopSpy(&cs, SIGNAL(stopped())); cs.postRun(&mt); QCOMPARE(cs.m_fader, (GenericFader*) NULL); QCOMPARE(cs.m_currentIndex, -1); QCOMPARE(cueSpy.size(), 1); QCOMPARE(cueSpy.at(0).size(), 1); QCOMPARE(cueSpy.at(0).at(0).toInt(), -1); QCOMPARE(stopSpy.size(), 1); // Only HTP channels go to MasterTimer's GenericFader QCOMPARE(mt.m_fader->channels().size(), 3); FadeChannel fc; fc.setChannel(0); QCOMPARE(mt.m_fader->channels().contains(fc), true); fc.setChannel(1); QCOMPARE(mt.m_fader->channels().contains(fc), true); fc.setChannel(500); QCOMPARE(mt.m_fader->channels().contains(fc), true); }