diff --git a/source/server/vnode/test/vnodeMemAllocatorTest.cpp b/source/server/vnode/test/vnodeMemAllocatorTest.cpp index 4de717d80d..f2d07e6aa5 100644 --- a/source/server/vnode/test/vnodeMemAllocatorTest.cpp +++ b/source/server/vnode/test/vnodeMemAllocatorTest.cpp @@ -4,5 +4,19 @@ #include "vnodeMemAllocator.h" TEST(VMATest, basic_create_and_destroy_test) { - std::cout << "Hello, this is VMA test" << std::endl; + SVnodeMemAllocator *vma = VMACreate(1024, 512, 64); + EXPECT_TRUE(vma != nullptr); + EXPECT_EQ(vma->full, false); + EXPECT_EQ(vma->ssize, 512); + EXPECT_EQ(vma->threshold, 64); + EXPECT_EQ(vma->inuse->tsize, 1024); + VMADestroy(vma); + + vma = VMACreate(1024, 512, 1024); + EXPECT_TRUE(vma != nullptr); + VMADestroy(vma); + + vma = VMACreate(1024, 512, 1025); + EXPECT_TRUE(vma == nullptr); + VMADestroy(vma); } \ No newline at end of file