diff options
author | Linnnus <[email protected]> | 2025-04-08 01:07:22 +0000 |
---|---|---|
committer | Linnnus <[email protected]> | 2025-04-08 01:07:34 +0000 |
commit | 8dd0c4f27aae02dd60f029db4cf03f9902cba26f (patch) | |
tree | 829c4bc0917f6615c55ae61d49932179c038c1e5 /src/unit/test_arena_allocator.c |
feat: Initial commit
At this point we have some allocation routines but no work on the actual
language has been done.
Diffstat (limited to 'src/unit/test_arena_allocator.c')
-rw-r--r-- | src/unit/test_arena_allocator.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/unit/test_arena_allocator.c b/src/unit/test_arena_allocator.c new file mode 100644 index 0000000..5a6e3d8 --- /dev/null +++ b/src/unit/test_arena_allocator.c @@ -0,0 +1,21 @@ +#include "../core/allocator.h" +#include "../core/arena_allocator.h" +#include "../core/std_allocator.h" +#include "./allocator_utils.h" + +#include "greatest.h" + +SUITE(arena_allocator) { +#define RUN_WITH_ARENA(test) \ + do { \ + SandAllocator parent = sand_new_std_allocator(); \ + SandArena arena = sand_create_arena(&parent); \ + SandAllocator a = sand_get_allocator_for_arena(&arena); \ + RUN_TEST1(test, &a); \ + sand_destroy_arena(&arena); \ + } while (0); + + + RUN_ALLOCATOR_TESTS(RUN_WITH_ARENA); +#undef X +} |