Skip to content

Commit

Permalink
Add/update tests for MMRests and MeasureRepeats
Browse files Browse the repository at this point in the history
MMRests:
- Add vtests for old-style (all fonts), h-bar thickness and margin (Bravura)

MeasureRepeats:
- Add script tests for adding, cutting/copying with partial group selected, pasting into group, repeating selection from before group, executing split/join/insert/delete measure commands, adding repeat barlines, and adding time signature
- Add mtests for parts, MIDI, and MusicXML import/export
- Add vtests
- Update ref files
  • Loading branch information
IsaacWeiss committed Aug 28, 2020
1 parent 5745274 commit 357a177
Show file tree
Hide file tree
Showing 65 changed files with 26,010 additions and 797 deletions.
21 changes: 15 additions & 6 deletions mtest/guitarpro/repeated-bars.gp-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,15 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<linkedMain/>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
</voice>
</Measure>
</Staff>
Expand Down Expand Up @@ -296,13 +299,16 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<linked>
</linked>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
</voice>
</Measure>
</Staff>
Expand Down Expand Up @@ -372,13 +378,16 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<linked>
</linked>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
</voice>
</Measure>
</Staff>
Expand Down
21 changes: 15 additions & 6 deletions mtest/guitarpro/repeated-bars.gpx-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<linkedMain/>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
</voice>
</Measure>
</Staff>
Expand Down Expand Up @@ -394,13 +397,16 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<linked>
</linked>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
</voice>
</Measure>
</Staff>
Expand Down Expand Up @@ -470,13 +476,16 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<linked>
</linked>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
</voice>
</Measure>
</Staff>
Expand Down
5 changes: 5 additions & 0 deletions mtest/libmscore/all_elements/tst_layout_elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "mtest/testutils.h"
#include "libmscore/measure.h"
#include "libmscore/page.h"
#include "libmscore/rest.h"
#include "libmscore/score.h"
#include "libmscore/staff.h"
#include "libmscore/system.h"
Expand Down Expand Up @@ -81,6 +82,10 @@ static void isLayoutDone(void* data, Element* e)
return;
}
}
if (e->isRest() && toRest(e)->shouldNotBeDrawn()) {
// another valid exception
return;
}
// If layout of element is done it (usually?) has a valid
// bounding box (bbox).
if (e->visible() && !e->bbox().isValid()) {
Expand Down
7 changes: 5 additions & 2 deletions mtest/libmscore/compat206/markers-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,14 @@
</voice>
</Measure>
<Measure>
<measureRepeatCount>1</measureRepeatCount>
<voice>
<RepeatMeasure>
<MeasureRepeat>
<subtype>1</subtype>
<autoplace>0</autoplace>
<durationType>measure</durationType>
<duration>4/4</duration>
</RepeatMeasure>
</MeasureRepeat>
<BarLine>
<subtype>end</subtype>
</BarLine>
Expand Down
2 changes: 1 addition & 1 deletion mtest/libmscore/element/tst_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void TestElement::testIds()
ElementType::LAYOUT_BREAK,
ElementType::MARKER,
ElementType::JUMP,
ElementType::REPEAT_MEASURE,
ElementType::MEASURE_REPEAT,
ElementType::ICON,
ElementType::NOTE,
ElementType::SYMBOL,
Expand Down
Binary file added mtest/libmscore/midi/testMeasureRepeats-ref.mid
Binary file not shown.
Loading

0 comments on commit 357a177

Please sign in to comment.