Add tests for Heap allocator
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Add Heap::getMaxSize() Add Heap::getUsed() Add minSize argument to Heap::init()
This commit is contained in:
@@ -14,8 +14,9 @@ enable_testing()
|
||||
|
||||
add_executable(
|
||||
mimir_test
|
||||
"region_test.cpp"
|
||||
"arena_test.cpp"
|
||||
"heap_test.cpp"
|
||||
"region_test.cpp"
|
||||
"test_util.cpp")
|
||||
target_link_libraries(
|
||||
mimir_test
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
|
||||
namespace mimir_tests {
|
||||
|
||||
TEST(Arena, InitialState)
|
||||
{
|
||||
mimir::init();
|
||||
mimir::Arena arena;
|
||||
EXPECT_TRUE(arena.init());
|
||||
EXPECT_EQ(arena.getUsed(), 0);
|
||||
}
|
||||
|
||||
TEST(Arena, OutOfMemory)
|
||||
{
|
||||
mimir::init();
|
||||
|
||||
Reference in New Issue
Block a user