diff --git a/test/select_from_python_test.cpp b/test/select_from_python_test.cpp new file mode 100644 index 00000000..7063767e --- /dev/null +++ b/test/select_from_python_test.cpp @@ -0,0 +1,148 @@ +#include +//#include +//#include +#include +#include + +int result; + +#define ASSERT_SAME(T1,T2) \ + if (!is_same< T1, T2 >::value) { \ + std::cout << "*********************\n"; \ + std::cout << type_id< T1 >() << " != " << type_id< T2 >() << "\n"; \ + std::cout << "*********************\n"; \ + result = 1; \ + } + +int main() +{ + using namespace boost::python::converter; + using namespace boost; + + + ASSERT_SAME( + select_from_python::type, rvalue_from_python + ); + + ASSERT_SAME( + select_from_python::type, rvalue_from_python + ); + + ASSERT_SAME( + select_from_python::type, rvalue_from_python + ); + + ASSERT_SAME( + select_from_python::type, rvalue_from_python + ); + + + + ASSERT_SAME( + select_from_python::type, pointer_from_python + ); + + ASSERT_SAME( + select_from_python::type, pointer_from_python + ); + + ASSERT_SAME( + select_from_python::type, pointer_from_python + ); + + ASSERT_SAME( + select_from_python::type, pointer_from_python + ); + + + + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, rvalue_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + + + ASSERT_SAME( + select_from_python::type, pointer_const_reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, pointer_const_reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, pointer_const_reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, pointer_const_reference_from_python + ); + + + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + + ASSERT_SAME( + select_from_python::type, reference_from_python + ); + return result; +}