minor changes to tests

This commit is contained in:
2025-10-10 20:31:20 +02:00
parent c5d6d2ff08
commit 86d5110b0b
2 changed files with 11 additions and 6 deletions
+4
View File
@@ -1,3 +1,7 @@
# ISSUES
No matter what I do it says that there are 2666 allocations or something. This
is concerning.
# A collection of libraries inspired by zig
I like zig, but I really like writing C. I am starting with implementing
+7 -6
View File
@@ -13,14 +13,15 @@ Test(borrow_allocator, test) {
borrow_allocator_assert_all_freed(&balloc);
}
// TODO: when I update the number of allocations it does not seem to change the
// number of allocated bytes...
#define IS_SIZE 900
Test(borrow_allocator, with) {
with_borrow(foo) {
allocator_alloc(foo, 1000);
allocator_alloc(foo, 100);
allocator_alloc(foo, 90);
int *is = allocator_alloc(foo, sizeof(int) * IS_SIZE);
for (int i = 0; i < IS_SIZE; i++) is[i] = i;
is = allocator_alloc(foo, sizeof(int) * IS_SIZE);
for (int i = 0; i < IS_SIZE; i++) is[i] = i;
is = allocator_alloc(foo, sizeof(int) * IS_SIZE);
for (int i = 0; i < IS_SIZE; i++) is[i] = i;
break;
}
}