proxygen
|
#include <folly/IndexedMemPool.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Semaphore.h>
#include <folly/portability/Unistd.h>
#include <folly/test/DeterministicSchedule.h>
#include <string>
#include <thread>
Go to the source code of this file.
Classes | |
struct | NonTrivialStruct |
struct | MockTraits |
struct | MockTraits::Forwarder |
Typedefs | |
using | TraitsTestPool = IndexedMemPool< std::string, 1, 1, std::atomic, MockTraits::Forwarder > |
using | IncompleteTestPool = IndexedMemPool< IncompleteTestElement > |
Functions | |
TEST (IndexedMemPool, unique_ptr) | |
TEST (IndexedMemPool, no_starvation) | |
TEST (IndexedMemPool, st_capacity) | |
TEST (IndexedMemPool, mt_capacity) | |
TEST (IndexedMemPool, locate_elem) | |
TEST (IndexedMemPool, eager_recycle) | |
TEST (IndexedMemPool, late_recycle) | |
TEST (IndexedMemPool, no_data_races) | |
TEST (IndexedMemPool, construction_destruction) | |
void | testTraits (TraitsTestPool &pool) |
TEST (IndexedMemPool, use_traits_empty) | |
TEST (IndexedMemPool, use_traits_local_list) | |
TEST (IndexedMemPool, use_traits_global_list) | |
Variables | |
std::atomic< int > | cnum {0} |
std::atomic< int > | dnum {0} |
using IncompleteTestPool = IndexedMemPool<IncompleteTestElement> |
Definition at line 400 of file IndexedMemPoolTest.cpp.
using TraitsTestPool = IndexedMemPool<std::string, 1, 1, std::atomic, MockTraits::Forwarder> |
Definition at line 347 of file IndexedMemPoolTest.cpp.
TEST | ( | IndexedMemPool | , |
unique_ptr | |||
) |
Definition at line 31 of file IndexedMemPoolTest.cpp.
References EXPECT_LT, EXPECT_TRUE, i, folly::gen::move, and ptr.
TEST | ( | IndexedMemPool | , |
no_starvation | |||
) |
Definition at line 53 of file IndexedMemPoolTest.cpp.
References folly::netops::close(), count, EXPECT_EQ, EXPECT_GE, EXPECT_LE, EXPECT_NE, i, join, pipe(), fizz::detail::read(), uint32_t, folly::detail::distributed_mutex::wait(), and fizz::detail::write().
TEST | ( | IndexedMemPool | , |
st_capacity | |||
) |
Definition at line 111 of file IndexedMemPoolTest.cpp.
References EXPECT_EQ, EXPECT_NE, and i.
TEST | ( | IndexedMemPool | , |
mt_capacity | |||
) |
Definition at line 124 of file IndexedMemPoolTest.cpp.
References EXPECT_EQ, EXPECT_NE, i, threads, and uint32_t.
TEST | ( | IndexedMemPool | , |
locate_elem | |||
) |
Definition at line 148 of file IndexedMemPoolTest.cpp.
References folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::allocIndex(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, i, and folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::locateElem().
TEST | ( | IndexedMemPool | , |
eager_recycle | |||
) |
Definition at line 183 of file IndexedMemPoolTest.cpp.
References NonTrivialStruct::count, EXPECT_EQ, EXPECT_TRUE, i, folly::gen::move, ptr, and string.
TEST | ( | IndexedMemPool | , |
late_recycle | |||
) |
Definition at line 201 of file IndexedMemPoolTest.cpp.
References NonTrivialStruct::count, EXPECT_EQ, EXPECT_TRUE, i, and ptr.
TEST | ( | IndexedMemPool | , |
no_data_races | |||
) |
Definition at line 226 of file IndexedMemPoolTest.cpp.
References count, EXPECT_LE, EXPECT_NE, i, nthreads, folly::pushmi::detail::t, and uint32_t.
TEST | ( | IndexedMemPool | , |
construction_destruction | |||
) |
Definition at line 255 of file IndexedMemPoolTest.cpp.
References cnum, count, dnum, i, nthreads, start, folly::pushmi::detail::t, and uint32_t.
TEST | ( | IndexedMemPool | , |
use_traits_empty | |||
) |
Definition at line 370 of file IndexedMemPoolTest.cpp.
References testTraits().
TEST | ( | IndexedMemPool | , |
use_traits_local_list | |||
) |
Definition at line 376 of file IndexedMemPoolTest.cpp.
References testing::_, folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::allocElem(), EXPECT_CALL, and testTraits().
TEST | ( | IndexedMemPool | , |
use_traits_global_list | |||
) |
Definition at line 386 of file IndexedMemPoolTest.cpp.
References testing::_, folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::allocElem(), EXPECT_CALL, and testTraits().
void testTraits | ( | TraitsTestPool & | pool | ) |
Definition at line 349 of file IndexedMemPoolTest.cpp.
References testing::_, folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::allocElem(), EXPECT_CALL, EXPECT_EQ, EXPECT_FALSE, testing::Invoke(), folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::isAllocated(), folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::locateElem(), ptr, folly::IndexedMemPool< T, NumLocalLists_, LocalListLimit_, Atom, Traits >::recycleIndex(), s, and string.
Referenced by TEST().
std::atomic<int> cnum {0} |
Definition at line 252 of file IndexedMemPoolTest.cpp.
Referenced by TEST().
std::atomic<int> dnum {0} |
Definition at line 253 of file IndexedMemPoolTest.cpp.
Referenced by TEST().