Skip to content

Commit

Permalink
more copypaste tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jan 7, 2013
1 parent 77c1f45 commit 8b8b72b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mscore/revision.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
35650ee
77c1f45
21 changes: 14 additions & 7 deletions mtest/libmscore/copypaste/tst_copypaste.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ class TestCopyPaste : public QObject, public MTest
{
Q_OBJECT

void copypaste(const char* p1, const char* p2);
void copypaste(int);

private slots:
void initTestCase();
void copypaste1() { copypaste("copypaste1.mscx", "copypaste1-ref.mscx"); }
void copypaste2() { copypaste("copypaste2.mscx", "copypaste2-ref.mscx"); }
void copypaste3() { copypaste("copypaste3.mscx", "copypaste3-ref.mscx"); }
void copypaste1() { copypaste(1); } // start slur
void copypaste2() { copypaste(2); } // end slur
void copypaste3() { copypaste(3); } // slur
void copypaste4() { copypaste(4); } // start tie
void copypaste5() { copypaste(5); } // end tie
void copypaste6() { copypaste(6); } // tie
void copypaste7() { copypaste(7); } // start ottava
void copypaste8() { copypaste(8); } // end ottava
void copypaste9() { copypaste(9); } // ottava
};

//---------------------------------------------------------
Expand All @@ -50,9 +56,9 @@ void TestCopyPaste::initTestCase()
// copypaste
//---------------------------------------------------------

void TestCopyPaste::copypaste(const char* p1, const char* p2)
void TestCopyPaste::copypaste(int idx)
{
Score* score = readScore(DIR + p1);
Score* score = readScore(DIR + QString("copypaste%1.mscx").arg(idx));
score->doLayout();
Measure* m1 = score->firstMeasure();
Measure* m2 = m1->nextMeasure(); // src
Expand All @@ -76,7 +82,8 @@ void TestCopyPaste::copypaste(const char* p1, const char* p2)
score->cmdPaste(0);
score->doLayout();

QVERIFY(saveCompareScore(score, p1, DIR + p2));
QVERIFY(saveCompareScore(score, QString("copypaste%1.mscx").arg(idx),
DIR + QString("copypaste%1-ref.mscx").arg(idx)));
delete score;
}

Expand Down
5 changes: 3 additions & 2 deletions mtest/libmscore/copypaste/updateReference
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

for a in copypaste1 copypaste2 copypaste3; do
cp ../../../build.debug/mtest/libmscore/copypaste/$a.mscx $a-ref.mscx
for a in 1 2 3 4 5 6 7 8 9; do
echo cp ../../../build.debug/mtest/libmscore/copypaste/copypaste${a}.mscx copypaste${a}-ref.mscx
cp ../../../build.debug/mtest/libmscore/copypaste/copypaste${a}.mscx copypaste${a}-ref.mscx
done


0 comments on commit 8b8b72b

Please sign in to comment.