diff --git a/ndnboost/detail/lightweight_test.hpp b/ndnboost/detail/lightweight_test.hpp
new file mode 100644
index 0000000..2b87b2e
--- /dev/null
+++ b/ndnboost/detail/lightweight_test.hpp
@@ -0,0 +1,208 @@
+#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
+#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+//  boost/detail/lightweight_test.hpp - lightweight test library
+//
+//  Copyright (c) 2002, 2009 Peter Dimov
+//  Copyright (2) Beman Dawes 2010, 2011
+//  Copyright (3) Ion Gaztanaga 2013
+//
+//  Distributed under the Boost Software License, Version 1.0.
+//  See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt
+//
+//    ---------------
+//
+//    If expression is false increases the error count 
+//    and outputs a message containing 'expression'
+//
+//  BOOST_TEST(expression)
+//
+//    ---------------
+//
+//    Increases error count and outputs a message containing 'message'
+//
+//  BOOST_ERROR(message)
+//
+//    ---------------
+//
+//    If 'expr1' != 'expr2' increases the error count 
+//    and outputs a message containing both expressions
+//
+//  BOOST_TEST_EQ(expr1, expr2)
+//
+//    ---------------
+//
+//    If 'expr1' == 'expr2' increases the error count 
+//    and outputs a message containing both expressions
+//
+//  BOOST_TEST_NE(expr1, expr2)
+//
+//    ---------------
+//
+//    If BOOST_NO_EXCEPTIONS is NOT defined and if 'expr' does not
+//    throw an exception of type 'excep', increases the error count
+//    and outputs a message containing the expression.
+//
+//    If BOOST_NO_EXCEPTIONS is defined, this macro expands to nothing
+//    and 'expr' is not evaluated.
+//
+//  BOOST_TEST_THROWS(expr, excep)
+//
+//    ---------------
+//
+//    Returns the error count
+//
+//  int ndnboost::report_errors()
+//
+
+#include <iostream>
+#include <ndnboost/current_function.hpp>
+#include <ndnboost/assert.hpp>
+#include <ndnboost/detail/no_exceptions_support.hpp>
+
+//  IDE's like Visual Studio perform better if output goes to std::cout or
+//  some other stream, so allow user to configure output stream:
+#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM
+# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr
+#endif
+
+namespace ndnboost
+{
+
+namespace detail
+{
+
+struct report_errors_reminder
+{
+  bool called_report_errors_function;
+  report_errors_reminder() : called_report_errors_function(false) {}
+ ~report_errors_reminder()
+  {
+    BOOST_ASSERT(called_report_errors_function);  // verify report_errors() was called  
+  }
+};
+
+inline report_errors_reminder& report_errors_remind()
+{
+  static report_errors_reminder r;
+  return r;
+}
+
+inline int & test_errors()
+{
+    static int x = 0;
+    report_errors_remind();
+    return x;
+}
+
+inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
+{
+    BOOST_LIGHTWEIGHT_TEST_OSTREAM
+      << file << "(" << line << "): test '" << expr << "' failed in function '"
+      << function << "'" << std::endl;
+    ++test_errors();
+}
+
+inline void error_impl(char const * msg, char const * file, int line, char const * function)
+{
+    BOOST_LIGHTWEIGHT_TEST_OSTREAM
+      << file << "(" << line << "): " << msg << " in function '"
+      << function << "'" << std::endl;
+    ++test_errors();
+}
+
+inline void throw_failed_impl(char const * excep, char const * file, int line, char const * function)
+{
+   BOOST_LIGHTWEIGHT_TEST_OSTREAM
+    << file << "(" << line << "): Exception '" << excep << "' not thrown in function '"
+    << function << "'" << std::endl;
+   ++test_errors();
+}
+
+template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2,
+  char const * file, int line, char const * function, T const & t, U const & u )
+{
+    if( t == u )
+    {
+    }
+    else
+    {
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+            << file << "(" << line << "): test '" << expr1 << " == " << expr2
+            << "' failed in function '" << function << "': "
+            << "'" << t << "' != '" << u << "'" << std::endl;
+        ++test_errors();
+    }
+}
+
+template<class T, class U> inline void test_ne_impl( char const * expr1, char const * expr2,
+  char const * file, int line, char const * function, T const & t, U const & u )
+{
+    if( t != u )
+    {
+    }
+    else
+    {
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+            << file << "(" << line << "): test '" << expr1 << " != " << expr2
+            << "' failed in function '" << function << "': "
+            << "'" << t << "' == '" << u << "'" << std::endl;
+        ++test_errors();
+    }
+}
+
+} // namespace detail
+
+inline int report_errors()
+{
+    detail::report_errors_remind().called_report_errors_function = true;
+
+    int errors = detail::test_errors();
+
+    if( errors == 0 )
+    {
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+          << "No errors detected." << std::endl;
+        return 0;
+    }
+    else
+    {
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+          << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
+        return 1;
+    }
+}
+
+} // namespace ndnboost
+
+#define BOOST_TEST(expr) ((expr)? (void)0: ::ndnboost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
+#define BOOST_ERROR(msg) ::ndnboost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
+#define BOOST_TEST_EQ(expr1,expr2) ( ::ndnboost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_NE(expr1,expr2) ( ::ndnboost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#ifndef BOOST_NO_EXCEPTIONS
+   #define BOOST_TEST_THROWS( EXPR, EXCEP )                    \
+      try {                                                    \
+         EXPR;                                                 \
+         ::ndnboost::detail::throw_failed_impl                    \
+         (#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
+      }                                                        \
+      catch(EXCEP const&) {                                    \
+      }                                                        \
+      catch(...) {                                             \
+         ::ndnboost::detail::throw_failed_impl                    \
+         (#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
+      }                                                        \
+   //
+#else
+   #define BOOST_TEST_THROWS( EXPR, EXCEP )
+#endif
+
+#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
