3030#include " libmscore/measure.h"
3131#include " libmscore/staff.h"
3232#include " libmscore/keysig.h"
33+ #include " libmscore/part.h"
34+ #include " libmscore/barline.h"
3335// end includes required for fixupScore()
3436
3537#include " settings.h"
@@ -262,6 +264,17 @@ static void fixupScore(Score* score)
262264 score->setSaved (false );
263265}
264266
267+ static void checkScore (Score* score)
268+ {
269+ if (score->parts ().first ()->nstaves () > 1 ) {
270+ Measure* measure = score->lastMeasure ();
271+ Segment* segment = measure->findSegment (SegmentType::EndBarLine, measure->endTick ());
272+ BarLine* barline = (BarLine*)(segment->element (0 ));
273+ bool span = barline->spanStaff ();
274+ QVERIFY (barline->spanStaff ());
275+ }
276+ }
277+
265278void TestMxmlIO::setValue (const std::string& key, const Val& value)
266279{
267280 settings ()->setValue (Settings::Key (MODULE_NAME, key), value);
@@ -283,6 +296,7 @@ void TestMxmlIO::mxmlIoTest(const char* file)
283296 MasterScore* score = readScore (XML_IO_DATA_DIR + file + " .xml" );
284297 QVERIFY (score);
285298 fixupScore (score);
299+ checkScore (score);
286300 score->doLayout ();
287301 QVERIFY (saveMusicXml (score, QString (file) + " .xml" ));
288302 QVERIFY (saveCompareMusicXmlScore (score, QString (file) + " .xml" , XML_IO_DATA_DIR + file + " .xml" ));
@@ -304,6 +318,7 @@ void TestMxmlIO::mxmlIoTestRef(const char* file)
304318 MasterScore* score = readScore (XML_IO_DATA_DIR + file + " .xml" );
305319 QVERIFY (score);
306320 fixupScore (score);
321+ checkScore (score);
307322 score->doLayout ();
308323 QVERIFY (saveMusicXml (score, QString (file) + " .xml" ));
309324 QVERIFY (saveCompareMusicXmlScore (score, QString (file) + " .xml" , XML_IO_DATA_DIR + file + " _ref.xml" ));
0 commit comments