Skip to content

Commit

Permalink
Update name of logging checks switch to match new convention
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Feb 19, 2025
1 parent 64270ce commit 4fa7326
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tests/mocks/mock_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

static bool loggingChecks = false;

void wraps_disable_logging_checks(void)
void mock_log_disable_checks(void)
{
loggingChecks = false;
}

void wraps_enable_logging_checks(void)
void mock_log_enable_checks(void)
{
loggingChecks = true;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/mocks/mock_log.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include "cmocka_inc.h"

void wraps_disable_logging_checks(void);
void wraps_enable_logging_checks(void);
void mock_log_disable_checks(void);
void mock_log_enable_checks(void);

void __wrap_log_init(void);
void __wrap_log_info(const char* fmt, ...);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_comm_megawifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
int test_comm_megawifi_setup(UNUSED void** state)
{
log_init();
wraps_enable_logging_checks();
mock_log_enable_checks();
return 0;
}

Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int test_midi_setup(UNUSED void** state)
expect_any(__wrap_scheduler_addFrameHandler, onFrame);

P_BANK_0[30] = &P_BANK_0_INST_30_CASTANETS;
wraps_disable_logging_checks();
mock_log_disable_checks();
wraps_disable_checks();
mock_synth_disable_checks();
midi_init(M_BANK_0, P_BANK_0, TEST_ENVELOPES);
Expand Down Expand Up @@ -92,7 +92,7 @@ void test_midi_sets_all_sound_off(UNUSED void** state)

void test_midi_sets_unknown_CC(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

u8 expectedController = 0x9;
u8 expectedValue = 0x50;
Expand All @@ -103,7 +103,7 @@ void test_midi_sets_unknown_CC(UNUSED void** state)

void test_midi_ignores_sustain_pedal_cc(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

u8 cc = 64;

Expand All @@ -112,7 +112,7 @@ void test_midi_ignores_sustain_pedal_cc(UNUSED void** state)

void test_midi_ignores_expression_cc(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

u8 cc = 11;

Expand All @@ -121,7 +121,7 @@ void test_midi_ignores_expression_cc(UNUSED void** state)

void test_midi_ignores_sysex_nrpn_ccs(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

__real_midi_cc(0, 6, 1);
__real_midi_cc(0, 38, 1);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_midi_polyphony.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void test_midi_polyphonic_mode_sends_CCs_to_all_FM_channels(UNUSED void** state)

void test_midi_set_overflow_flag_on_polyphony_breach(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();
__real_midi_cc(0, CC_GENMDM_POLYPHONIC_MODE, 127);

for (int chan = 0; chan <= MAX_FM_CHAN; chan++) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_midi_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void test_midi_receiver_does_nothing_for_control_change(UNUSED void** state)

void test_midi_receiver_sets_unknown_event_for_unknown_status(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

u8 expectedStatus = 0xD0;

Expand All @@ -87,7 +87,7 @@ void test_midi_receiver_sets_unknown_event_for_unknown_status(UNUSED void** stat

void test_midi_receiver_sets_unknown_event_for_unknown_system_message(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

u8 expectedStatus = 0xF1;

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_midi_sysex.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void test_midi_sysex_disables_fm_parameter_CCs(UNUSED void** state)

void test_midi_sysex_loads_psg_envelope(UNUSED void** state)
{
wraps_enable_logging_checks();
mock_log_enable_checks();

const u8 sequence[] = { SYSEX_MANU_EXTENDED, SYSEX_MANU_REGION, SYSEX_MANU_ID,
SYSEX_COMMAND_LOAD_PSG_ENVELOPE, 0x01, 0x01 };
Expand Down

0 comments on commit 4fa7326

Please sign in to comment.