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

Function TEST_F

test/concurrent/test_object_pool.cpp:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26};
27
28TEST_F(ObjectPoolTest, pop_wait_push) {
29 ::std::thread([&] {
30 {
31 auto ptr = pool.pop();
32 ASSERT_EQ("10086", *ptr);
33 }
34 p.set_value();
35 }).detach();
36 ASSERT_EQ(::std::future_status::timeout,
37 f.wait_for(::std::chrono::milliseconds(100)));
38 pool.push(::std::unique_ptr<::std::string>(new ::std::string {"10086"}));
39 f.get();
40}
41
42TEST_F(ObjectPoolTest, push_wait_pop) {
43 ::std::thread([&] {

Callers

nothing calls this directly

Calls 8

set_valueMethod · 0.80
wait_forMethod · 0.80
set_recyclerMethod · 0.80
popMethod · 0.45
pushMethod · 0.45
getMethod · 0.45
releaseMethod · 0.45
try_popMethod · 0.45

Tested by

no test coverage detected