Beispiel #1
0
TEST_F(EventBaseThreadTest, example) {
  EventBaseThread ebt;

  Baton<> done;
  ebt.getEventBase()->runInEventBaseThread([&] { done.post(); });
  ASSERT_TRUE(done.timed_wait(seconds(1)));
}
Beispiel #2
0
TEST_F(EventBaseThreadTest, default_manager) {
  auto ebm = EventBaseManager::get();
  EventBaseThread ebt;
  auto ebt_eb = ebt.getEventBase();
  auto ebm_eb = static_cast<EventBase*>(nullptr);
  ebt_eb->runInEventBaseThreadAndWait([&] { ebm_eb = ebm->getEventBase(); });
  EXPECT_EQ(uintptr_t(ebt_eb), uintptr_t(ebm_eb));
}