Skip to content

Commit

Permalink
Use more explicit function call check for scheduler frame handler reg…
Browse files Browse the repository at this point in the history
…istration function
  • Loading branch information
rhargreaves committed Mar 31, 2024
1 parent 55bf634 commit 02bf473
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/unit/test_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static const u8* TEST_ENVELOPES[MIDI_PROGRAMS] = { ENVELOPE_0, ENVELOPE_1,

int test_midi_setup(UNUSED void** state)
{
expect_function_call(__wrap_scheduler_addFrameHandler);
expect_any(__wrap_scheduler_addFrameHandler, onFrame);

P_BANK_0[30] = &P_BANK_0_INST_30_CASTANETS;
expect_any(__wrap_synth_init, defaultPreset);
Expand Down Expand Up @@ -156,7 +156,7 @@ void test_midi_hides_fm_parameter_ui(UNUSED void** state)
void test_midi_reset_reinitialises_module(UNUSED void** state)
{
expect_any(__wrap_synth_init, defaultPreset);
expect_function_call(__wrap_scheduler_addFrameHandler);
expect_any(__wrap_scheduler_addFrameHandler, onFrame);

__real_midi_reset();
}
6 changes: 3 additions & 3 deletions tests/unit/test_midi_psg.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static void test_midi_shifts_semitone_in_psg_envelope(UNUSED void** state)

print_message("Shift: %d %d\n", i, envelopeStep);

expect_function_call(__wrap_scheduler_addFrameHandler);
expect_any(__wrap_scheduler_addFrameHandler, onFrame);
midi_psg_init(envelopes);

expect_psg_attenuation(expectedPsgChan, PSG_ATTENUATION_LOUDEST);
Expand All @@ -374,7 +374,7 @@ static void test_midi_pitch_shift_handles_upper_limit_psg_envelope(
const u8 envelope[] = { EEF_LOOP_START, 0x00, 0x10, EEF_END };
const u8* envelopes[] = { envelope };

expect_function_call(__wrap_scheduler_addFrameHandler);
expect_any(__wrap_scheduler_addFrameHandler, onFrame);
midi_psg_init(envelopes);

expect_psg_tone(expectedPsgChan, expectedInitialTone);
Expand All @@ -394,7 +394,7 @@ static void test_midi_pitch_shift_handles_lower_limit_psg_envelope(
const u8 envelope[] = { EEF_LOOP_START, 0x00, 0x80, EEF_END };
const u8* envelopes[] = { envelope };

expect_function_call(__wrap_scheduler_addFrameHandler);
expect_any(__wrap_scheduler_addFrameHandler, onFrame);
midi_psg_init(envelopes);

expect_psg_tone(expectedPsgChan, expectedInitialTone);
Expand Down
2 changes: 1 addition & 1 deletion tests/wraps.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ void __wrap_scheduler_addTickHandler(HandlerFunc* onTick)

void __wrap_scheduler_addFrameHandler(HandlerFunc* onFrame)
{
function_called();
check_expected(onFrame);
}

void __wrap_comm_megawifi_tick(void)
Expand Down

0 comments on commit 02bf473

Please sign in to comment.