Mercurial > dedupe
diff TestBitDecoder.cpp @ 50:f9fa7ea71d37
Plug leaks in tests.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 13 Sep 2012 23:08:07 +0200 |
| parents | 41cc0d8ac77f |
| children |
line wrap: on
line diff
--- 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<BitDecoder> 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<BitDecoder> 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"); - }
