//#include "PacketImpl.test.ih"
// Custom includes
-#include "PacketImpl.hh"
-#include "PacketInterpreter.hh"
-#include "PacketType.hh"
+#include "Packets.hh"
#include "main.test.hh"
#include <boost/test/auto_unit_test.hpp>
BOOST_CHECK_EQUAL(p->refcount(), 0);
p->add_ref();
BOOST_CHECK_EQUAL(p->refcount(), 1);
+#ifndef NDEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::detail::PacketImpl>::allocCounter(), 1u);
+#endif
// From now on, the object should stay alive since I manually incremented the
// refcount ..
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<VoidPacket> >::allocCounter(), 1u);
+#endif
senf::PacketInterpreterBase::ptr pi2 (pi);
BOOST_CHECK_EQUAL(p->refcount(), 3);
}
p->truncateInterpreters(pi.get());
BOOST_CHECK_EQUAL(p->refcount(),1);
}
+#ifndef NDEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::PacketInterpreterBase>::allocCounter(), 0u);
+#endif
BOOST_CHECK_EQUAL(p->refcount(),1);
// Therefore we can safely delete the object.
BOOST_CHECK_EQUAL(p->refcount(), 1);
p->release();
+#ifndef NDEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::detail::PacketImpl>::allocCounter(), 0u);
+#endif
}
BOOST_AUTO_UNIT_TEST(packetImpl_data)
BOOST_CHECK_EQUAL(p->refcount(), 1);
p->release();
+#ifndef NDEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::detail::PacketImpl>::allocCounter(), 0u);
+#endif
}
///////////////////////////////cc.e////////////////////////////////////////
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
// End: