-// 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 SafeBool.test unit tests */
+
+//#include "SafeBool.test.hh"
+//#include "SafeBool.test.ih"
// Custom includes
+#include "SafeBool.hh"
-#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 {
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
-{
- return reinterpret_cast<sockaddr const *>(&addr_);
+ class TestTrue : public senf::SafeBool<TestTrue>
+ {
+ public:
+ bool boolean_test() const {
+ return true;
+ }
+ };
+
+ class TestFalse : public senf::SafeBool<TestFalse>
+ {
+ public:
+ bool boolean_test() const {
+ return false;
+ }
+ };
}
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
+BOOST_AUTO_UNIT_TEST(safeBool)
{
- return sizeof(addr_);
+ BOOST_CHECK( TestTrue() );
+ BOOST_CHECK( ! TestFalse() );
}
-///////////////////////////////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: