mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
16 lines
273 B
C++
16 lines
273 B
C++
|
|
#include "gtest/gtest.h"
|
||
|
|
|
||
|
|
#include "freelist.h"
|
||
|
|
|
||
|
|
TEST(TD_UTIL_FREELIST_TEST, simple_test) {
|
||
|
|
SFreeList fl;
|
||
|
|
|
||
|
|
tFreeListInit(&fl);
|
||
|
|
|
||
|
|
for (size_t i = 0; i < 1000; i++) {
|
||
|
|
void *ptr = TFL_MALLOC(1024, &fl);
|
||
|
|
GTEST_ASSERT_NE(ptr, nullptr);
|
||
|
|
}
|
||
|
|
|
||
|
|
tFreeListClear(&fl);
|
||
|
|
}
|