use of musicxmltestsuite.tests.utils.ToDo in project Zong by Xenoage.
the class Test31a method test.
@ToDo("add support for multiple direction-types within a single MusicXML direction")
@Test
public void test() {
Score score = getScore();
// test directions
for (Tuple2<MP, ?> item : expectedDirections) {
MP mp = item.get1();
List<?> directions = null;
// in the column header instead, and not in the measure
if (item.get2() instanceof Tempo)
directions = score.getColumnHeader(mp.measure).getTempos().getAll(mp.beat);
else if (item.get2() instanceof NavigationSign)
directions = score.getColumnHeader(mp.measure).getOtherDirections().getAll(mp.beat);
else
directions = score.getMeasure(mp).getDirections().getAll(mp.beat);
// check correct classes
if (item.get2() instanceof Direction) {
// single direction at this beat expected
assertEquals("" + mp, 1, directions.size());
assertEquals("" + mp, item.get2().getClass(), directions.get(0).getClass());
} else if (item.get2() instanceof List<?>) {
// List<?> l = (List<?>) item.get2();
// multiple directions at this beat expected
// TODO: add support for multiple direction-types within a single MusicXML direction
// assertEquals(""+mp, l.size(), directions.size());
// for (int i : range(l))
// assertEquals(""+mp+"["+i+"]", l.get(i).getClass(), directions.get(i).getClass());
}
}
// segno and coda
assertEquals(MusicElementType.Segno, score.getColumnHeader(1).getNavigationTarget().getMusicElementType());
assertEquals(MusicElementType.Coda, score.getColumnHeader(1).getNavigationOrigin().getMusicElementType());
}
use of musicxmltestsuite.tests.utils.ToDo in project Zong by Xenoage.
the class Test02a method test.
@ToDo("multirests are not supported yet")
@Test
public void test() {
MxlPart part = getFirstPart();
int iDuration = 0;
// from MusicXML file
int divisions = 64;
for (int iM = 0; iM < part.getMeasures().size(); iM++) {
MxlMeasure measure = part.getMeasures().get(iM);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Note) {
// check type and duration
MxlNormalNote note = (MxlNormalNote) ((MxlNote) data).getContent();
assertEquals(MxlFullNoteContentType.Rest, note.getFullNote().getContent().getFullNoteContentType());
assertEquals("rest " + iDuration, expectedDurations[iDuration++], Companion.fr(note.getDuration(), divisions * 4));
}
}
}
assertEquals("not all rests found", expectedDurations.length, iDuration);
}
use of musicxmltestsuite.tests.utils.ToDo in project Zong by Xenoage.
the class Test03a method test.
@ToDo("multiple-rest not yet supported")
@Test
public void test() {
MxlPart part = getFirstPart();
int iDuration = 0;
// from MusicXML file
int divisions = 64;
for (int iM = 0; iM < part.getMeasures().size(); iM++) {
MxlMeasure measure = part.getMeasures().get(iM);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Note) {
// check type and duration
MxlNormalNote note = (MxlNormalNote) ((MxlNote) data).getContent();
assertEquals(MxlFullNoteContentType.Pitch, note.getFullNote().getContent().getFullNoteContentType());
assertEquals("note " + iDuration, expectedDurations[iDuration++], Companion.fr(note.getDuration(), divisions * 4));
}
}
}
assertEquals("not all notes found", expectedDurations.length, iDuration);
}
use of musicxmltestsuite.tests.utils.ToDo in project Zong by Xenoage.
the class Test13a method test.
@ToDo("Zong! supports only -7 to +7, starting in measure 9, ending in measure 38")
@Test
public void test() {
MxlPart part = getFirstPart();
TraditionalKey[] expectedKeys = getExpectedKeys();
int iKey = 0;
for (int i = 8; i <= 37; i++) {
MxlMeasure measure = part.getMeasures().get(i);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Attributes) {
// check type
MxlAttributes attr = (MxlAttributes) data;
MxlKey key = attr.getKey();
assertEquals(expectedKeys[iKey].getFifths(), key.getFifths());
assertEquals(expectedKeys[iKey].getMode(), getEnumValue("" + key.getMode(), Mode.values()));
iKey++;
}
}
}
}
use of musicxmltestsuite.tests.utils.ToDo in project Zong by Xenoage.
the class Test01a method test.
@ToDo("the editiorial sharp (sharp in parenthesis) in the last measure is not supported yet")
@Test
public void test() {
Pitch[] expectedPitches = getExpectedPitches();
Staff staff = getFirstStaff();
assertEquals(26, staff.getMeasures().size());
int iPitch = 0;
for (int iM = 0; iM < staff.getMeasures().size(); iM++) {
Measure measure = staff.getMeasures().get(iM);
Voice voice = measure.getVoice(0);
for (VoiceElement e : voice.getElements()) {
if (e instanceof Chord) {
// check note and pitch
Chord chord = (Chord) e;
assertEquals(expectedPitches[iPitch++], chord.getNotes().get(0).getPitch());
}
}
}
assertEquals("not all notes found", expectedPitches.length, iPitch);
}
Aggregations