Files
mimir/tests/heap_test.cpp
Kearwood Gilbert 513db7130b
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 tests for Heap allocator
2026-09-20 14:19:07 -07:00

24 lines
387 B
C++

#include <gtest/gtest.h>
#include "mimir.h"
#include "test_util.h"
namespace mimir_tests {
TEST(Heap, InitialState)
{
mimir::init();
mimir::Heap heap;
EXPECT_EQ(heap.getUsed(), 0);
}
TEST(Heap, OutOfMemory)
{
mimir::init();
mimir::Heap heap;
EXPECT_TRUE(heap.init(1ULL << 24, 1ULL << 46));
EXPECT_TRUE(heap.alloc(1ULL << 49) == nullptr);
}
}; // namespace mimir_tests