diff options
| author | Gordon Sim <gsim@apache.org> | 2007-02-14 16:58:52 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-02-14 16:58:52 +0000 |
| commit | 9cb1922884c5b258c961046e6fd48e5152aa79d5 (patch) | |
| tree | 04662c38d1b70112619fe316e0b1de1d7de05f1c /cpp/tests | |
| parent | b4b64a31a12cfd7578baab35d5036169825b53c1 (diff) | |
| download | qpid-python-9cb1922884c5b258c961046e6fd48e5152aa79d5.tar.gz | |
Added durability property to queues and pass this to broker on declare. (This change also applied on trunk)
Minor update of accumulated ack and test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@507622 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests')
| -rw-r--r-- | cpp/tests/AccumulatedAckTest.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/cpp/tests/AccumulatedAckTest.cpp b/cpp/tests/AccumulatedAckTest.cpp index da984d3e69..64c1f979c0 100644 --- a/cpp/tests/AccumulatedAckTest.cpp +++ b/cpp/tests/AccumulatedAckTest.cpp @@ -29,11 +29,38 @@ using namespace qpid::broker; class AccumulatedAckTest : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(AccumulatedAckTest); + CPPUNIT_TEST(testGeneral); CPPUNIT_TEST(testCovers); CPPUNIT_TEST(testUpdateAndConsolidate); CPPUNIT_TEST_SUITE_END(); public: + void testGeneral() + { + AccumulatedAck ack; + ack.clear(); + ack.update(3,3); + ack.update(7,7); + ack.update(9,9); + ack.update(1,2); + ack.update(4,5); + ack.update(6,6); + + for(int i = 1; i <= 7; i++) CPPUNIT_ASSERT(ack.covers(i)); + CPPUNIT_ASSERT(ack.covers(9)); + + CPPUNIT_ASSERT(!ack.covers(8)); + CPPUNIT_ASSERT(!ack.covers(10)); + + ack.consolidate(); + + for(int i = 1; i <= 7; i++) CPPUNIT_ASSERT(ack.covers(i)); + CPPUNIT_ASSERT(ack.covers(9)); + + CPPUNIT_ASSERT(!ack.covers(8)); + CPPUNIT_ASSERT(!ack.covers(10)); + } + void testCovers() { AccumulatedAck ack; @@ -67,15 +94,12 @@ class AccumulatedAckTest : public CppUnit::TestCase 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()); + CPPUNIT_ASSERT_EQUAL((u_int64_t) 6, ack.range); + CPPUNIT_ASSERT_EQUAL((size_t) 2, 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); - } }; |
