| 75 | }; |
| 76 | |
| 77 | TEST_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 | |
| 92 | TEST_F(ClosureTest, finish_when_error_occur) { |
| 93 | a->emit<int>(); |
nothing calls this directly
no test coverage detected