diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-11-06 14:29:39 +0200 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-11-06 14:29:39 +0200 |
commit | 2e0702c597e3099316c8c82379c3425ecc7a2dd2 (patch) | |
tree | 58860a91682a61d1e5bdf24b73617b4ad49b0de6 /lib/tst/allocator.hh | |
parent | makefile: replace ,SRCS with .SRCS (diff) | |
download | kernel-2e0702c597e3099316c8c82379c3425ecc7a2dd2.tar.xz |
lib/malloc: add linked list implementation
Diffstat (limited to 'lib/tst/allocator.hh')
-rw-r--r-- | lib/tst/allocator.hh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/tst/allocator.hh b/lib/tst/allocator.hh new file mode 100644 index 0000000..3bc1715 --- /dev/null +++ b/lib/tst/allocator.hh @@ -0,0 +1,22 @@ +#pragma once + +class TestAllocator : public ::testing::Test { +protected: + void + SetUp() override + { + memory = malloc(memory_size); + libk::alloc_init(memory, memory_size); + ASSERT_EQ(libk::begin, memory); + } + + void + TearDown() override + { + free(memory); + libk::begin = nullptr; + } + + const size_t memory_size = 4096; + void *memory = nullptr; +}; |