diff --git a/mtest/libmscore/beam/tst_beam.cpp b/mtest/libmscore/beam/tst_beam.cpp index e9eb1547c1..0c941ac0a7 100644 --- a/mtest/libmscore/beam/tst_beam.cpp +++ b/mtest/libmscore/beam/tst_beam.cpp @@ -58,6 +58,7 @@ void TestBeam::initTestCase() void TestBeam::beam(const char* path) { Score* score = readScore(DIR + path); + score->doLayout(); QVERIFY(score); QVERIFY(saveCompareScore(score, path, DIR + path)); delete score; diff --git a/mtest/libmscore/compat/tst_compat.cpp b/mtest/libmscore/compat/tst_compat.cpp index 31a4cd0cc3..e32384ef46 100644 --- a/mtest/libmscore/compat/tst_compat.cpp +++ b/mtest/libmscore/compat/tst_compat.cpp @@ -13,6 +13,7 @@ #include #include "mtest/testutils.h" +#include "libmscore/score.h" #define DIR QString("libmscore/compat/") @@ -70,6 +71,7 @@ void TestCompat::compat() QString reference(DIR + file + "-ref.mscx"); Score* score = readScore(readFile); + score->doLayout(); QVERIFY(score); QVERIFY(saveCompareScore(score, writeFile, reference)); } diff --git a/mtest/libmscore/join/tst_join.cpp b/mtest/libmscore/join/tst_join.cpp index e9e3eb7c09..e867702b5b 100644 --- a/mtest/libmscore/join/tst_join.cpp +++ b/mtest/libmscore/join/tst_join.cpp @@ -58,7 +58,7 @@ void TestJoin::initTestCase() void TestJoin::join(const char* p1, const char* p2) { Score* score = readScore(DIR + p1); - QVERIFY(score); + score->doLayout(); Measure* m1 = score->firstMeasure(); Measure* m2 = m1->nextMeasure(); @@ -75,7 +75,7 @@ void TestJoin::join(const char* p1, const char* p2) void TestJoin::join(const char* p1, const char* p2, int index) { Score* score = readScore(DIR + p1); - QVERIFY(score); + score->doLayout(); Measure* m1 = score->firstMeasure(); for (int i = 0; i < index; ++i) m1 = m1->nextMeasure(); diff --git a/mtest/libmscore/layout/tst_benchmark.cpp b/mtest/libmscore/layout/tst_benchmark.cpp index 379098f16e..252a8698ff 100644 --- a/mtest/libmscore/layout/tst_benchmark.cpp +++ b/mtest/libmscore/layout/tst_benchmark.cpp @@ -25,11 +25,13 @@ class TestBenchmark : public QObject, public MTest { Q_OBJECT + Score* score; void beam(const char* path); private slots: void initTestCase(); - void benchmark(); + void benchmark1(); + void benchmark2(); }; //--------------------------------------------------------- @@ -45,10 +47,18 @@ void TestBenchmark::initTestCase() // benchmark //--------------------------------------------------------- -void TestBenchmark::benchmark() +void TestBenchmark::benchmark1() { - Score* score = readScore(DIR + "goldberg.mscx"); - QBENCHMARK { + score = readScore(DIR + "goldberg.mscx"); + QBENCHMARK { // cold run + score->doLayout(); + } + } + +void TestBenchmark::benchmark2() + { + score->doLayout(); + QBENCHMARK { // warm run score->doLayout(); } } diff --git a/mtest/libmscore/link/tst_parts.cpp b/mtest/libmscore/link/tst_parts.cpp index a59fb4b6d3..88e7c506f3 100644 --- a/mtest/libmscore/link/tst_parts.cpp +++ b/mtest/libmscore/link/tst_parts.cpp @@ -138,6 +138,7 @@ void TestParts::createParts(Score* score) void TestParts::testPartCreation(const QString& test) { Score* score = readScore(DIR + test + ".mscx"); + score->doLayout(); QVERIFY(score); QVERIFY(saveCompareScore(score, test + "-1.mscx", DIR + test + ".mscx")); createParts(score); @@ -152,6 +153,8 @@ void TestParts::testPartCreation(const QString& test) void TestParts::appendMeasure() { Score* score = readScore(DIR + "part2.mscx"); + score->doLayout(); + QVERIFY(score); createParts(score); @@ -175,6 +178,7 @@ void TestParts::appendMeasure() void TestParts::insertMeasure() { Score* score = readScore(DIR + "part2.mscx"); + score->doLayout(); QVERIFY(score); createParts(score); diff --git a/mtest/omr/notes/tst_notes.cpp b/mtest/omr/notes/tst_notes.cpp index 1c5769663b..698d7a62b9 100644 --- a/mtest/omr/notes/tst_notes.cpp +++ b/mtest/omr/notes/tst_notes.cpp @@ -52,9 +52,11 @@ void TestNotes::initTestCase() void TestNotes::omrFileTest(QString file) { Score* score = readScore(DIR + file + ".mscx"); + score->doLayout(); QVERIFY(score); savePdf(score, file + ".pdf"); Score* score1 = readCreatedScore(file + ".pdf"); + score1->doLayout(); QVERIFY(score1); QVERIFY(saveCompareScore(score1, file + ".mscx", DIR + file + "-ref.mscx")); } diff --git a/mtest/testutils.cpp b/mtest/testutils.cpp index 42468bef2d..b32a66634e 100644 --- a/mtest/testutils.cpp +++ b/mtest/testutils.cpp @@ -121,7 +121,6 @@ Score* MTest::readCreatedScore(const QString& name) delete score; return 0; } - score->doLayout(); return score; }