define_error.cpp 684 B

12345678910111213141516171819202122232425262728
  1. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2014.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #define BOOST_TEST_MODULE define_error
  6. #include <boost/metaparse/define_error.hpp>
  7. #include <boost/type_traits/is_same.hpp>
  8. #include <boost/mpl/assert.hpp>
  9. #include <boost/test/unit_test.hpp>
  10. namespace
  11. {
  12. BOOST_METAPARSE_DEFINE_ERROR(test_error, "test error");
  13. }
  14. BOOST_AUTO_TEST_CASE(test_define_error)
  15. {
  16. using boost::is_same;
  17. BOOST_MPL_ASSERT((is_same<test_error, test_error::type>));
  18. BOOST_CHECK_EQUAL("test error", test_error::get_value());
  19. }