22 #define TESTING_MEM_POOL 32 memory_manager_ut::test_mem_pool_free_zero()
37 pool.free(0xFFFFFFFFFFFFFFFF);
41 memory_manager_ut::test_mem_pool_free_heap_twice()
45 auto &&addr1 = pool.
alloc(1 << 3);
51 memory_manager_ut::test_mem_pool_invalid_pool()
55 this->
expect_exception([&] { pool_type pool{0xFFFFFFFFFFFFFFF0}; },
""_ut_lee);
59 memory_manager_ut::test_mem_pool_malloc_zero()
66 memory_manager_ut::test_mem_pool_multiple_malloc_heap_should_be_contiguous()
74 addr1 = pool.
alloc((1 << 3));
75 addr2 = pool.
alloc((1 << 3));
76 addr3 = pool.
alloc((1 << 3));
77 addr4 = pool.
alloc((1 << 3));
89 addr1 = pool.
alloc((1 << 3) + 2);
90 addr2 = pool.
alloc((1 << 3) + 2);
91 addr3 = pool.
alloc((1 << 3) + 2);
92 addr4 = pool.
alloc((1 << 3) * 4);
106 memory_manager_ut::test_mem_pool_malloc_heap_all_of_memory()
111 for (
auto i = 0; i < 16; i++)
112 addrs.push_back(pool.alloc(1 << 3));
116 for (
const auto &
addr : addrs)
119 for (
auto i = 0; i < 16; i++)
120 addrs.push_back(pool.alloc(1 << 3));
124 for (
const auto &
addr : addrs)
129 memory_manager_ut::test_mem_pool_malloc_heap_all_of_memory_one_block()
136 memory_manager_ut::test_mem_pool_malloc_heap_all_memory_fragmented()
141 for (
auto i = 0; i < 16; i++)
142 addrs.push_back(pool.alloc(1 << 3));
144 for (
const auto &
addr : addrs)
151 memory_manager_ut::test_mem_pool_malloc_heap_too_much_memory_one_block()
158 memory_manager_ut::test_mem_pool_malloc_heap_too_much_memory_non_block_size()
165 memory_manager_ut::test_mem_pool_malloc_heap_massive()
172 memory_manager_ut::test_mem_pool_size_out_of_bounds()
179 memory_manager_ut::test_mem_pool_size_unallocated()
186 memory_manager_ut::test_mem_pool_size()
195 memory_manager_ut::test_mem_pool_contains_out_of_bounds()
206 memory_manager_ut::test_mem_pool_contains()
#define expect_exception(f, e)
uintptr_t integer_pointer
constexpr const auto addr
void free(integer_pointer addr) noexcept
integer_pointer alloc(size_type size)
uintptr_t integer_pointer