From d67fd84e5f5aa34d5ddad40355e05446bca00a37 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 13 Apr 2025 21:41:59 -0600 Subject: lib9p_srv: Require less compile-time config --- lib9p/tests/test_server/main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib9p/tests/test_server/main.c') diff --git a/lib9p/tests/test_server/main.c b/lib9p/tests/test_server/main.c index f89166f..0705747 100644 --- a/lib9p/tests/test_server/main.c +++ b/lib9p/tests/test_server/main.c @@ -27,8 +27,11 @@ #include "config.h" -#ifndef CONFIG_SRV9P_NUM_CONNS - #error config.h must define CONFIG_SRV9P_NUM_CONNS +#ifndef _CONFIG_9P_MAX_CONNS + #error config.h must define _CONFIG_9P_MAX_CONNS +#endif +#ifndef _CONFIG_9P_MAX_REQS + #error config.h must define _CONFIG_9P_MAX_REQS #endif /* globals ********************************************************************/ @@ -39,7 +42,7 @@ const char *hexdig = "0123456789abcdef"; struct { uint16_t port; - struct hostnet_tcp_listener listeners[CONFIG_SRV9P_NUM_CONNS]; + struct hostnet_tcp_listener listeners[_CONFIG_9P_MAX_CONNS]; struct lib9p_srv srv; FILE *logstream; } globals = { @@ -110,12 +113,12 @@ static COROUTINE init_cr(void *) { sleep_for_ms(1); /* test that sleep works */ - for (int i = 0; i < CONFIG_SRV9P_NUM_CONNS; i++) { + for (int i = 0; i < _CONFIG_9P_MAX_CONNS; i++) { char name[] = {'r', 'e', 'a', 'd', '-', hexdig[i], '\0'}; if (!coroutine_add(name, read_cr, &i)) error(1, 0, "coroutine_add(read_cr, &i)"); } - for (int i = 0; i < 2*CONFIG_SRV9P_NUM_CONNS; i++) { + for (int i = 0; i < _CONFIG_9P_MAX_REQS; i++) { char name[] = {'w', 'r', 'i', 't', 'e', '-', hexdig[i], '\0'}; if (!coroutine_add(name, write_cr, NULL)) error(1, 0, "coroutine_add(write_cr, NULL)"); -- cgit v1.2.3-2-g168b