diff --git a/source/dnode/vnode/impl/test/CMakeLists.txt b/source/dnode/vnode/impl/test/CMakeLists.txt index 9c09be56fb95b8aa2e410178438de1961f81a397..83506a4fdee92379acba148c879514d99a849b5e 100644 --- a/source/dnode/vnode/impl/test/CMakeLists.txt +++ b/source/dnode/vnode/impl/test/CMakeLists.txt @@ -1,9 +1,7 @@ -# vnodeMemAllocatorTest -add_executable(VMATest "") -target_sources(VMATest +# Vnode API test +add_executable(vnodeApiTests "") +target_sources(vnodeApiTests PRIVATE - "../src/vnodeMemAllocator.c" - "vnodeMemAllocatorTest.cpp" + "vnodeApiTests.cpp" ) -target_include_directories(VMATest PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../inc") -target_link_libraries(VMATest os gtest_main vnode) \ No newline at end of file +target_link_libraries(vnodeApiTests vnode gtest gtest_main) \ No newline at end of file diff --git a/source/dnode/vnode/impl/test/vnodeApiTests.cpp b/source/dnode/vnode/impl/test/vnodeApiTests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..81831fa167be9c1c477b3beb96e764371951afd2 --- /dev/null +++ b/source/dnode/vnode/impl/test/vnodeApiTests.cpp @@ -0,0 +1,7 @@ +#include +#include + +TEST(vnodeApiTest, vnodeOpen_test) { + // TODO + std::cout << "This is in vnodeApiTest" << std::endl; +} diff --git a/source/dnode/vnode/impl/test/vnodeMemAllocatorTest.cpp b/source/dnode/vnode/impl/test/vnodeMemAllocatorTest.cpp deleted file mode 100644 index f2d07e6aa59243a4034dc49badf598fe777b9f31..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/impl/test/vnodeMemAllocatorTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -#include "vnodeMemAllocator.h" - -TEST(VMATest, basic_create_and_destroy_test) { - 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 diff --git a/source/dnode/vnode/impl/test/vnodeTests.cpp b/source/dnode/vnode/impl/test/vnodeTests.cpp deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000