enh: add heaptest
This commit is contained in:
parent
3d83b74b26
commit
6259dcc8bd
|
@ -71,6 +71,9 @@ add_test(
|
||||||
COMMAND osTimeTests
|
COMMAND osTimeTests
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if(TD_LINUX)
|
||||||
|
|
||||||
add_executable(osAtomicTests "osAtomicTests.cpp")
|
add_executable(osAtomicTests "osAtomicTests.cpp")
|
||||||
target_link_libraries(osAtomicTests os util gtest_main)
|
target_link_libraries(osAtomicTests os util gtest_main)
|
||||||
add_test(
|
add_test(
|
||||||
|
@ -78,8 +81,6 @@ add_test(
|
||||||
COMMAND osAtomicTests
|
COMMAND osAtomicTests
|
||||||
)
|
)
|
||||||
|
|
||||||
if(TD_LINUX)
|
|
||||||
|
|
||||||
add_executable(osDirTests "osDirTests.cpp")
|
add_executable(osDirTests "osDirTests.cpp")
|
||||||
target_link_libraries(osDirTests os util gtest_main)
|
target_link_libraries(osDirTests os util gtest_main)
|
||||||
add_test(
|
add_test(
|
||||||
|
|
|
@ -33,6 +33,13 @@ ENDIF()
|
||||||
INCLUDE_DIRECTORIES(${TD_SOURCE_DIR}/src/util/inc)
|
INCLUDE_DIRECTORIES(${TD_SOURCE_DIR}/src/util/inc)
|
||||||
INCLUDE_DIRECTORIES(${TD_SOURCE_DIR}/include/common)
|
INCLUDE_DIRECTORIES(${TD_SOURCE_DIR}/include/common)
|
||||||
|
|
||||||
|
add_executable(heapTest "heapTest.cpp")
|
||||||
|
target_link_libraries(heapTest os util gtest_main)
|
||||||
|
add_test(
|
||||||
|
NAME heapTest
|
||||||
|
COMMAND heapTest
|
||||||
|
)
|
||||||
|
|
||||||
# arrayTest
|
# arrayTest
|
||||||
add_executable(arrayTest "arrayTest.cpp")
|
add_executable(arrayTest "arrayTest.cpp")
|
||||||
target_link_libraries(arrayTest os util gtest_main)
|
target_link_libraries(arrayTest os util gtest_main)
|
||||||
|
|
|
@ -20,7 +20,7 @@ int32_t heapCompare(const HeapNode* a, const HeapNode* b) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(TD_UTIL_HEAP_TEST, heapTest) {
|
TEST(heapTest, heapTest) {
|
||||||
Heap* heap = heapCreate(heapCompare);
|
Heap* heap = heapCreate(heapCompare);
|
||||||
ASSERT_TRUE(heap != NULL);
|
ASSERT_TRUE(heap != NULL);
|
||||||
ASSERT_EQ(0, heapSize(heap));
|
ASSERT_EQ(0, heapSize(heap));
|
||||||
|
|
Loading…
Reference in New Issue