summaryrefslogtreecommitdiff
path: root/src/unit/test_arena_allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit/test_arena_allocator.c')
-rw-r--r--src/unit/test_arena_allocator.c21
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
+}