From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../libs/python/test/indirect_traits_test.cpp | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 src/boost/libs/python/test/indirect_traits_test.cpp (limited to 'src/boost/libs/python/test/indirect_traits_test.cpp') diff --git a/src/boost/libs/python/test/indirect_traits_test.cpp b/src/boost/libs/python/test/indirect_traits_test.cpp new file mode 100644 index 000000000..da4cc2456 --- /dev/null +++ b/src/boost/libs/python/test/indirect_traits_test.cpp @@ -0,0 +1,116 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +//#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include +#include +#include +#include + +//#define print(expr) printf("%s ==> %s\n", #expr, expr) + +// not all the compilers can handle an incomplete class type here. +struct X {}; + +using namespace boost::python::indirect_traits; + +typedef void (X::*pmf)(); + +BOOST_MPL_ASSERT((is_reference_to_function)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function)); + +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); +BOOST_MPL_ASSERT((is_pointer_to_function)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); + +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT((is_reference_to_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT((is_reference_to_const)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); + +BOOST_MPL_ASSERT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); +BOOST_MPL_ASSERT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT((is_reference_to_volatile)); +BOOST_MPL_ASSERT((is_reference_to_volatile)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); + +namespace tt = boost::python::indirect_traits; + +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); + + +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); + +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); + +BOOST_MPL_ASSERT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT((tt::is_reference_to_class)); + +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); + +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); + +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_member_function_pointer)); + -- cgit v1.2.3