Skip to content

Commit

Permalink
Add characterisation test for note priority at MIDI unit level
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Jul 16, 2024
1 parent 1504680 commit 2cc5df5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/unit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ int main(void)
midi_test(test_midi_pitch_bends_up_an_octave),
midi_test(test_midi_pitch_bends_up_an_octave_upper_freq_limit),
midi_test(test_midi_persists_pitch_bend_between_notes),
midi_test(test_midi_note_priority_respected_for_multiple_notes),

midi_test(test_midi_sets_psg_pitch_bend_down),
midi_test(test_midi_sets_psg_pitch_bend_up),
midi_test(test_midi_psg_pitch_bend_persists_after_tick),
Expand Down
21 changes: 20 additions & 1 deletion tests/unit/test_midi_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,4 +698,23 @@ static void test_midi_persists_pitch_bends_for_special_mode_op_between_notes(
expect_value(__wrap_synth_specialModeVolume, op, 0);
expect_value(__wrap_synth_specialModeVolume, volume, MAX_MIDI_VOLUME);
__real_midi_note_on(chan, MIDI_PITCH_C4, MAX_MIDI_VOLUME);
}
}

static void test_midi_note_priority_respected_for_multiple_notes(
UNUSED void** state)
{
expect_synth_pitch(0, 4, 0x284);
expect_synth_volume_any();
expect_value(__wrap_synth_noteOn, channel, 0);
__real_midi_note_on(0, MIDI_PITCH_C4, MAX_MIDI_VOLUME);

expect_synth_pitch(0, 4, 0x2a9);
expect_synth_volume_any();
expect_value(__wrap_synth_noteOn, channel, 0);
__real_midi_note_on(0, MIDI_PITCH_CS4, MAX_MIDI_VOLUME);

expect_synth_pitch(0, 4, 0x284);
expect_synth_volume_any();
expect_value(__wrap_synth_noteOn, channel, 0);
__real_midi_note_off(0, MIDI_PITCH_CS4);
}

0 comments on commit 2cc5df5

Please sign in to comment.