You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/12/10 22:03:08 UTC
svn commit: r603047 - /incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp
Author: aconway
Date: Mon Dec 10 13:03:07 2007
New Revision: 603047
URL: http://svn.apache.org/viewvc?rev=603047&view=rev
Log:
Improved exception message for messages out-of-order.
Modified:
incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp
Modified: incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp?rev=603047&r1=603046&r2=603047&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/perftest.cpp Mon Dec 10 13:03:07 2007
@@ -231,9 +231,13 @@
// Functor to collect rates.
void operator()(const string& data) {
- double d=lexical_cast<double>(data);
- values.push_back(d);
- sum += d;
+ try {
+ double d=lexical_cast<double>(data);
+ values.push_back(d);
+ sum += d;
+ } catch (const std::exception&) {
+ throw Exception("Bad report: "+data);
+ }
}
double mean() const {
@@ -423,7 +427,7 @@
size_t lastMsg=0;
for (size_t i = 0; i < opts.subQuota; ++i) {
msg=lq.pop();
- // TODO aconway 2007-11-23: check message sequence for
+ // TODO aconway 2007-11-23: check message order for.
// multiple publishers. Need an array of counters,
// one per publisher and a publisher ID in the
// message. Careful not to introduce a lot of overhead
@@ -435,7 +439,10 @@
size_t n = *reinterpret_cast<uint32_t*>(data);
if (n < lastMsg) {
// Report to control.
- Message error("Out-of-sequence messages", "sub_done");
+ Message error(
+ QPID_MSG("Out-of-sequence messages, expected n>="
+ << lastMsg << " got " << n),
+ "sub_done");
session.messageTransfer(arg::content=error);
return;
}