Skip to content

Commit

Permalink
Make test more realistic
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Jul 26, 2024
1 parent bdbc2bd commit b16707a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/asserts.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ void expect_synth_noteOn(u8 chan)
expect_value(__wrap_synth_noteOn, channel, chan);
}

void expect_synth_noteOff(u8 chan)
{
expect_value(__wrap_synth_noteOff, channel, chan);
}

void _expect_ym2612_write_reg(u8 part, u8 reg, u8 data, const char* const file, const int line)
{
#ifdef DEBUG
Expand Down
1 change: 1 addition & 0 deletions tests/asserts.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void stub_usb_receive_pitch_bend(u8 chan, u16 bend);
void stub_comm_read_returns_midi_event(u8 status, u8 data, u8 data2);
void expect_ym2612_write_operator_any_data(u8 chan, u8 op, u8 baseReg);
void expect_synth_noteOn(u8 chan);
void expect_synth_noteOff(u8 chan);
void expect_synth_volume(u8 channel, u8 volume);
u8 regOpIndex(u8 op);

Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_midi_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ static void test_midi_persists_pitch_bend_between_notes(UNUSED void** state)
expect_synth_pitch(chan, 3, 1163);
__real_midi_pitch_bend(chan, 1000);

expect_synth_noteOff(chan);
__real_midi_note_off(chan, 60);

expect_synth_pitch(chan, 3, 1163);
expect_synth_volume_any();
expect_value(__wrap_synth_noteOn, channel, chan);
Expand Down

0 comments on commit b16707a

Please sign in to comment.