From 77a51f37415d8f93579cb3fb5da63705d8dbd5b5 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Tue, 27 Jan 2009 15:59:03 +0000 Subject: Modification to txtest to check that the size of the message remains consistent throughout the test. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@738118 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/txtest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cpp/src/tests') diff --git a/cpp/src/tests/txtest.cpp b/cpp/src/tests/txtest.cpp index 0c8ce90648..fb1d19ca8a 100644 --- a/cpp/src/tests/txtest.cpp +++ b/cpp/src/tests/txtest.cpp @@ -157,7 +157,13 @@ struct Transfer : public Client, public Runnable } for (uint m = 0; m < opts.msgsPerTx; m++) { in = lq.pop(); - out.setData(in.getData()); + std::string& data = in.getData(); + if (data.size() != opts.size) { + std::ostringstream oss; + oss << "Message size incorrect: size=" << in.getData().size() << "; expected " << opts.size; + throw std::runtime_error(oss.str()); + } + out.setData(data); out.getMessageProperties().setCorrelationId(in.getMessageProperties().getCorrelationId()); out.getDeliveryProperties().setDeliveryMode(in.getDeliveryProperties().getDeliveryMode()); session.messageTransfer(arg::content=out, arg::acceptMode=1); -- cgit v1.2.1