-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
+ \brief pool_alloc_mixin.test unit tests */
+
+//#include "pool_alloc_mixin.test.hh"
+//#include "pool_alloc_mixin.test.ih"
// Custom includes
+#include "pool_alloc_mixin.hh"
+#include <boost/scoped_ptr.hpp>
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
-{
- return reinterpret_cast<sockaddr *>(&addr_);
+namespace {
+ class Test : public senf::pool_alloc_mixin<Test>
+ {};
}
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
+BOOST_AUTO_UNIT_TEST(poolAllocMixin)
{
- return reinterpret_cast<sockaddr const *>(&addr_);
-}
+#ifndef NDEBUG
+ BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
-{
- return sizeof(addr_);
+ {
+ boost::scoped_ptr<Test> test (new Test());
+ BOOST_CHECK_EQUAL( Test::allocCounter(), 1u );
+ }
+
+ BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
+#endif
}
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// Local Variables:
// mode: c++
// fill-column: 100
+// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
-// comment-column: 40
// End: