diff options
author | Gordon Sim <gsim@apache.org> | 2008-07-23 09:40:49 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-07-23 09:40:49 +0000 |
commit | ffb8dcddca58e1277da90b823d7e7ec45a72e488 (patch) | |
tree | 7e5e296aecaff9234a8d5b627ac8e3cb2fb56a29 /qpid/cpp/src/tests/perftest.cpp | |
parent | b01fbd47df48b3871622ce35f3e9dce67e09be3f (diff) | |
download | qpid-python-ffb8dcddca58e1277da90b823d7e7ec45a72e488.tar.gz |
QPID-1183: Use the right sizes to insert data inside the message payload where sizeof(size_t) != sizeof(uint32_t). Patch from Manuel Teira.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@679048 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/perftest.cpp')
-rw-r--r-- | qpid/cpp/src/tests/perftest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/perftest.cpp b/qpid/cpp/src/tests/perftest.cpp index b666102e70..9096854a6d 100644 --- a/qpid/cpp/src/tests/perftest.cpp +++ b/qpid/cpp/src/tests/perftest.cpp @@ -465,8 +465,8 @@ struct PublishThread : public Client { for (size_t i=0; i<opts.count; i++) { // Stamp the iteration into the message data, avoid // any heap allocation. - const_cast<std::string&>(msg.getData()).replace(offset, sizeof(uint32_t), - reinterpret_cast<const char*>(&i), sizeof(uint32_t)); + const_cast<std::string&>(msg.getData()).replace(offset, sizeof(size_t), + reinterpret_cast<const char*>(&i), sizeof(size_t)); if (opts.syncPub) { sync(session).messageTransfer( arg::destination=destination, @@ -561,7 +561,7 @@ struct SubscribeThread : public Client { // // For now verify order only for a single publisher. size_t offset = opts.uniqueData ? 5 /*marker is 'data:'*/ : 0; - size_t n = *reinterpret_cast<const uint32_t*>(msg.getData().data() + offset); + size_t n = *reinterpret_cast<const size_t*>(msg.getData().data() + offset); if (opts.pubs == 1) { if (opts.subs == 1 || opts.mode == FANOUT) verify(n==expect, "==", expect, n); else verify(n>=expect, ">=", expect, n); |