Ejemplo n.º 1
0
void TestTools::undoLockLineBreaks()
{
    QString readFile(DIR + "undoLockLineBreaks.mscx");
    QString writeFile1("undoLockLineBreaks01-test.mscx");
    QString reference1(DIR  + "undoLockLineBreaks01-ref.mscx");
    QString writeFile2("undoLockLineBreaks02-test.mscx");
    QString reference2(DIR  + "undoLockLineBreaks02-ref.mscx");

    MasterScore* score = readScore(readFile);
    score->doLayout();

    // select all
    score->startCmd();
    score->cmdSelectAll();
    score->endCmd();

    // do
    score->startCmd();
    score->addRemoveBreaks(0, true);
    score->endCmd();
    QVERIFY(saveCompareScore(score, writeFile1, reference1));

    // undo
    score->undoStack()->undo();
    QVERIFY(saveCompareScore(score, writeFile2, reference2));

    delete score;
}
Ejemplo n.º 2
0
void TestImplodeExplode::implode1()
      {
      QString readFile(DIR + "implode1.mscx");
      QString writeFile1("implode1-test1.mscx");
      QString writeFile2("implode1-test2.mscx");
      QString reference(DIR + "implode1-ref.mscx");

      MasterScore* score = readScore(readFile);
      score->doLayout();

      // select all
      score->startCmd();
      score->cmdSelectAll();
      score->endCmd();

      // do
      score->startCmd();
      score->cmdImplode();
      score->endCmd();
      QVERIFY(saveCompareScore(score, writeFile1, reference));

      // undo
      score->undoStack()->undo();
      QVERIFY(saveCompareScore(score, writeFile2, readFile));

      delete score;
      }
Ejemplo n.º 3
0
void TestTools::undoSlashRhythm()
      {
      QString readFile(DIR + "undoSlashRhythm.mscx");
      QString writeFile1("undoSlashRhythm01-test.mscx");
      QString reference1(DIR  + "undoSlashRhythm01-ref.mscx");
      QString writeFile2("undoSlashRhythm02-test.mscx");
      QString reference2(DIR  + "undoSlashRhythm02-ref.mscx");

      MasterScore* score = readScore(readFile);
      score->doLayout();

      // select all
      score->startCmd();
      score->cmdSelectAll();
      score->endCmd();

      // do
      score->startCmd();
      score->cmdSlashRhythm();
      score->endCmd();
      QVERIFY(saveCompareScore(score, writeFile1, reference1));

      // undo
      score->undoStack()->undo(&ed);
      QVERIFY(saveCompareScore(score, writeFile2, reference2));

      delete score;
      }
Ejemplo n.º 4
0
void TestChordSymbol::testTransposePart()
      {
      MasterScore* score = test_pre("transpose-part");
      score->startCmd();
      score->cmdSelectAll();
      score->transpose(TransposeMode::BY_INTERVAL, TransposeDirection::UP, Key::C, 4, false, true, true);
      score->endCmd();
      test_post(score, "transpose-part");
      }
Ejemplo n.º 5
0
void TestBarline::deleteSkipBarlines()
      {
      MasterScore* score = readScore(DIR + "barlinedelete.mscx");

      Measure* m1 = score->firstMeasure();
      QVERIFY(m1);

      score->startCmd();
      score->cmdSelectAll();
      score->cmdDeleteSelection();
      score->endCmd();

      score->doLayout();

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