MCPcopy Create free account
hub / github.com/apache/brpc / TEST

Function TEST

test/bthread_list_unittest.cpp:31–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31TEST(ListTest, join_thread_by_list) {
32 bthread_list_t list;
33 ASSERT_EQ(0, bthread_list_init(&list, 0, 0));
34 std::vector<bthread_t> tids;
35 for (size_t i = 0; i < 10; ++i) {
36 bthread_t th;
37 ASSERT_EQ(0, bthread_start_urgent(
38 &th, NULL, sleeper, (void*)10000/*10ms*/));
39 ASSERT_EQ(0, bthread_list_add(&list, th));
40 tids.push_back(th);
41 }
42 ASSERT_EQ(0, bthread_list_join(&list));
43 for (size_t i = 0; i < tids.size(); ++i) {
44 ASSERT_FALSE(bthread::TaskGroup::exists(tids[i]));
45 }
46 bthread_list_destroy(&list);
47}
48
49TEST(ListTest, join_a_destroyed_list) {
50 bthread_list_t list;

Callers

nothing calls this directly

Calls 7

bthread_list_initFunction · 0.85
bthread_start_urgentFunction · 0.85
bthread_list_addFunction · 0.85
bthread_list_joinFunction · 0.85
bthread_list_destroyFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected