diff options
author | Gordon Sim <gsim@apache.org> | 2013-10-03 13:31:12 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2013-10-03 13:31:12 +0000 |
commit | 515fe2b92acbbea5a269ff761561698eb0fdc076 (patch) | |
tree | d64e84ae8b4dbbf7937d9836047ab4c53009a70b /cpp/src/tests/QueuePolicyTest.cpp | |
parent | a121612d15b9ac15bf0dc2ca612b94e9359e1b20 (diff) | |
download | qpid-python-515fe2b92acbbea5a269ff761561698eb0fdc076.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/qpid@1528852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/QueuePolicyTest.cpp')
-rw-r--r-- | cpp/src/tests/QueuePolicyTest.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/src/tests/QueuePolicyTest.cpp b/cpp/src/tests/QueuePolicyTest.cpp index ce1b0addea..f61c283fd4 100644 --- a/cpp/src/tests/QueuePolicyTest.cpp +++ b/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 |