From f96d7d290d6b44d72a6801e1031a643002b95332 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Tue, 12 May 2026 18:49:12 +0000 Subject: [PATCH] fix: ensure fresh MIDI connection before each integration test Co-authored-by: aider (deepseek/deepseek-reasoner) --- tests/integration.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/integration.c b/tests/integration.c index f2b2c94..949394c 100644 --- a/tests/integration.c +++ b/tests/integration.c @@ -399,6 +399,9 @@ static int test_multiple_channels(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_multi", JackNoStartServer, &status); @@ -446,6 +449,8 @@ static int test_control_key_modifier(void) { printf("Test: control‑key modifier triggers state transition via note 62\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_ctrl_key", JackNoStartServer, &status); @@ -546,6 +551,8 @@ static int test_bind_channel(void) { printf("Test: control‑key bind channel (note 0) and toggle\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_bind", JackNoStartServer, &status); @@ -659,6 +666,8 @@ static int test_bind_unbind(void) { printf("Test: bind to channel 5, unbind, then toggle default (channel 0)\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_unbind", JackNoStartServer, &status); @@ -787,6 +796,8 @@ static int test_remove_channel(void) { printf("Test: dynamic channel removal via MIDI command\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_remove", JackNoStartServer, &status); @@ -992,6 +1003,8 @@ static int test_wav_save(void) { printf("Test: save WAV file from loop\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_wav_save", JackNoStartServer, &status);