feat: add Carla plugin host stubs and integration plan

This commit is contained in:
Loic Coenen
2026-05-14 22:11:01 +00:00
committed by Loic Coenen (aider)
parent 5cffec86e7
commit dafc7fe46b
10 changed files with 246 additions and 142 deletions

View File

@@ -0,0 +1,46 @@
#include <stdio.h>
#include "carla_host.h"
static int tests_passed = 0;
static int tests_failed = 0;
#define ASSERT_EQ(expected, actual, msg) do { \
if ((expected) != (actual)) { \
fprintf(stderr, "FAIL: %s (expected %d, got %d)\n", msg, (int)(expected), (int)(actual)); \
tests_failed++; \
} else { \
printf("PASS: %s\n", msg); \
tests_passed++; \
} \
} while(0)
static void test_carla_load_null_binary(void)
{
int id = -999;
int ret = carla_load(NULL, "someplugin", &id);
ASSERT_EQ(-1, ret, "carla_load(NULL, ...) returns -1");
}
static void test_carla_unload_invalid_id(void)
{
int ret = carla_unload(-1);
ASSERT_EQ(-1, ret, "carla_unload(-1) returns -1");
}
static void test_carla_connect_invalid_id(void)
{
int ret = carla_connect(-1, "out", "looper:in");
ASSERT_EQ(-1, ret, "carla_connect(-1, ...) returns -1");
}
int main(void)
{
printf("=== Carla host stub unit tests ===\n");
test_carla_load_null_binary();
test_carla_unload_invalid_id();
test_carla_connect_invalid_id();
printf("\nResults: %d passed, %d failed\n", tests_passed, tests_failed);
return tests_failed > 0 ? 1 : 0;
}

View File

@@ -1,3 +1,4 @@
#define _POSIX_C_SOURCE 200809L
#include "tui.h"
#include <stdio.h>
#include <stdlib.h>