Loading system/gd/os/linux_generic/queue_unittest.cc +9 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <sys/eventfd.h> #include <atomic> #include <chrono> #include <future> #include <unordered_map> Loading @@ -26,6 +27,8 @@ #include "gtest/gtest.h" #include "os/reactor.h" using namespace std::chrono_literals; namespace bluetooth { namespace os { namespace { Loading Loading @@ -60,6 +63,11 @@ class QueueTest : public ::testing::Test { Handler* enqueue_handler_; Thread* dequeue_thread_; Handler* dequeue_handler_; void sync_enqueue_handler() { ASSERT(enqueue_thread_ != nullptr); ASSERT(enqueue_thread_->GetReactor()->WaitForIdle(2s)); } }; class TestEnqueueEnd { Loading Loading @@ -338,6 +346,7 @@ TEST_F(QueueTest, register_enqueue_with_half_empty_queue) { test_enqueue_end.RegisterEnqueue(&enqueue_promise_map); enqueue_future.wait(); EXPECT_EQ(enqueue_future.get(), 0); sync_enqueue_handler(); } // Enqueue end level : 1 Loading Loading
system/gd/os/linux_generic/queue_unittest.cc +9 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <sys/eventfd.h> #include <atomic> #include <chrono> #include <future> #include <unordered_map> Loading @@ -26,6 +27,8 @@ #include "gtest/gtest.h" #include "os/reactor.h" using namespace std::chrono_literals; namespace bluetooth { namespace os { namespace { Loading Loading @@ -60,6 +63,11 @@ class QueueTest : public ::testing::Test { Handler* enqueue_handler_; Thread* dequeue_thread_; Handler* dequeue_handler_; void sync_enqueue_handler() { ASSERT(enqueue_thread_ != nullptr); ASSERT(enqueue_thread_->GetReactor()->WaitForIdle(2s)); } }; class TestEnqueueEnd { Loading Loading @@ -338,6 +346,7 @@ TEST_F(QueueTest, register_enqueue_with_half_empty_queue) { test_enqueue_end.RegisterEnqueue(&enqueue_promise_map); enqueue_future.wait(); EXPECT_EQ(enqueue_future.get(), 0); sync_enqueue_handler(); } // Enqueue end level : 1 Loading