提交 5787ff05 编写于 作者: H Hongze Cheng

add test

上级 34f7051e
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册