add other failing test and fix them

This commit is contained in:
Laytan Laats
2023-12-18 15:17:27 +01:00
parent af962526df
commit 4ae021cd4c
2 changed files with 16 additions and 5 deletions

View File

@@ -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)
}