summaryrefslogtreecommitdiff
path: root/cpp/src/tests/QueueTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-08-31 16:45:20 +0000
committerGordon Sim <gsim@apache.org>2007-08-31 16:45:20 +0000
commitf5a1cf995f4956ec2dd83a60715b31ad065f7751 (patch)
treea537a016f338510989011f78f8e0b6a84ac04c3d /cpp/src/tests/QueueTest.cpp
parent22822cb7bc8e315f14224adf17d51dbdd0018897 (diff)
downloadqpid-python-f5a1cf995f4956ec2dd83a60715b31ad065f7751.tar.gz
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
Diffstat (limited to 'cpp/src/tests/QueueTest.cpp')
-rw-r--r--cpp/src/tests/QueueTest.cpp16
1 files changed, 8 insertions, 8 deletions
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());