summaryrefslogtreecommitdiff
path: root/test/list_clients.c
diff options
context:
space:
mode:
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);