diff options
author | Alan Conway <aconway@apache.org> | 2007-01-15 13:58:07 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-01-15 13:58:07 +0000 |
commit | ea0eb5e1a4844b6a36a7087239b2e813fc858ebe (patch) | |
tree | 462d1884f98b59260b1524ad788902ffe5bdd664 /qpid/cpp/tests | |
parent | 71c036d96d72fae9844da047a1ac1000f143c384 (diff) | |
download | qpid-python-ea0eb5e1a4844b6a36a7087239b2e813fc858ebe.tar.gz |
2006-12-08 Jim Meyering <meyering@redhat.com>
Ensure that AccumulatedAck.range is not used uninitialized.
* lib/broker/AccumulatedAck.h (AccumulatedAck): Make this a class,
rather than a struct.
(AccumulatedAck::AccumulatedAck): Add a constructor to require
initialization of the "range" member.
* lib/broker/BrokerChannel.cpp (Channel) [accumulatedAck]: Initialize.
* tests/TxAckTest.cpp (TxAckTest) [acked]: Likewise.
* tests/AccumulatedAckTest.cpp (testCovers): Initialize local.
(testUpdateAndConsolidate): Likewise.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@496317 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/tests')
-rw-r--r-- | qpid/cpp/tests/AccumulatedAckTest.cpp | 6 | ||||
-rw-r--r-- | qpid/cpp/tests/TxAckTest.cpp | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/qpid/cpp/tests/AccumulatedAckTest.cpp b/qpid/cpp/tests/AccumulatedAckTest.cpp index bfd9358422..a2ee3df752 100644 --- a/qpid/cpp/tests/AccumulatedAckTest.cpp +++ b/qpid/cpp/tests/AccumulatedAckTest.cpp @@ -36,8 +36,7 @@ class AccumulatedAckTest : public CppUnit::TestCase public: void testCovers() { - AccumulatedAck ack; - ack.range = 5; + AccumulatedAck ack(5); ack.individual.push_back(7); ack.individual.push_back(9); @@ -56,8 +55,7 @@ class AccumulatedAckTest : public CppUnit::TestCase void testUpdateAndConsolidate() { - AccumulatedAck ack; - ack.clear(); + AccumulatedAck ack(0); ack.update(1, false); ack.update(3, false); ack.update(10, false); diff --git a/qpid/cpp/tests/TxAckTest.cpp b/qpid/cpp/tests/TxAckTest.cpp index 0ffe984ded..7d5b8a838a 100644 --- a/qpid/cpp/tests/TxAckTest.cpp +++ b/qpid/cpp/tests/TxAckTest.cpp @@ -66,7 +66,7 @@ class TxAckTest : public CppUnit::TestCase public: - TxAckTest() : queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid) + TxAckTest() : acked(0), queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid) { for(int i = 0; i < 10; i++){ Message::shared_ptr msg(new Message(0, "exchange", "routing_key", false, false)); |