TDengine/source/util/test/freelistTest.cpp

17 lines
296 B
C++
Raw Normal View History

#include <gtest/gtest.h>
2021-12-31 05:41:58 +00:00
2022-02-28 02:00:54 +00:00
#include "tfreelist.h"
2021-12-31 05:41:58 +00:00
TEST(TD_UTIL_FREELIST_TEST, simple_test) {
SFreeList fl;
tFreeListInit(&fl);
for (size_t i = 0; i < 1000; i++) {
void *ptr = NULL;
TFL_MALLOC(ptr, void*, 1024, &fl);
2021-12-31 05:41:58 +00:00
GTEST_ASSERT_NE(ptr, nullptr);
}
tFreeListClear(&fl);
}