X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketImpl.test.cc;h=8f6fe56f3002cd5a9daef176efc5018e23a52514;hb=ac86c2bb40746fbedf70a19af3307e5da642b04a;hp=83e5373c9bd4edd60eba7419870553029643cf98;hpb=f13c1275e48e97dceb7de7925793a4c69a5aeb61;p=senf.git diff --git a/Packets/PacketImpl.test.cc b/Packets/PacketImpl.test.cc index 83e5373..8f6fe56 100644 --- a/Packets/PacketImpl.test.cc +++ b/Packets/PacketImpl.test.cc @@ -25,9 +25,7 @@ //#include "PacketImpl.test.ih" // Custom includes -#include "PacketImpl.hh" -#include "PacketInterpreter.hh" -#include "PacketType.hh" +#include "Packets.hh" #include "main.test.hh" #include @@ -50,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 .. @@ -67,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); } @@ -80,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); @@ -89,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) @@ -193,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////////////////////////////////////////