From 7059e4e133b62f5ad3339d51966f226089532710 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 9 May 2024 15:17:35 +0200 Subject: Try to do better error handling with custom allocators --- test/_case-test.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/_case-test.h b/test/_case-test.h index 684c6ec..ea05a86 100644 --- a/test/_case-test.h +++ b/test/_case-test.h @@ -65,12 +65,9 @@ test(const char8_t *line, int id) : 0; arena a = mkarena(0); - mapped.p = FUNC(&mapped.len, before, cf, alloc_arena, &a); - - if (mapped.p == nullptr) { - warn("case %d: got null %s buffer", id, STR(CASETYPE_VERB)); - return false; - } + mapped.p = FUNC(&mapped.len, before, cf, alloc_arena, &(struct arena_ctx){ + .a = &a, + }); if (!u8eq(mapped, after)) { warn("case %d: expected ā€˜%.*sā€™ but got ā€˜%.*sā€™", id, SV_PRI_ARGS(after), -- cgit v1.2.3