Skip to content

Commit

Permalink
Refactor; remove redundant test
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Mar 8, 2020
1 parent a12c9f7 commit 057ea31
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
3 changes: 1 addition & 2 deletions src/midi_psg.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ void midi_psg_noteOn(u8 chan, u8 key, u8 velocity)
MidiPsgChannel* psgChan = psgChannel(chan);
psgChan->noteReleased = false;
psgChan->key = key;
applyFrequency(psgChan, freqForMidiKey(key));
psgChan->velocity = velocity;
psgChan->noteOn = true;
initEnvelope(psgChan);
applyEnvelopeStep(psgChan);
psgChan->noteOn = true;
}

void midi_psg_noteOff(u8 chan, u8 pitch)
Expand Down
1 change: 0 additions & 1 deletion tests/unit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ int main(void)
midi_test(test_midi_plays_advanced_psg_envelope),
midi_test(test_midi_loops_psg_envelope),
midi_test(test_midi_psg_envelope_with_only_end_flag_is_silent),
midi_test(test_midi_psg_envelope_with_end_flag_sends_note_off),
midi_test(
test_midi_psg_envelope_with_loop_end_continues_playing_after_note_off),
midi_test(
Expand Down
17 changes: 0 additions & 17 deletions tests/unit/test_midi_psg.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,26 +270,9 @@ static void test_midi_psg_envelope_with_only_end_flag_is_silent(
UNUSED void** state)
{
u8 chan = MIN_PSG_CHAN;
u8 expectedPsgChan = 0;

__real_midi_program(chan, 5);

expect_psg_frequency(expectedPsgChan, 262);
__real_midi_noteOn(chan, 60, MAX_MIDI_VOLUME);
__real_midi_psg_tick();
}

static void test_midi_psg_envelope_with_end_flag_sends_note_off(
UNUSED void** state)
{
u8 chan = MIN_PSG_CHAN;
u8 expectedPsgChan = 0;

__real_midi_program(chan, 5);

expect_psg_frequency(expectedPsgChan, 262);
__real_midi_noteOn(chan, 60, MAX_MIDI_VOLUME);

__real_midi_psg_tick();
__real_midi_psg_tick();
}
Expand Down

0 comments on commit 057ea31

Please sign in to comment.