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"
@@ -263,6 +265,17 @@ static void fixupScore(Score* score)
263265 score->setSaved (false );
264266}
265267
268+ static void checkScore (Score* score)
269+ {
270+ if (score->parts ().first ()->nstaves () > 1 ) {
271+ Measure* measure = score->lastMeasure ();
272+ Segment* segment = measure->findSegment (SegmentType::EndBarLine, measure->endTick ());
273+ BarLine* barline = (BarLine*)(segment->element (0 ));
274+ bool span = barline->spanStaff ();
275+ QVERIFY (barline->spanStaff ());
276+ }
277+ }
278+
266279void TestMxmlIO::setValue (const std::string& key, const Val& value)
267280{
268281 settings ()->setValue (Settings::Key (MODULE_NAME, key), value);
@@ -284,6 +297,7 @@ void TestMxmlIO::mxmlIoTest(const char* file)
284297 MasterScore* score = readScore (XML_IO_DATA_DIR + file + " .xml" );
285298 QVERIFY (score);
286299 fixupScore (score);
300+ checkScore (score);
287301 score->doLayout ();
288302 QVERIFY (saveMusicXml (score, QString (file) + " .xml" ));
289303 QVERIFY (saveCompareMusicXmlScore (score, QString (file) + " .xml" , XML_IO_DATA_DIR + file + " .xml" ));
@@ -305,6 +319,7 @@ void TestMxmlIO::mxmlIoTestRef(const char* file)
305319 MasterScore* score = readScore (XML_IO_DATA_DIR + file + " .xml" );
306320 QVERIFY (score);
307321 fixupScore (score);
322+ checkScore (score);
308323 score->doLayout ();
309324 QVERIFY (saveMusicXml (score, QString (file) + " .xml" ));
310325 QVERIFY (saveCompareMusicXmlScore (score, QString (file) + " .xml" , XML_IO_DATA_DIR + file + " _ref.xml" ));
0 commit comments