MCPcopy Create free account
hub / github.com/baidu/babylon / SetUp

Method SetUp

test/concurrent/test_object_pool.cpp:10–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9struct ObjectPoolTest : public ::testing::Test {
10 void SetUp() override {
11 auto_pool.reserve_and_clear(4);
12 auto_pool.set_creator([&] {
13 create_times++;
14 return new ::std::string {"auto"};
15 });
16
17 pool.reserve_and_clear(4);
18 }
19
20 ObjectPool<::std::string> auto_pool;
21 ObjectPool<::std::string> pool;

Callers

nothing calls this directly

Calls 2

set_creatorMethod · 0.80
reserve_and_clearMethod · 0.45

Tested by

no test coverage detected