diff options
author | Gordon Sim <gsim@apache.org> | 2009-02-13 19:21:21 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-02-13 19:21:21 +0000 |
commit | 492b05e6aa1a771d86cdb29c04dfe7d0ebefdd4b (patch) | |
tree | e68d7d95ea082c4faaaa1b71e909785fd663f446 /qpid/cpp/src/tests/ClientSessionTest.cpp | |
parent | f8b4543a97933d7736f89451be7726b411e8498b (diff) | |
download | qpid-python-492b05e6aa1a771d86cdb29c04dfe7d0ebefdd4b.tar.gz |
Ensure that the queue depth in bytes remains accurate for LVQ. This also ensures that there are no underflow exceptions from the policy that keeps this count.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@744222 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r-- | qpid/cpp/src/tests/ClientSessionTest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp index e4c311d8a0..e156000f18 100644 --- a/qpid/cpp/src/tests/ClientSessionTest.cpp +++ b/qpid/cpp/src/tests/ClientSessionTest.cpp @@ -21,6 +21,7 @@ #include "unit_test.h" #include "test_tools.h" #include "BrokerFixture.h" +#include "qpid/client/QueueOptions.h" #include "qpid/client/SubscriptionManager.h" #include "qpid/sys/Monitor.h" #include "qpid/sys/Thread.h" @@ -526,6 +527,27 @@ QPID_AUTO_TEST_CASE(testSessionCloseOnInvalidSession) { session.close(); } +QPID_AUTO_TEST_CASE(testLVQVariedSize) { + ClientSessionFixture fix; + std::string queue("my-lvq"); + QueueOptions args; + args.setOrdering(LVQ_NO_BROWSE); + fix.session.queueDeclare(arg::queue=queue, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args); + + std::string key; + args.getLVQKey(key); + + for (size_t i = 0; i < 10; i++) { + std::ostringstream data; + size_t size = 100 - ((i % 10) * 10); + data << std::string(size, 'x'); + + Message m(data.str(), queue); + m.getHeaders().setString(key, "abc"); + fix.session.messageTransfer(arg::content=m); + } +} + QPID_AUTO_TEST_SUITE_END() |