pointer_type_id_test.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright David Abrahams 2004. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/python/type_id.hpp>
  5. #include <boost/detail/lightweight_test.hpp>
  6. #include <boost/python/converter/pointer_type_id.hpp>
  7. int main()
  8. {
  9. using namespace boost::python::converter;
  10. boost::python::type_info x
  11. = boost::python::type_id<int>();
  12. BOOST_TEST(pointer_type_id<int*>() == x);
  13. BOOST_TEST(pointer_type_id<int const*>() == x);
  14. BOOST_TEST(pointer_type_id<int volatile*>() == x);
  15. BOOST_TEST(pointer_type_id<int const volatile*>() == x);
  16. BOOST_TEST(pointer_type_id<int*&>() == x);
  17. BOOST_TEST(pointer_type_id<int const*&>() == x);
  18. BOOST_TEST(pointer_type_id<int volatile*&>() == x);
  19. BOOST_TEST(pointer_type_id<int const volatile*&>() == x);
  20. BOOST_TEST(pointer_type_id<int*const&>() == x);
  21. BOOST_TEST(pointer_type_id<int const*const&>() == x);
  22. BOOST_TEST(pointer_type_id<int volatile*const&>() == x);
  23. BOOST_TEST(pointer_type_id<int const volatile*const&>() == x);
  24. BOOST_TEST(pointer_type_id<int*volatile&>() == x);
  25. BOOST_TEST(pointer_type_id<int const*volatile&>() == x);
  26. BOOST_TEST(pointer_type_id<int volatile*volatile&>() == x);
  27. BOOST_TEST(pointer_type_id<int const volatile*volatile&>() == x);
  28. BOOST_TEST(pointer_type_id<int*const volatile&>() == x);
  29. BOOST_TEST(pointer_type_id<int const*const volatile&>() == x);
  30. BOOST_TEST(pointer_type_id<int volatile*const volatile&>() == x);
  31. BOOST_TEST(pointer_type_id<int const volatile*const volatile&>() == x);
  32. return boost::report_errors();
  33. }