Author: astitcher
Date: Wed Feb 14 08:22:38 2007
New Revision: 507602
URL: http://svn.apache.org/viewvc?view=rev&rev=507602
Log:
[EMAIL PROTECTED]: andrew | 2007-02-14 16:15:34 +0000
Fixed tests, and fixed an exposed bug
Modified:
incubator/qpid/branches/qpid.0-9/ (props changed)
incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.cpp
incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp
Propchange: incubator/qpid/branches/qpid.0-9/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Wed Feb 14 08:22:38 2007
@@ -1 +1 @@
-8427bd24-ae5a-4eba-a324-d2fc9c9c6c77:/local/qpid.0-9.ams:1125
+8427bd24-ae5a-4eba-a324-d2fc9c9c6c77:/local/qpid.0-9.ams:1127
Modified: incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.cpp?view=diff&rev=507602&r1=507601&r2=507602
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.cpp
(original)
+++ incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.cpp Wed Feb
14 08:22:38 2007
@@ -18,14 +18,17 @@
* under the License.
*
*/
-#include <AccumulatedAck.h>
+#include "AccumulatedAck.h"
+
+#include <assert.h>
using std::less_equal;
using std::bind2nd;
using namespace qpid::broker;
void AccumulatedAck::update(u_int64_t firstTag, u_int64_t lastTag){
- if (firstTag-1 == range) {
+ assert(firstTag<=lastTag);
+ if (firstTag <= range+1) {
range = lastTag;
} else {
for (u_int64_t tag = firstTag; tag<=lastTag; tag++)
Modified: incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp?view=diff&rev=507602&r1=507601&r2=507602
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp (original)
+++ incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp Wed Feb
14 08:22:38 2007
@@ -58,14 +58,14 @@
{
AccumulatedAck ack;
ack.clear();
- ack.update(1, false);
- ack.update(3, false);
- ack.update(10, false);
- ack.update(8, false);
- ack.update(6, false);
- ack.update(3, true);
- ack.update(2, true);
- ack.update(5, true);
+ ack.update(1, 1);
+ ack.update(3, 3);
+ ack.update(10, 10);
+ ack.update(8, 8);
+ ack.update(6, 6);
+ ack.update(3, 3);
+ ack.update(2, 2);
+ ack.update(0, 5);
ack.consolidate();
CPPUNIT_ASSERT_EQUAL((u_int64_t) 5, ack.range);
CPPUNIT_ASSERT_EQUAL((size_t) 3, ack.individual.size());