# HG changeset patch # User Tom Fredrik Blenning Klaussen # Date 1347570487 -7200 # Node ID f9fa7ea71d37a943056d972e1e3876dd01498409 # Parent f8d0ea827db365a4c51f0c26192f412b83d3a72b Plug leaks in tests. diff -r f8d0ea827db3 -r f9fa7ea71d37 TestBitDecoder.cpp --- a/TestBitDecoder.cpp Mon Sep 10 23:59:46 2012 +0200 +++ b/TestBitDecoder.cpp Thu Sep 13 23:08:07 2012 +0200 @@ -8,7 +8,7 @@ BitDecoder* up = new BitDecoder("a"); BitDecoder* down = new BitDecoder("b"); - BitDecoder* full = BitDecoder::merge(down, up); + std::auto_ptr full(BitDecoder::merge(down, up)); BOOST_REQUIRE(full->data().isNull()); BOOST_REQUIRE_EQUAL(up->data(), "a"); @@ -31,7 +31,7 @@ up = new BitDecoder(QString('c' + i)); } - BitDecoder* full = BitDecoder::merge(down, up); + std::auto_ptr full(BitDecoder::merge(down, up)); BOOST_REQUIRE(full->data().isNull()); BOOST_REQUIRE_EQUAL(full->decode("1"), "n"); @@ -48,5 +48,4 @@ BOOST_REQUIRE_EQUAL(full->decode("000000000001"), "c"); BOOST_REQUIRE_EQUAL(full->decode("0000000000001"), "b"); BOOST_REQUIRE_EQUAL(full->decode("0000000000000"), "a"); - } diff -r f8d0ea827db3 -r f9fa7ea71d37 TestFastBitDecoder.cpp --- a/TestFastBitDecoder.cpp Mon Sep 10 23:59:46 2012 +0200 +++ b/TestFastBitDecoder.cpp Thu Sep 13 23:08:07 2012 +0200 @@ -9,7 +9,7 @@ BitDecoder* up = new BitDecoder("a"); BitDecoder* down = new BitDecoder("b"); - BitDecoder* full = BitDecoder::merge(down, up); + std::auto_ptr full(BitDecoder::merge(down, up)); BOOST_REQUIRE(full->data().isNull()); BOOST_REQUIRE_EQUAL(up->data(), "a"); @@ -23,6 +23,7 @@ BOOST_REQUIRE_EQUAL(fast.decode("0000"), "bbbb"); BOOST_REQUIRE_EQUAL(fast.decode("1101"), "aaba"); BOOST_REQUIRE_EQUAL(fast.decode("1111"), "aaaa"); + } BOOST_AUTO_TEST_CASE( TestLong ) @@ -34,7 +35,7 @@ up = new BitDecoder(QString('c' + i)); } - BitDecoder* full = BitDecoder::merge(down, up); + std::auto_ptr full(BitDecoder::merge(down, up)); BOOST_REQUIRE(full->data().isNull());