diff --git a/tests/integration.c b/tests/integration.c index ef2455b..f2b2c94 100644 --- a/tests/integration.c +++ b/tests/integration.c @@ -171,6 +171,8 @@ static int test_audio_pass_through(void) { printf("Test: audio pass‑through (connectivity)\n"); pid_t pid = start_looper(); if (pid < 0) return 1; + /* ensure fresh MIDI connection for this test */ + midi_inject_close(); jack_client_t *client; jack_status_t status; client = jack_client_open("test_passthrough", JackNoStartServer, &status); @@ -297,6 +299,9 @@ static int test_looper_looping(void) { pid_t pid = start_looper(); if (pid < 0) return 1; + /* ensure fresh MIDI connection for this test */ + midi_inject_close(); + jack_client_t *client; jack_status_t status; client = jack_client_open("test_looping", JackNoStartServer, &status); @@ -897,6 +902,8 @@ static int test_wav_load(void) { } pid_t pid = start_looper(); if (pid < 0) { unlink("loop.wav"); return 1; } + /* ensure fresh MIDI connection for this test */ + midi_inject_close(); jack_client_t *client; jack_status_t status; client = jack_client_open("test_wav_load", JackNoStartServer, &status); @@ -944,8 +951,6 @@ static int test_wav_load(void) { unlink("loop.wav"); return 1; } - /* force a fresh MIDI connection for this test */ - midi_inject_close(); /* send control key + note 70 to trigger load */ if (send_jack_note_on("looper:control", 64, 127) != 0) { jack_deactivate(client); @@ -1045,8 +1050,6 @@ static int test_wav_save(void) { return 1; } safe_usleep(500000); - /* force a fresh MIDI connection for this test */ - midi_inject_close(); /* send control key + note 71 to save */ if (send_jack_note_on("looper:control", 64, 127) != 0) { jack_deactivate(client);