fix: ensure fresh MIDI connection before each integration test

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-12 18:49:12 +00:00
parent 2d254c0503
commit f96d7d290d

View File

@@ -399,6 +399,9 @@ static int test_multiple_channels(void) {
pid_t pid = start_looper(); pid_t pid = start_looper();
if (pid < 0) return 1; if (pid < 0) return 1;
/* ensure fresh MIDI connection for this test */
midi_inject_close();
jack_client_t *client; jack_client_t *client;
jack_status_t status; jack_status_t status;
client = jack_client_open("test_multi", JackNoStartServer, &status); client = jack_client_open("test_multi", JackNoStartServer, &status);
@@ -446,6 +449,8 @@ static int test_control_key_modifier(void) {
printf("Test: controlkey modifier triggers state transition via note 62\n"); printf("Test: controlkey modifier triggers state transition via note 62\n");
pid_t pid = start_looper(); pid_t pid = start_looper();
if (pid < 0) return 1; if (pid < 0) return 1;
/* ensure fresh MIDI connection for this test */
midi_inject_close();
jack_client_t *client; jack_client_t *client;
jack_status_t status; jack_status_t status;
client = jack_client_open("test_ctrl_key", JackNoStartServer, &status); client = jack_client_open("test_ctrl_key", JackNoStartServer, &status);
@@ -546,6 +551,8 @@ static int test_bind_channel(void) {
printf("Test: controlkey bind channel (note 0) and toggle\n"); printf("Test: controlkey bind channel (note 0) and toggle\n");
pid_t pid = start_looper(); pid_t pid = start_looper();
if (pid < 0) return 1; if (pid < 0) return 1;
/* ensure fresh MIDI connection for this test */
midi_inject_close();
jack_client_t *client; jack_client_t *client;
jack_status_t status; jack_status_t status;
client = jack_client_open("test_bind", JackNoStartServer, &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"); printf("Test: bind to channel 5, unbind, then toggle default (channel 0)\n");
pid_t pid = start_looper(); pid_t pid = start_looper();
if (pid < 0) return 1; if (pid < 0) return 1;
/* ensure fresh MIDI connection for this test */
midi_inject_close();
jack_client_t *client; jack_client_t *client;
jack_status_t status; jack_status_t status;
client = jack_client_open("test_unbind", JackNoStartServer, &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"); printf("Test: dynamic channel removal via MIDI command\n");
pid_t pid = start_looper(); pid_t pid = start_looper();
if (pid < 0) return 1; if (pid < 0) return 1;
/* ensure fresh MIDI connection for this test */
midi_inject_close();
jack_client_t *client; jack_client_t *client;
jack_status_t status; jack_status_t status;
client = jack_client_open("test_remove", JackNoStartServer, &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"); printf("Test: save WAV file from loop\n");
pid_t pid = start_looper(); pid_t pid = start_looper();
if (pid < 0) return 1; if (pid < 0) return 1;
/* ensure fresh MIDI connection for this test */
midi_inject_close();
jack_client_t *client; jack_client_t *client;
jack_status_t status; jack_status_t status;
client = jack_client_open("test_wav_save", JackNoStartServer, &status); client = jack_client_open("test_wav_save", JackNoStartServer, &status);