示例#1
0
void TestMeasure::insertBfKeyChange()
      {
      MasterScore* score = readScore(DIR + "measure-insert_bf_key.mscx");
      // 4th measure
      Measure* m = score->firstMeasure()->nextMeasure();
      m = m->nextMeasure()->nextMeasure();
      score->startCmd();
      score->insertMeasure(ElementType::MEASURE, m);
      score->endCmd();
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key.mscx", DIR + "measure-insert_bf_key-ref.mscx"));
      score->undoRedo(true);
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key_undo.mscx", DIR + "measure-insert_bf_key.mscx"));
      m = score->firstMeasure()->nextMeasure()->nextMeasure()->nextMeasure()->nextMeasure()->nextMeasure();
      score->startCmd();
      score->insertMeasure(ElementType::MEASURE, m);
      score->endCmd();
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key-2.mscx", DIR + "measure-insert_bf_key-2-ref.mscx"));
      score->undoRedo(true);
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key_undo.mscx", DIR + "measure-insert_bf_key.mscx"));
      delete score;
      }
示例#2
0
void TestMeasure::undoDelInitialVBox_269919()
      {
      MasterScore* score = readScore(DIR + "undoDelInitialVBox_269919.mscx");

      // 1. delete initial VBox
      score->startCmd();
      MeasureBase* initialVBox = score->measure(0);
      score->select(initialVBox);
      score->cmdDeleteSelection();
      score->endCmd();

      // 2. change duration of first chordrest
      score->startCmd();
      Measure* m = score->firstMeasure();
      ChordRest* cr = m->findChordRest(Fraction(0,1), 0);
      Fraction quarter(4, 1);
      score->changeCRlen(cr, quarter);
      score->endCmd();

      // 3. Undo to restore first chordrest
      score->undoRedo(true, 0);

      // 4. Undo to restore initial VBox resulted in assert failure crash
      score->undoRedo(true, 0);

      QVERIFY(saveCompareScore(score, "undoDelInitialVBox_269919.mscx", DIR + "undoDelInitialVBox_269919-ref.mscx"));
      delete score;
      }