diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2023-12-18 15:17:27 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2023-12-18 15:17:27 +0100 |
| commit | 4ae021cd4cc8fb8a1cf27c0b7c2272ddd025dde0 (patch) | |
| tree | c49f385861a39845b91048cb8e1675e4f3dc22ec /tests | |
| parent | af962526df0f082083646d9ff8e13bff5bcbc921 (diff) | |
add other failing test and fix them
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/core/runtime/test_core_runtime.odin | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/core/runtime/test_core_runtime.odin b/tests/core/runtime/test_core_runtime.odin index 6ec1e78d9..5ae07ffe2 100644 --- a/tests/core/runtime/test_core_runtime.odin +++ b/tests/core/runtime/test_core_runtime.odin @@ -30,6 +30,7 @@ main :: proc() { test_temp_allocator_big_alloc_and_alignment(&t) test_temp_allocator_alignment_boundary(&t) + test_temp_allocator_returns_correct_size(&t) fmt.printf("%v/%v tests successful.\n", TEST_count - TEST_fail, TEST_count) if TEST_fail > 0 { @@ -56,6 +57,16 @@ test_temp_allocator_big_alloc_and_alignment :: proc(t: ^testing.T) { context.allocator = runtime.arena_allocator(&arena) mappy: map[[8]int]int - err := reserve(&mappy, 50000) + err := reserve(&mappy, 50000) expect_value(t, err, nil) } + +@(test) +test_temp_allocator_returns_correct_size :: proc(t: ^testing.T) { + arena: runtime.Arena + context.allocator = runtime.arena_allocator(&arena) + + bytes, err := mem.alloc_bytes(10, 16) + expect_value(t, err, nil) + expect_value(t, len(bytes), 10) +} |