test_doc_assert_fail.cxx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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_is_tuple.hpp>
  6. #include <boost/preprocessor/cat.hpp>
  7. #include <boost/preprocessor/comparison/greater.hpp>
  8. #include <boost/preprocessor/control/iif.hpp>
  9. #include <boost/preprocessor/tuple/size.hpp>
  10. #include <boost/detail/lightweight_test.hpp>
  11. int main()
  12. {
  13. #if BOOST_PP_VARIADICS
  14. #if BOOST_VMD_ASSERT_DATA
  15. #if BOOST_VMD_MSVC
  16. #define AMACRO(atuple) \
  17. BOOST_PP_CAT \
  18. ( \
  19. BOOST_VMD_ASSERT_IS_TUPLE(atuple), \
  20. BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) \
  21. )
  22. #else
  23. #define AMACRO(atuple) \
  24. BOOST_VMD_ASSERT_IS_TUPLE(atuple) \
  25. BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0)
  26. #endif
  27. BOOST_TEST(AMACRO(73));
  28. #else
  29. typedef char BOOST_VMD_DOC_ASSERT_FAIL_ERROR[-1];
  30. #endif
  31. #endif
  32. return boost::report_errors();
  33. }