Copilot commented on code in PR #3627:
URL: https://github.com/apache/brpc/pull/3627#discussion_r4315921628
##########
test/mpsc_queue_unittest.cc:
##########
@@ -158,6 +158,11 @@ TEST(MPSCQueueTest, destroys_dequeued_element) {
ASSERT_EQ(0, DestructionTracked::alive);
}
+TEST(MPSCQueueTest, enqueue_move_only) {
+ butil::MPSCQueue<std::unique_ptr<int>> q;
+ q.Enqueue(std::make_unique<int>(1));
Review Comment:
This test only checks compilation and does not assert runtime behavior. To
better cover the move-only enqueue path, consider also dequeuing the element
and asserting it is non-null and holds the expected value (e.g., `*ptr == 1`),
or otherwise verifying the queue size/emptiness transitions if those APIs exist.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]