summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/QueuePolicyTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-10-03 13:31:12 +0000
committerGordon Sim <gsim@apache.org>2013-10-03 13:31:12 +0000
commit20fbc65eba57a9526a39652cb1473a8551d3d97b (patch)
tree0e76e628c5dc075f659fa2c83bdf57bffe343a0c /qpid/cpp/src/tests/QueuePolicyTest.cpp
parent02a92c253e729a1c27df35b2555ab0a453e54a85 (diff)
downloadqpid-python-20fbc65eba57a9526a39652cb1473a8551d3d97b.tar.gz
QPID-5199: take 0-10 header segment into account for message size
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1528852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/QueuePolicyTest.cpp')
-rw-r--r--qpid/cpp/src/tests/QueuePolicyTest.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/qpid/cpp/src/tests/QueuePolicyTest.cpp b/qpid/cpp/src/tests/QueuePolicyTest.cpp
index ce1b0addea..f61c283fd4 100644
--- a/qpid/cpp/src/tests/QueuePolicyTest.cpp
+++ b/qpid/cpp/src/tests/QueuePolicyTest.cpp
@@ -69,9 +69,15 @@ QPID_AUTO_TEST_CASE(testRingPolicyCount)
QPID_AUTO_TEST_CASE(testRingPolicySize)
{
- std::string hundredBytes = std::string(100, 'h');
- std::string fourHundredBytes = std::string (400, 'f');
- std::string thousandBytes = std::string(1000, 't');
+ //The message size now includes all headers as well as the content
+ //aka body, so compute the amount of data needed to hit a given
+ //overall size
+ std::string q("my-ring-queue");
+ size_t minMessageSize = 25/*minimum size of headers*/ + q.size()/*routing key length*/ + 4/*default exchange, added by broker*/;
+
+ std::string hundredBytes = std::string(100 - minMessageSize, 'h');
+ std::string fourHundredBytes = std::string (400 - minMessageSize, 'f');
+ std::string thousandBytes = std::string(1000 - minMessageSize, 't');
// Ring queue, 500 bytes maxSize
@@ -79,7 +85,6 @@ QPID_AUTO_TEST_CASE(testRingPolicySize)
args.setSizePolicy(RING, 500, 0);
SessionFixture f;
- std::string q("my-ring-queue");
f.session.queueDeclare(arg::queue=q, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args);
// A. Send messages 0 .. 5, each 100 bytes