summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-02-13 19:21:21 +0000
committerGordon Sim <gsim@apache.org>2009-02-13 19:21:21 +0000
commit858b69ff7c0ad5bf938e3817497a1b7953bf76d5 (patch)
tree4a86049e3d957c36998679421dc05d39da81787d /cpp/src/tests/ClientSessionTest.cpp
parent499864a7738f2c099f02eeac53a6620d20ddf487 (diff)
downloadqpid-python-858b69ff7c0ad5bf938e3817497a1b7953bf76d5.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/qpid@744222 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index e4c311d8a0..e156000f18 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/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()