test_assert_fail_number2.cxx 825 B

12345678910111213141516171819202122232425262728293031
  1. // (C) Copyright Edward Diener 2011-2015
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #include <boost/vmd/assert.hpp>
  6. #include <boost/vmd/number2.hpp>
  7. #include <boost/detail/lightweight_test.hpp>
  8. #include <boost/preprocessor/comparison/equal.hpp>
  9. #include <boost/preprocessor/seq/elem.hpp>
  10. #include <boost/preprocessor/tuple/elem.hpp>
  11. int main()
  12. {
  13. #if BOOST_PP_VARIADICS
  14. #define A_SEQ (73 (split) clear)(red)(green 44)
  15. BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_NUMBER(BOOST_PP_SEQ_ELEM(0,A_SEQ))),72),BOOST_VMD_TEST_FAIL_NUMBER)
  16. #else
  17. typedef char BOOST_VMD_TEST_FAIL_NUMBER[-1];
  18. #endif
  19. return boost::report_errors();
  20. }