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

Function TEST_F

test/anyflow/test_closure.cpp:77–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75};
76
77TEST_F(ClosureTest, finish_when_data_ready) {
78 a->emit<int>();
79 auto closure = graph->run(b);
80 ::std::thread([&] {
81 ::usleep(100000);
82 begin.set_value(true);
83 end.set_value(0);
84 }).detach();
85 ASSERT_FALSE(closure.finished());
86 ASSERT_EQ(0, closure.get());
87 ASSERT_TRUE(closure.finished());
88 ASSERT_EQ(0, closure.error_code());
89 ASSERT_EQ("10086", *b->value<std::string>());
90}
91
92TEST_F(ClosureTest, finish_when_error_occur) {
93 a->emit<int>();

Callers

nothing calls this directly

Calls 10

set_valueMethod · 0.80
wait_forMethod · 0.80
get_futureMethod · 0.80
runMethod · 0.45
finishedMethod · 0.45
getMethod · 0.45
error_codeMethod · 0.45
emptyMethod · 0.45
waitMethod · 0.45
on_finishMethod · 0.45

Tested by

no test coverage detected