diff options
| author | Gordon Sim <gsim@apache.org> | 2006-10-31 15:38:36 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2006-10-31 15:38:36 +0000 |
| commit | 1150be6d66a943d899e25af4cb876e7f68c657d9 (patch) | |
| tree | 582b89c2b738b66255deecbacf089a91c07d3348 /cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp | |
| parent | 2c78ceb1faaad9c9e57ad7c815ceea82f9ff15a1 (diff) | |
| download | qpid-python-1150be6d66a943d899e25af4cb876e7f68c657d9.tar.gz | |
Added doc & unit tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@469530 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp')
| -rw-r--r-- | cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp b/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp index a4459cf0c2..6cbdaacc32 100644 --- a/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp +++ b/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp @@ -27,6 +27,7 @@ class AccumulatedAckTest : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(AccumulatedAckTest); CPPUNIT_TEST(testCovers); + CPPUNIT_TEST(testUpdateAndConsolidate); CPPUNIT_TEST_SUITE_END(); public: @@ -49,6 +50,30 @@ class AccumulatedAckTest : public CppUnit::TestCase CPPUNIT_ASSERT(!ack.covers(8)); CPPUNIT_ASSERT(!ack.covers(10)); } + + void testUpdateAndConsolidate() + { + 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.consolidate(); + CPPUNIT_ASSERT_EQUAL((u_int64_t) 5, ack.range); + CPPUNIT_ASSERT_EQUAL((size_t) 3, ack.individual.size()); + list<u_int64_t>::iterator i = ack.individual.begin(); + CPPUNIT_ASSERT_EQUAL((u_int64_t) 6, *i); + i++; + CPPUNIT_ASSERT_EQUAL((u_int64_t) 8, *i); + i++; + CPPUNIT_ASSERT_EQUAL((u_int64_t) 10, *i); + + } }; // Make this test suite a plugin. |
