summaryrefslogtreecommitdiff
path: root/test/list_clients.c
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2026-02-21 11:14:42 +0100
committerJesper Jensen <jesper@jnsn.dev>2026-02-21 11:14:42 +0100
commit1b19afaa339f2f68520d61b634600ddeb04effb7 (patch)
tree232ec9fdc03a8955a8c847b88a688306689d2633 /test/list_clients.c
parent0b6e8026a6b530c7d88607bfdf79b9692987abaa (diff)
Split up the rendering from the logic
Diffstat (limited to 'test/list_clients.c')
-rw-r--r--test/list_clients.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/list_clients.c b/test/list_clients.c
index ea34794..3cab798 100644
--- a/test/list_clients.c
+++ b/test/list_clients.c
@@ -1,4 +1,4 @@
-#include "web.h"
+#include "app.h"
#include <assert.h>
#include <stdio.h>
@@ -7,21 +7,19 @@
int main() {
struct App app = { .dbname = "file::memory:?cache=shared" };
- prepare_database(&app);
- struct Server server = { .app = &app };
- struct Request request = { .server = &server };
+ app_startup(&app);
- // Insert 17 clients using create_client
+ // Insert 17 clients using app_create_client
for (int i = 1; i <= 17; i++) {
char name[32];
snprintf(name, sizeof(name), "client%d", i);
struct CreateClientResult cr;
- create_client(&request, name, &cr);
+ create_client(&app, name, &cr);
}
- // Call list_clients
+ // Call app_list_clients
struct ListClientResult *result = malloc(sizeof(*result) + 16 * sizeof(struct ListClientResultClient));
- list_clients(&request, result);
+ list_clients(&app, result);
// Verify: exactly 16 returned, correct order and names
assert(result->clients_len == 16);