From d499b75a390cbb6a30206f384dd460e642ab7552 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 13 May 2008 18:46:00 +0000 Subject: Minor change to tests to use correlation id rather than body for identifying messages. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@655968 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/publish.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cpp/src/tests/publish.cpp') diff --git a/cpp/src/tests/publish.cpp b/cpp/src/tests/publish.cpp index 4cb23782cc..17e3d4e104 100644 --- a/cpp/src/tests/publish.cpp +++ b/cpp/src/tests/publish.cpp @@ -69,6 +69,13 @@ struct Client session = connection.newSession(ASYNC); } + std::string id(uint i) + { + std::stringstream s; + s << "msg" << i; + return s.str(); + } + void publish() { Message msg(string(opts.size, 'X'), opts.routingKey); @@ -76,8 +83,7 @@ struct Client msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT); for (uint i = 0; i < opts.count; i++) { - const_cast(msg.getData()).replace(0, sizeof(uint32_t), - reinterpret_cast(&i), sizeof(uint32_t)); + msg.getMessageProperties().setCorrelationId(id(i + 1)); session.messageTransfer(arg::destination=opts.destination, arg::content=msg, arg::acceptMode=1); -- cgit v1.2.1