summaryrefslogtreecommitdiffstats
path: root/test/test_string_view.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_string_view.c')
-rw-r--r--test/test_string_view.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_string_view.c b/test/test_string_view.c
index 52b824d..764edcb 100644
--- a/test/test_string_view.c
+++ b/test/test_string_view.c
@@ -5,6 +5,7 @@
#include "failing_allocator.h"
+#include "zix/allocator.h"
#include "zix/string_view.h"
#include <assert.h>
@@ -94,7 +95,7 @@ test_copy(void)
ZixFailingAllocator allocator = zix_failing_allocator();
// Copying a string takes exactly one allocation
- allocator.n_remaining = 1U;
+ zix_failing_allocator_reset(&allocator, 1U);
char* const copy = zix_string_view_copy(&allocator.base, orig);
assert(copy);
@@ -102,7 +103,7 @@ test_copy(void)
zix_free(&allocator.base, copy);
// Check that allocation failure is handled gracefully
- allocator.n_remaining = 0U;
+ zix_failing_allocator_reset(&allocator, 0U);
assert(!zix_string_view_copy(&allocator.base, orig));
}