| 36 | } |
| 37 | |
| 38 | TEST(CountdonwEventTest, sanity) { |
| 39 | std::vector<bthread_t> tids; |
| 40 | for (int n = 1; n < 10; ++n) { |
| 41 | Arg a; |
| 42 | a.num_sig = n; |
| 43 | a.event.reset(n); |
| 44 | for (int i = 0; i < n; ++i) { |
| 45 | bthread_t tid; |
| 46 | ASSERT_EQ(0, bthread_start_urgent(&tid, NULL, signaler, &a)); |
| 47 | tids.push_back(tid); |
| 48 | } |
| 49 | a.event.wait(); |
| 50 | ASSERT_EQ(0, a.num_sig.load(butil::memory_order_relaxed)); |
| 51 | } |
| 52 | for (size_t i = 0; i < tids.size(); ++i) { |
| 53 | bthread_join(tids[i], NULL); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | TEST(CountdonwEventTest, timed_wait) { |
| 58 | bthread::CountdownEvent event; |
nothing calls this directly
no test coverage detected