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 6 #define BOOST_TEST_MODULE define_error 7 8 #include <boost/metaparse/define_error.hpp> 9 10 #include <boost/type_traits/is_same.hpp> 11 #include <boost/mpl/assert.hpp> 12 13 #include <boost/test/unit_test.hpp> 14 15 namespace 16 { 17 BOOST_METAPARSE_DEFINE_ERROR(test_error, "test error"); 18 } 19 BOOST_AUTO_TEST_CASE(test_define_error)20BOOST_AUTO_TEST_CASE(test_define_error) 21 { 22 using boost::is_same; 23 24 BOOST_MPL_ASSERT((is_same<test_error, test_error::type>)); 25 26 BOOST_CHECK_EQUAL("test error", test_error::get_value()); 27 } 28 29