summaryrefslogtreecommitdiffstats
path: root/test/test_allocator.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-09-28 11:14:08 -0400
committerDavid Robillard <d@drobilla.net>2024-09-28 11:15:15 -0400
commit50c73ad346fb63eb6d057dcc7d1351c95e12e83d (patch)
tree17e1be3b38642022e582dfde58ccced85c4ca15e /test/test_allocator.c
parent19bd977e943bf37c2c24ee0116486fa9b7611f70 (diff)
downloadzix-50c73ad346fb63eb6d057dcc7d1351c95e12e83d.tar.gz
zix-50c73ad346fb63eb6d057dcc7d1351c95e12e83d.tar.bz2
zix-50c73ad346fb63eb6d057dcc7d1351c95e12e83d.zip
Improve test allocator API
Add a simple API for setting up the failing allocator to avoid manually tinkering with its members. Conveniently, this also avoids confusing cppcheck.
Diffstat (limited to 'test/test_allocator.c')
-rw-r--r--test/test_allocator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_allocator.c b/test/test_allocator.c
index 9ecbfa0..2677624 100644
--- a/test/test_allocator.c
+++ b/test/test_allocator.c
@@ -122,7 +122,7 @@ static void
test_failing_allocator(void)
{
ZixFailingAllocator allocator = zix_failing_allocator();
- allocator.n_remaining = 0;
+ zix_failing_allocator_reset(&allocator, 0);
assert(!zix_malloc(&allocator.base, 16U));
assert(!zix_calloc(&allocator.base, 16U, 1U));