aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-09 15:17:35 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-09 15:17:35 +0200
commit7059e4e133b62f5ad3339d51966f226089532710 (patch)
tree94f3124e189d4329f7ee52ff69fd6619754bcafe /test
parent6cd517eee582d797d766f3ed8dfbfb8c107eed7c (diff)
Try to do better error handling with custom allocators
Diffstat (limited to 'test')
-rw-r--r--test/_case-test.h9
1 files changed, 3 insertions, 6 deletions
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),