MCPcopy Create free account
hub / github.com/apache/incubator-pegasus / TEST

Function TEST

src/runtime/test/async_call.cpp:96–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94};
95
96TEST(async_call, task_call)
97{
98 /* normal lpc*/
99 tracker_class *tc = new tracker_class();
100 task_ptr t =
101 tasking::enqueue(LPC_TEST_CLIENTLET, &tc->_tracker, [tc] { tc->callback_function1(); });
102 EXPECT_TRUE(t != nullptr);
103 t->wait();
104 EXPECT_TRUE(tc->str == "after called");
105 delete tc;
106
107 /* task tracking */
108 tc = new tracker_class();
109 std::vector<task_ptr> test_tasks;
110 t = tasking::enqueue(LPC_TEST_CLIENTLET,
111 &tc->_tracker,
112 [=] { tc->callback_function1(); },
113 0,
114 std::chrono::seconds(30));
115 test_tasks.push_back(t);
116 t = tasking::enqueue(LPC_TEST_CLIENTLET,
117 &tc->_tracker,
118 [tc] { tc->callback_function1(); },
119 0,
120 std::chrono::seconds(30));
121 test_tasks.push_back(t);
122 t = tasking::enqueue_timer(LPC_TEST_CLIENTLET,
123 &tc->_tracker,
124 [tc] { tc->callback_function1(); },
125 std::chrono::seconds(20),
126 0,
127 std::chrono::seconds(30));
128 test_tasks.push_back(t);
129
130 delete tc;
131 for (unsigned int i = 0; i != test_tasks.size(); ++i)
132 EXPECT_FALSE(test_tasks[i]->cancel(true));
133}
134
135TEST(async_call, rpc_call)
136{

Callers

nothing calls this directly

Calls 15

enqueueFunction · 0.85
enqueue_timerFunction · 0.85
call_one_way_typedFunction · 0.85
spin_waitFunction · 0.85
callback_function1Method · 0.80
substrMethod · 0.80
replace_callbackMethod · 0.80
get_countMethod · 0.80
getMethod · 0.65
callFunction · 0.50
waitMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected