diff --git a/tests/core/mem/test_core_mem.odin b/tests/core/mem/test_core_mem.odin index bd072b4e9..c1cb59c68 100644 --- a/tests/core/mem/test_core_mem.odin +++ b/tests/core/mem/test_core_mem.odin @@ -193,3 +193,111 @@ fail_if_allocations_overlap :: proc(t: ^testing.T, a, b: []byte) { testing.fail_now(t, "Allocations overlapped") } } + + +// This merely does a few simple operations to test basic sanity. +// +// A serious test of an allocator would require hooking it up to a benchmark or +// a large, complicated program in order to get all manner of usage patterns. +basic_sanity_test :: proc(t: ^testing.T, allocator: mem.Allocator, limit: int, loc := #caller_location) -> bool { + context.allocator = allocator + + { + a := make([dynamic]u8) + for i in 0..