X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketImpl.test.cc;h=8f6fe56f3002cd5a9daef176efc5018e23a52514;hb=ac86c2bb40746fbedf70a19af3307e5da642b04a;hp=e4e5bcbaec26fb716e282c2595bea0a59039edc7;hpb=2d6585ff852e9d282c17003ba1db0b73eb3a8500;p=senf.git diff --git a/Packets/PacketImpl.test.cc b/Packets/PacketImpl.test.cc index e4e5bcb..8f6fe56 100644 --- a/Packets/PacketImpl.test.cc +++ b/Packets/PacketImpl.test.cc @@ -48,8 +48,10 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) BOOST_CHECK_EQUAL(p->refcount(), 0); p->add_ref(); BOOST_CHECK_EQUAL(p->refcount(), 1); +#ifndef NDEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 1u); +#endif // From now on, the object should stay alive since I manually incremented the // refcount .. @@ -65,8 +67,10 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) p,p->begin(),p->end(), senf::PacketInterpreterBase::Append)); // Hmm ... this check works as long as sizeof(PacketInterpreterBase> != // sizeof(PacketImpl) ... !! +#ifndef NDEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin< senf::PacketInterpreter >::allocCounter(), 1u); +#endif senf::PacketInterpreterBase::ptr pi2 (pi); BOOST_CHECK_EQUAL(p->refcount(), 3); } @@ -78,8 +82,10 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) p->truncateInterpreters(pi.get()); BOOST_CHECK_EQUAL(p->refcount(),1); } +#ifndef NDEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 0u); +#endif BOOST_CHECK_EQUAL(p->refcount(),1); @@ -87,8 +93,10 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) // Therefore we can safely delete the object. BOOST_CHECK_EQUAL(p->refcount(), 1); p->release(); +#ifndef NDEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 0u); +#endif } BOOST_AUTO_UNIT_TEST(packetImpl_data) @@ -191,8 +199,10 @@ BOOST_AUTO_UNIT_TEST(packetImpl_interpreters) BOOST_CHECK_EQUAL(p->refcount(), 1); p->release(); +#ifndef NDEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 0u); +#endif } ///////////////////////////////cc.e////////////////////////////////////////