X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacketImpl.test.cc;h=a38d6a5f2741e578e869cabf78f54cdfc83435ae;hb=688f3266c15bd532194fe81e704c0a2cf320375a;hp=83e5373c9bd4edd60eba7419870553029643cf98;hpb=f13c1275e48e97dceb7de7925793a4c69a5aeb61;p=senf.git diff --git a/Packets/PacketImpl.test.cc b/Packets/PacketImpl.test.cc index 83e5373..a38d6a5 100644 --- a/Packets/PacketImpl.test.cc +++ b/Packets/PacketImpl.test.cc @@ -25,12 +25,10 @@ //#include "PacketImpl.test.ih" // Custom includes -#include "PacketImpl.hh" -#include "PacketInterpreter.hh" -#include "PacketType.hh" +#include "Packets.hh" #include "main.test.hh" -#include +#include "../Utils/auto_unit_test.hh" #include #define prefix_ @@ -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////////////////////////////////////////