From f5a1cf995f4956ec2dd83a60715b31ad065f7751 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 31 Aug 2007 16:45:20 +0000 Subject: Pass QueuedMessage to queues consumers. This records the position of that message in the queue which is need to handle rlease and acquire. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571518 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/QueueTest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cpp/src/tests/QueueTest.cpp') diff --git a/cpp/src/tests/QueueTest.cpp b/cpp/src/tests/QueueTest.cpp index ef1518af4c..bf742f9511 100644 --- a/cpp/src/tests/QueueTest.cpp +++ b/cpp/src/tests/QueueTest.cpp @@ -40,10 +40,10 @@ public: bool received; TestConsumer(): received(false) {}; - virtual bool deliver(Message::shared_ptr& msg){ - last = msg; - received = true; - return true; + virtual bool deliver(QueuedMessage& msg){ + last = msg.payload; + received = true; + return true; }; }; @@ -97,7 +97,7 @@ class QueueTest : public CppUnit::TestCase CPPUNIT_ASSERT(!c1.received); msg1->enqueueComplete(); - received = queue->dequeue(); + received = queue->dequeue().payload; CPPUNIT_ASSERT_EQUAL(msg1.get(), received.get()); @@ -190,11 +190,11 @@ class QueueTest : public CppUnit::TestCase CPPUNIT_ASSERT_EQUAL(uint32_t(3), queue->getMessageCount()); - received = queue->dequeue(); + received = queue->dequeue().payload; CPPUNIT_ASSERT_EQUAL(msg1.get(), received.get()); CPPUNIT_ASSERT_EQUAL(uint32_t(2), queue->getMessageCount()); - received = queue->dequeue(); + received = queue->dequeue().payload; CPPUNIT_ASSERT_EQUAL(msg2.get(), received.get()); CPPUNIT_ASSERT_EQUAL(uint32_t(1), queue->getMessageCount()); @@ -207,7 +207,7 @@ class QueueTest : public CppUnit::TestCase CPPUNIT_ASSERT_EQUAL(msg3.get(), consumer.last.get()); CPPUNIT_ASSERT_EQUAL(uint32_t(0), queue->getMessageCount()); - received = queue->dequeue(); + received = queue->dequeue().payload; CPPUNIT_ASSERT(!received); CPPUNIT_ASSERT_EQUAL(uint32_t(0), queue->getMessageCount()); -- cgit v1.2.1