freelistTest.cpp 273 字节
Newer Older
H
more  
Hongze Cheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#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);
}