From 1efa8a8319d385e80fca21d5307cfb7924a7b4bf Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 24 Oct 2002 10:18:05 +0000 Subject: [PATCH] Added new type traits tests. [SVN r15974] --- test/Jamfile | 628 ++++++++++++++++++++ test/add_const_test.cpp | 42 ++ test/add_pointer_test.cpp | 30 + test/add_reference_test.cpp | 42 ++ test/add_volatile_test.cpp | 42 ++ test/alignment_of_test.cpp | 60 ++ test/check_integral_constant.hpp | 63 ++ test/check_type.hpp | 34 ++ test/create_jamfile | 88 +++ test/function_traits_test.cpp | 57 ++ test/has_nothrow_assign_test.cpp | 149 +++++ test/has_nothrow_constructor_test.cpp | 149 +++++ test/has_nothrow_copy_test.cpp | 149 +++++ test/has_trivial_assign_test.cpp | 149 +++++ test/has_trivial_constructor_test.cpp | 155 +++++ test/has_trivial_copy_test.cpp | 155 +++++ test/has_trivial_destructor_test.cpp | 149 +++++ test/init.cpp | 16 + test/is_arithmetic_test.cpp | 139 +++++ test/is_array_test.cpp | 37 ++ test/is_base_and_derived_test.cpp | 26 + test/is_class_test.cpp | 40 ++ test/is_compound_test.cpp | 22 + test/is_const_test.cpp | 25 + test/is_convertible_test.cpp | 86 +++ test/is_empty_test.cpp | 39 ++ test/is_enum_test.cpp | 22 + test/is_float_test.cpp | 42 ++ test/is_function_test.cpp | 34 ++ test/is_fundamental_test.cpp | 143 +++++ test/is_integral_test.cpp | 125 ++++ test/is_member_function_pointer_test.cpp | 27 + test/is_member_pointer_test.cpp | 27 + test/is_object_test.cpp | 20 + test/is_pod_test.cpp | 150 +++++ test/is_pointer_test.cpp | 42 ++ test/is_reference_test.cpp | 30 + test/is_same_test.cpp | 25 + test/is_scalar_test.cpp | 145 +++++ test/is_union_test.cpp | 46 ++ test/is_void_test.cpp | 23 + test/is_volatile_test.cpp | 23 + test/remove_bounds_test.cpp | 42 ++ test/remove_const_test.cpp | 48 ++ test/remove_cv_test.cpp | 50 ++ test/remove_pointer_test.cpp | 42 ++ test/remove_reference_test.cpp | 42 ++ test/remove_volatile_test.cpp | 50 ++ test/test.hpp | 249 ++++++++ test/tricky_abstract_type_test.cpp | 61 ++ test/tricky_add_pointer_test.cpp | 29 + test/tricky_function_type_test.cpp | 147 +++++ test/tricky_incomplete_type_test.cpp | 55 ++ test/tricky_partial_specialization_test.cpp | 71 +++ test/type_with_alignment_test.cpp | 204 +++++++ tests/Jamfile | 36 -- tests/alignment_test.cpp | 51 -- tests/arithmetic_traits_test.cpp | 203 ------- tests/composite_traits_test.cpp | 158 ----- tests/cv_traits_test.cpp | 65 -- tests/function_traits_test.cpp | 60 -- tests/is_convertible_test.cpp | 112 ---- tests/is_function_test.cpp | 82 --- tests/is_same_test.cpp | 50 -- tests/object_type_traits_test.cpp | 318 ---------- tests/transform_traits_test.cpp | 482 --------------- 66 files changed, 4585 insertions(+), 1617 deletions(-) create mode 100644 test/Jamfile create mode 100644 test/add_const_test.cpp create mode 100644 test/add_pointer_test.cpp create mode 100644 test/add_reference_test.cpp create mode 100644 test/add_volatile_test.cpp create mode 100644 test/alignment_of_test.cpp create mode 100644 test/check_integral_constant.hpp create mode 100644 test/check_type.hpp create mode 100644 test/create_jamfile create mode 100644 test/function_traits_test.cpp create mode 100644 test/has_nothrow_assign_test.cpp create mode 100644 test/has_nothrow_constructor_test.cpp create mode 100644 test/has_nothrow_copy_test.cpp create mode 100644 test/has_trivial_assign_test.cpp create mode 100644 test/has_trivial_constructor_test.cpp create mode 100644 test/has_trivial_copy_test.cpp create mode 100644 test/has_trivial_destructor_test.cpp create mode 100644 test/init.cpp create mode 100644 test/is_arithmetic_test.cpp create mode 100644 test/is_array_test.cpp create mode 100644 test/is_base_and_derived_test.cpp create mode 100644 test/is_class_test.cpp create mode 100644 test/is_compound_test.cpp create mode 100644 test/is_const_test.cpp create mode 100644 test/is_convertible_test.cpp create mode 100644 test/is_empty_test.cpp create mode 100644 test/is_enum_test.cpp create mode 100644 test/is_float_test.cpp create mode 100644 test/is_function_test.cpp create mode 100644 test/is_fundamental_test.cpp create mode 100644 test/is_integral_test.cpp create mode 100644 test/is_member_function_pointer_test.cpp create mode 100644 test/is_member_pointer_test.cpp create mode 100644 test/is_object_test.cpp create mode 100644 test/is_pod_test.cpp create mode 100644 test/is_pointer_test.cpp create mode 100644 test/is_reference_test.cpp create mode 100644 test/is_same_test.cpp create mode 100644 test/is_scalar_test.cpp create mode 100644 test/is_union_test.cpp create mode 100644 test/is_void_test.cpp create mode 100644 test/is_volatile_test.cpp create mode 100644 test/remove_bounds_test.cpp create mode 100644 test/remove_const_test.cpp create mode 100644 test/remove_cv_test.cpp create mode 100644 test/remove_pointer_test.cpp create mode 100644 test/remove_reference_test.cpp create mode 100644 test/remove_volatile_test.cpp create mode 100644 test/test.hpp create mode 100644 test/tricky_abstract_type_test.cpp create mode 100644 test/tricky_add_pointer_test.cpp create mode 100644 test/tricky_function_type_test.cpp create mode 100644 test/tricky_incomplete_type_test.cpp create mode 100644 test/tricky_partial_specialization_test.cpp create mode 100644 test/type_with_alignment_test.cpp delete mode 100644 tests/Jamfile delete mode 100644 tests/alignment_test.cpp delete mode 100644 tests/arithmetic_traits_test.cpp delete mode 100644 tests/composite_traits_test.cpp delete mode 100644 tests/cv_traits_test.cpp delete mode 100644 tests/function_traits_test.cpp delete mode 100644 tests/is_convertible_test.cpp delete mode 100644 tests/is_function_test.cpp delete mode 100644 tests/is_same_test.cpp delete mode 100644 tests/object_type_traits_test.cpp delete mode 100644 tests/transform_traits_test.cpp diff --git a/test/Jamfile b/test/Jamfile new file mode 100644 index 0000000..1f01f4a --- /dev/null +++ b/test/Jamfile @@ -0,0 +1,628 @@ + +subproject libs/type_traits/test ; + +# bring in the rules for testing +SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; +include testing.jam ; + +{ + +local TYPE_TRAIT_PATH = "" ; +local TEST_LIB_PATH = "../../test/build/" ; + + + +test-suite type_traits : + + [ lib type_traits_init : $(TYPE_TRAIT_PATH)init.cpp + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)add_const_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)add_pointer_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)add_reference_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)add_volatile_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)alignment_of_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)function_traits_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_nothrow_assign_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_nothrow_constructor_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_nothrow_copy_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_trivial_assign_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_trivial_constructor_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_trivial_copy_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)has_trivial_destructor_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_arithmetic_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_array_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_base_and_derived_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_class_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_compound_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_const_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_convertible_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_empty_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_enum_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_float_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_function_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_fundamental_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_integral_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_member_function_pointer_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_member_pointer_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_object_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_pod_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_pointer_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_reference_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_same_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_scalar_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_union_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_void_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)is_volatile_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)remove_bounds_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)remove_const_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)remove_cv_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)remove_pointer_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)remove_reference_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)remove_volatile_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)tricky_abstract_type_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)tricky_add_pointer_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)tricky_function_type_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)tricky_incomplete_type_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)tricky_partial_specialization_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)type_with_alignment_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + ] + + + [ run $(TYPE_TRAIT_PATH)type_with_alignment_test.cpp $(TYPE_TRAIT_PATH)tricky_partial_specialization_test.cpp $(TYPE_TRAIT_PATH)tricky_incomplete_type_test.cpp $(TYPE_TRAIT_PATH)tricky_function_type_test.cpp $(TYPE_TRAIT_PATH)tricky_add_pointer_test.cpp $(TYPE_TRAIT_PATH)tricky_abstract_type_test.cpp $(TYPE_TRAIT_PATH)remove_volatile_test.cpp $(TYPE_TRAIT_PATH)remove_reference_test.cpp $(TYPE_TRAIT_PATH)remove_pointer_test.cpp $(TYPE_TRAIT_PATH)remove_cv_test.cpp $(TYPE_TRAIT_PATH)remove_const_test.cpp $(TYPE_TRAIT_PATH)remove_bounds_test.cpp $(TYPE_TRAIT_PATH)is_volatile_test.cpp $(TYPE_TRAIT_PATH)is_void_test.cpp $(TYPE_TRAIT_PATH)is_union_test.cpp $(TYPE_TRAIT_PATH)is_scalar_test.cpp $(TYPE_TRAIT_PATH)is_same_test.cpp $(TYPE_TRAIT_PATH)is_reference_test.cpp $(TYPE_TRAIT_PATH)is_pointer_test.cpp $(TYPE_TRAIT_PATH)is_pod_test.cpp $(TYPE_TRAIT_PATH)is_object_test.cpp $(TYPE_TRAIT_PATH)is_member_pointer_test.cpp $(TYPE_TRAIT_PATH)is_member_function_pointer_test.cpp $(TYPE_TRAIT_PATH)is_integral_test.cpp $(TYPE_TRAIT_PATH)is_fundamental_test.cpp $(TYPE_TRAIT_PATH)is_function_test.cpp $(TYPE_TRAIT_PATH)is_float_test.cpp $(TYPE_TRAIT_PATH)is_enum_test.cpp $(TYPE_TRAIT_PATH)is_empty_test.cpp $(TYPE_TRAIT_PATH)is_convertible_test.cpp $(TYPE_TRAIT_PATH)is_const_test.cpp $(TYPE_TRAIT_PATH)is_compound_test.cpp $(TYPE_TRAIT_PATH)is_class_test.cpp $(TYPE_TRAIT_PATH)is_base_and_derived_test.cpp $(TYPE_TRAIT_PATH)is_array_test.cpp $(TYPE_TRAIT_PATH)is_arithmetic_test.cpp $(TYPE_TRAIT_PATH)has_trivial_destructor_test.cpp $(TYPE_TRAIT_PATH)has_trivial_copy_test.cpp $(TYPE_TRAIT_PATH)has_trivial_constructor_test.cpp $(TYPE_TRAIT_PATH)has_trivial_assign_test.cpp $(TYPE_TRAIT_PATH)has_nothrow_copy_test.cpp $(TYPE_TRAIT_PATH)has_nothrow_constructor_test.cpp $(TYPE_TRAIT_PATH)has_nothrow_assign_test.cpp $(TYPE_TRAIT_PATH)function_traits_test.cpp $(TYPE_TRAIT_PATH)alignment_of_test.cpp $(TYPE_TRAIT_PATH)add_volatile_test.cpp $(TYPE_TRAIT_PATH)add_reference_test.cpp $(TYPE_TRAIT_PATH)add_pointer_test.cpp $(TYPE_TRAIT_PATH)add_const_test.cpp + $(TYPE_TRAIT_PATH)type_traits_init + $(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + $(BOOST_ROOT) + : + type_traits_tests + ] + +; + +} + + diff --git a/test/add_const_test.cpp b/test/add_const_test.cpp new file mode 100644 index 0000000..83e46a4 --- /dev/null +++ b/test/add_const_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(add_const) + +BOOST_DECL_TRANSFORM_TEST(add_const_test_1, ::boost::add_const, const, const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_2, ::boost::add_const, volatile, volatile const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_3, ::boost::add_const, *, *const) +BOOST_DECL_TRANSFORM_TEST2(add_const_test_4, ::boost::add_const, const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_7, ::boost::add_const, *volatile, *volatile const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_10, ::boost::add_const, const*, const*const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_11, ::boost::add_const, volatile*, volatile*const) +BOOST_DECL_TRANSFORM_TEST(add_const_test_5, ::boost::add_const, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_const_test_6, ::boost::add_const, &, &) +BOOST_DECL_TRANSFORM_TEST(add_const_test_8, ::boost::add_const, const [2], const [2]) +BOOST_DECL_TRANSFORM_TEST(add_const_test_9, ::boost::add_const, volatile &, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_const_test_12, ::boost::add_const, [2][3], const[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_const_test_13, ::boost::add_const, (&)[2], (&)[2]) + +TT_TEST_BEGIN(add_const) + + add_const_test_1(); + add_const_test_2(); + add_const_test_3(); + add_const_test_4(); + add_const_test_7(); + add_const_test_10(); + add_const_test_11(); + add_const_test_5(); + add_const_test_6(); + add_const_test_8(); + add_const_test_9(); + add_const_test_12(); + add_const_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/add_pointer_test.cpp b/test/add_pointer_test.cpp new file mode 100644 index 0000000..8c04258 --- /dev/null +++ b/test/add_pointer_test.cpp @@ -0,0 +1,30 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(add_pointer) + +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_1, ::boost::add_pointer, const, const*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_2, ::boost::add_pointer, volatile, volatile*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_3, ::boost::add_pointer, *, **) +BOOST_DECL_TRANSFORM_TEST2(add_pointer_test_4, ::boost::add_pointer, *) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_7, ::boost::add_pointer, *volatile, *volatile*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_10, ::boost::add_pointer, const*, const**) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_11, ::boost::add_pointer, volatile*, volatile**) + +TT_TEST_BEGIN(add_pointer) + + add_pointer_test_1(); + add_pointer_test_2(); + add_pointer_test_3(); + add_pointer_test_4(); + add_pointer_test_7(); + add_pointer_test_10(); + add_pointer_test_11(); + +TT_TEST_END + + + + + + diff --git a/test/add_reference_test.cpp b/test/add_reference_test.cpp new file mode 100644 index 0000000..0220e6f --- /dev/null +++ b/test/add_reference_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(add_reference) + +BOOST_DECL_TRANSFORM_TEST(add_reference_test_1, ::boost::add_reference, const, const&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_2, ::boost::add_reference, volatile, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_3, ::boost::add_reference, *, *&) +BOOST_DECL_TRANSFORM_TEST2(add_reference_test_4, ::boost::add_reference, &) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_5, ::boost::add_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_6, ::boost::add_reference, &, &) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_7, ::boost::add_reference, *volatile, *volatile&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_8, ::boost::add_reference, const [2], const (&)[2]) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_9, ::boost::add_reference, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_10, ::boost::add_reference, const*, const*&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_11, ::boost::add_reference, volatile*, volatile*&) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_12, ::boost::add_reference, const[2][3], const (&)[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_reference_test_13, ::boost::add_reference, (&)[2], (&)[2]) + +TT_TEST_BEGIN(add_reference) + + add_reference_test_1(); + add_reference_test_2(); + add_reference_test_3(); + add_reference_test_4(); + add_reference_test_5(); + add_reference_test_6(); + add_reference_test_7(); + add_reference_test_8(); + add_reference_test_9(); + add_reference_test_10(); + add_reference_test_11(); + add_reference_test_12(); + add_reference_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/add_volatile_test.cpp b/test/add_volatile_test.cpp new file mode 100644 index 0000000..2e69de5 --- /dev/null +++ b/test/add_volatile_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(add_volatile) + +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_1, ::boost::add_volatile, const, const volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_2, ::boost::add_volatile, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_3, ::boost::add_volatile, *, *volatile) +BOOST_DECL_TRANSFORM_TEST2(add_volatile_test_4, ::boost::add_volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_7, ::boost::add_volatile, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_10, ::boost::add_volatile, const*, const*volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_11, ::boost::add_volatile, volatile*, volatile*volatile) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_5, ::boost::add_volatile, const &, const&) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_6, ::boost::add_volatile, &, &) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_8, ::boost::add_volatile, const [2], const volatile [2]) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_9, ::boost::add_volatile, volatile &, volatile&) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_12, ::boost::add_volatile, [2][3], volatile[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_volatile_test_13, ::boost::add_volatile, (&)[2], (&)[2]) + +TT_TEST_BEGIN(add_volatile) + + add_volatile_test_1(); + add_volatile_test_2(); + add_volatile_test_3(); + add_volatile_test_4(); + add_volatile_test_7(); + add_volatile_test_10(); + add_volatile_test_11(); + add_volatile_test_5(); + add_volatile_test_6(); + add_volatile_test_8(); + add_volatile_test_9(); + add_volatile_test_12(); + add_volatile_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/alignment_of_test.cpp b/test/alignment_of_test.cpp new file mode 100644 index 0000000..2292ad7 --- /dev/null +++ b/test/alignment_of_test.cpp @@ -0,0 +1,60 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(alignment_of) + +// +// VC++ emits an awful lot of warnings unless we define these: +#ifdef BOOST_MSVC +# pragma warning(disable:4244) +#endif + + +template +struct align_calc +{ + char padding; + T instance; + static std::ptrdiff_t get() + { + static align_calc a; + return reinterpret_cast(&(a.instance)) - reinterpret_cast(&(a.padding)); + } +}; + +#define ALIGNOF(x) align_calc::get() + +TT_TEST_BEGIN(alignment_of) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(char)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(short)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(float)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(double)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long double)); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(long long)); +#endif +#ifdef BOOST_HAS_MS_INT64 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<__int64>::value, ALIGNOF(__int64)); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int[4])); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int(*)(int))); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(int*)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(VB)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(VD)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(enum_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(mf2)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(POD_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(empty_UDT)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(union_UDT)); + +TT_TEST_END + + + + + + diff --git a/test/check_integral_constant.hpp b/test/check_integral_constant.hpp new file mode 100644 index 0000000..c787d4b --- /dev/null +++ b/test/check_integral_constant.hpp @@ -0,0 +1,63 @@ + +#ifndef BOOST_CHECK_INTEGRAL_CONSTANT_HPP +#define BOOST_CHECK_INTEGRAL_CONSTANT_HPP + +#include + +namespace boost{ + namespace detail{ + + /* + macro: + BOOST_CHECK_INTEGRAL_CONSTANT(expression, expected_value) + + expression: an integral constant expression to check. + expected_value: the value expected. + */ + + template + struct integral_constant + { + static long value() { return test_value; } + }; + + template + bool tt_compare(T found, U expected) + { return static_cast(found) == expected; } + +#define BOOST_CHECK_INTEGRAL_CONSTANT(expression, expected_value)\ + if(!::boost::detail::tt_compare(::boost::detail::integral_constant<(expression)>::value(), expression)){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had differing values depending upon whether it was used as an integral constant expression or not");\ + }else{\ + BOOST_CHECK_MESSAGE(true, "Validating Integral Constant Expression: \"" << BOOST_STRINGIZE(expression) << "\"");\ + }\ + if(!::boost::detail::tt_compare(expression, expected_value))\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had an invalid value (found " << ::boost::detail::integral_constant<(expression)>::value() << ", expected " << expected_value << ")" ) + + /* + macro: + BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(expression, expected_value, alternate_value) + + expression: an integral constant expression to check. + expected_value: the value expected. + alternate_value: an alternative value that results is a warning not a failure if found. + */ + +#define BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(expression, expected_value, alternate_value)\ + if(!::boost::detail::tt_compare(::boost::detail::integral_constant<(expression)>::value(), expression)){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had differing values depending upon whether it was used as an integral constant expression or not");\ + }else{\ + BOOST_CHECK_MESSAGE(true, "Validating Integral Constant Expression: \"" << BOOST_STRINGIZE(expression) << "\"");\ + }\ + if(!::boost::detail::tt_compare(expression, expected_value))\ + if(!::boost::detail::tt_compare(expression, alternate_value))\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had an invalid value (found " << ::boost::detail::integral_constant<(expression)>::value() << ", expected " << expected_value << ")" );\ + else\ + BOOST_WARN_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" did not have the value we wish it to have (found " << ::boost::detail::integral_constant<(expression)>::value() << ", expected " << expected_value << ")" ) + + + }//detail +}//boost + + +#endif \ No newline at end of file diff --git a/test/check_type.hpp b/test/check_type.hpp new file mode 100644 index 0000000..9874826 --- /dev/null +++ b/test/check_type.hpp @@ -0,0 +1,34 @@ + +#ifndef BOOST_CHECK_TYPE_HPP +#define BOOST_CHECK_TYPE_HPP + +#include +#include + +/* +macro: +BOOST_CHECK_TYPE(type_expression, expected_type) + +type_expression: an expression that evaluates to a typename. +expected_value: the type we expect to find. +*/ + +#ifdef __BORLANDC__ +#pragma option -w-8008 -w-8066 -w-8019 +#endif + + +#define BOOST_CHECK_TYPE(type_expression, expected_type)\ +do{\ + if(!::boost::is_same::value){\ + BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\ + << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\ + << BOOST_STRINGIZE(type_expression) << ", " << BOOST_STRINGIZE(expected_type)\ + << ">" << "\n\tfound: "\ + << typeid(::boost::is_same).name());\ + }else\ + BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\ + << BOOST_STRINGIZE(expression) << "\"");\ +}while(0) + +#endif diff --git a/test/create_jamfile b/test/create_jamfile new file mode 100644 index 0000000..0a60b02 --- /dev/null +++ b/test/create_jamfile @@ -0,0 +1,88 @@ +#!/bin/sh + +# +# shell script to create a Jamfile for all the tests: +# + +all_source="" + +#start Jamfile: +cat > Jamfile << EOF + +subproject libs/type_traits/test ; + +# bring in the rules for testing +SEARCH on testing.jam = \$(BOOST_BUILD_PATH) ; +include testing.jam ; + +{ + +local TYPE_TRAIT_PATH = "" ; +local TEST_LIB_PATH = "../../test/build/" ; + + +EOF + +for file in *.cpp ; do + if [ $file != init.cpp ] ; then + if [ $file != template.cpp ] ; then + + if [ a"$all_source" != "a" ] ; then + all_source="\$(TYPE_TRAIT_PATH)$file $all_source" + else + all_source="\$(TYPE_TRAIT_PATH)$file" + fi + + cat >> Jamfile_temp << EOF + + [ run \$(TYPE_TRAIT_PATH)$file + \$(TYPE_TRAIT_PATH)type_traits_init + \$(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + \$(BOOST_ROOT) + : + ] + +EOF + fi + fi +done + +# finish off Jamfile: + +cat >> Jamfile << EOF + +test-suite type_traits : + + [ lib type_traits_init : \$(TYPE_TRAIT_PATH)init.cpp + : + \$(BOOST_ROOT) + : + ] + + $(cat Jamfile_temp) + + [ run $all_source + \$(TYPE_TRAIT_PATH)type_traits_init + \$(TEST_LIB_PATH)unit_test_framework + : + --report_level=detailed --build_info=yes --log_level=messages + : + : + \$(BOOST_ROOT) + : + type_traits_tests + ] + +; + +} + +EOF + +rm Jamfile_temp + + diff --git a/test/function_traits_test.cpp b/test/function_traits_test.cpp new file mode 100644 index 0000000..89680c0 --- /dev/null +++ b/test/function_traits_test.cpp @@ -0,0 +1,57 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(function_traits) + +typedef void(pf_zero1)(); +typedef int(pf_zero2)(); +typedef const int& (pf_zero3)(); +typedef void(pf_one1)(int); +typedef int(pf_one2)(int); +typedef const int&(pf_one3)(const int&); +typedef void(pf_two1)(int,int); +typedef int(pf_two2)(int,int); +typedef const int&(pf_two3)(const int&,const int&); + + +TT_TEST_BEGIN(function_traits) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 0); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 1); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 1); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 1); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 2); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 2); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits::arity, 2); + +BOOST_CHECK_TYPE(void, ::tt::function_traits::result_type); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, const int&); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, void); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, const int&); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, void); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::result_type, const int&); + +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, const int&); + +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg1_type, const int&); +BOOST_CHECK_TYPE(::tt::function_traits::arg2_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg2_type, int); +BOOST_CHECK_TYPE(::tt::function_traits::arg2_type, const int&); + +TT_TEST_END + + + + + + diff --git a/test/has_nothrow_assign_test.cpp b/test/has_nothrow_assign_test.cpp new file mode 100644 index 0000000..a2ca055 --- /dev/null +++ b/test/has_nothrow_assign_test.cpp @@ -0,0 +1,149 @@ +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_nothrow_assign) + +TT_TEST_BEGIN(has_nothrow_assign) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 const volatile>::value, false); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); + +TT_TEST_END + diff --git a/test/has_nothrow_constructor_test.cpp b/test/has_nothrow_constructor_test.cpp new file mode 100644 index 0000000..5b6a20f --- /dev/null +++ b/test/has_nothrow_constructor_test.cpp @@ -0,0 +1,149 @@ +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_nothrow_constructor) + +TT_TEST_BEGIN(has_nothrow_constructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); + +TT_TEST_END + diff --git a/test/has_nothrow_copy_test.cpp b/test/has_nothrow_copy_test.cpp new file mode 100644 index 0000000..22eecc5 --- /dev/null +++ b/test/has_nothrow_copy_test.cpp @@ -0,0 +1,149 @@ +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_nothrow_copy) + +TT_TEST_BEGIN(has_nothrow_copy) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 const volatile>::value, false); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); + +TT_TEST_END + diff --git a/test/has_trivial_assign_test.cpp b/test/has_trivial_assign_test.cpp new file mode 100644 index 0000000..5e49e22 --- /dev/null +++ b/test/has_trivial_assign_test.cpp @@ -0,0 +1,149 @@ +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_trivial_assign) + +TT_TEST_BEGIN(has_trivial_assign) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 const>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 const volatile>::value, false); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); + +TT_TEST_END + diff --git a/test/has_trivial_constructor_test.cpp b/test/has_trivial_constructor_test.cpp new file mode 100644 index 0000000..e98811b --- /dev/null +++ b/test/has_trivial_constructor_test.cpp @@ -0,0 +1,155 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_trivial_constructor) + +TT_TEST_BEGIN(has_trivial_constructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); + +TT_TEST_END + + + + + + diff --git a/test/has_trivial_copy_test.cpp b/test/has_trivial_copy_test.cpp new file mode 100644 index 0000000..ee29084 --- /dev/null +++ b/test/has_trivial_copy_test.cpp @@ -0,0 +1,155 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_trivial_copy) + +TT_TEST_BEGIN(has_trivial_copy) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 const volatile>::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 volatile>::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 const volatile>::value, false); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); + +TT_TEST_END + + + + + + diff --git a/test/has_trivial_destructor_test.cpp b/test/has_trivial_destructor_test.cpp new file mode 100644 index 0000000..bb28f0e --- /dev/null +++ b/test/has_trivial_destructor_test.cpp @@ -0,0 +1,149 @@ +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(has_trivial_destructor) + +TT_TEST_BEGIN(has_trivial_destructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); + +TT_TEST_END + diff --git a/test/init.cpp b/test/init.cpp new file mode 100644 index 0000000..31f99d5 --- /dev/null +++ b/test/init.cpp @@ -0,0 +1,16 @@ + +#include "test.hpp" + +boost::unit_test_framework::test_suite* get_master_unit(const char* name) +{ + static boost::unit_test_framework::test_suite* ptest_suite = 0; + if(0 == ptest_suite) + ptest_suite = BOOST_TEST_SUITE( name ? name : "" ); + return ptest_suite; +} + +boost::unit_test_framework::test_suite* init_unit_test_suite ( int , char* [] ) +{ + return get_master_unit(); +} + diff --git a/test/is_arithmetic_test.cpp b/test/is_arithmetic_test.cpp new file mode 100644 index 0000000..bb21d76 --- /dev/null +++ b/test/is_arithmetic_test.cpp @@ -0,0 +1,139 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_arithmetic) + +TT_TEST_BEGIN(is_arithmetic) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); + +// +// cases that should not be true: +// +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_array_test.cpp b/test/is_array_test.cpp new file mode 100644 index 0000000..9653380 --- /dev/null +++ b/test/is_array_test.cpp @@ -0,0 +1,37 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_array) + +struct convertible_to_pointer +{ + operator char*() const; +}; + +TT_TEST_BEGIN(is_array) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_base_and_derived_test.cpp b/test/is_base_and_derived_test.cpp new file mode 100644 index 0000000..817fc56 --- /dev/null +++ b/test/is_base_and_derived_test.cpp @@ -0,0 +1,26 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_base_and_derived) + +TT_TEST_BEGIN(is_base_and_derived) + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); + +TT_TEST_END + + + + + + diff --git a/test/is_class_test.cpp b/test/is_class_test.cpp new file mode 100644 index 0000000..4ab95af --- /dev/null +++ b/test/is_class_test.cpp @@ -0,0 +1,40 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_class) + +TT_TEST_BEGIN(is_class) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_compound_test.cpp b/test/is_compound_test.cpp new file mode 100644 index 0000000..d3e5572 --- /dev/null +++ b/test/is_compound_test.cpp @@ -0,0 +1,22 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_compound) + +TT_TEST_BEGIN(is_compound) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +//#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, true); +//#endif + +TT_TEST_END + + + + + + diff --git a/test/is_const_test.cpp b/test/is_const_test.cpp new file mode 100644 index 0000000..815bc50 --- /dev/null +++ b/test/is_const_test.cpp @@ -0,0 +1,25 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_const) + +TT_TEST_BEGIN(is_const) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_convertible_test.cpp b/test/is_convertible_test.cpp new file mode 100644 index 0000000..308f6e6 --- /dev/null +++ b/test/is_convertible_test.cpp @@ -0,0 +1,86 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_COMPARE(is_convertible) + +template +struct convertible_from +{ + convertible_from(T); +}; + +TT_TEST_BEGIN(is_convertible) + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); + +// The following four do not compile without member template support: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); + +// +// the following tests all involve user defined conversions which do +// not compile with Borland C++ Builder: +// +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), false); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible >::value), true); + +TT_TEST_END + + + + + + diff --git a/test/is_empty_test.cpp b/test/is_empty_test.cpp new file mode 100644 index 0000000..7ebc97e --- /dev/null +++ b/test/is_empty_test.cpp @@ -0,0 +1,39 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_empty) + +struct non_default_constructable_UDT +{ + non_default_constructable_UDT(const non_default_constructable_UDT&){} +private: + non_default_constructable_UDT(){} +}; + +TT_TEST_BEGIN(is_empty) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_enum_test.cpp b/test/is_enum_test.cpp new file mode 100644 index 0000000..a6c9bd0 --- /dev/null +++ b/test/is_enum_test.cpp @@ -0,0 +1,22 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_enum) + +TT_TEST_BEGIN(is_enum) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_float_test.cpp b/test/is_float_test.cpp new file mode 100644 index 0000000..f22a96a --- /dev/null +++ b/test/is_float_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_float) + +TT_TEST_BEGIN(is_float) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, true); + +// +// cases that should not be true: +// +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_function_test.cpp b/test/is_function_test.cpp new file mode 100644 index 0000000..e1de474 --- /dev/null +++ b/test/is_function_test.cpp @@ -0,0 +1,34 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_function) + +TT_TEST_BEGIN(is_function) + +typedef void foo0_t(); +typedef void foo1_t(int); +typedef void foo2_t(int&, double); +typedef void foo3_t(int&, bool, int, int); +typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); + + +TT_TEST_END + + + + + + diff --git a/test/is_fundamental_test.cpp b/test/is_fundamental_test.cpp new file mode 100644 index 0000000..90ec802 --- /dev/null +++ b/test/is_fundamental_test.cpp @@ -0,0 +1,143 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_fundamental) + +TT_TEST_BEGIN(is_fundamental) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); + +// +// cases that should not be true: +// +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_integral_test.cpp b/test/is_integral_test.cpp new file mode 100644 index 0000000..39d12b7 --- /dev/null +++ b/test/is_integral_test.cpp @@ -0,0 +1,125 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_integral) + +TT_TEST_BEGIN(is_integral) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 const volatile>::value, true); + +#endif + +// +// cases that should not be true: +// +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_member_function_pointer_test.cpp b/test/is_member_function_pointer_test.cpp new file mode 100644 index 0000000..e7f57f4 --- /dev/null +++ b/test/is_member_function_pointer_test.cpp @@ -0,0 +1,27 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_member_function_pointer) + +TT_TEST_BEGIN(is_member_function_pointer) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_member_pointer_test.cpp b/test/is_member_pointer_test.cpp new file mode 100644 index 0000000..fcc8514 --- /dev/null +++ b/test/is_member_pointer_test.cpp @@ -0,0 +1,27 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_member_pointer) + +TT_TEST_BEGIN(is_member_pointer) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_object_test.cpp b/test/is_object_test.cpp new file mode 100644 index 0000000..8f37338 --- /dev/null +++ b/test/is_object_test.cpp @@ -0,0 +1,20 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_object) + +TT_TEST_BEGIN(is_object) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); + + +TT_TEST_END + + + + + + diff --git a/test/is_pod_test.cpp b/test/is_pod_test.cpp new file mode 100644 index 0000000..35db1b2 --- /dev/null +++ b/test/is_pod_test.cpp @@ -0,0 +1,150 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_pod) + +TT_TEST_BEGIN(is_pod) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, true); + +TT_TEST_END + + + + + + diff --git a/test/is_pointer_test.cpp b/test/is_pointer_test.cpp new file mode 100644 index 0000000..bd06353 --- /dev/null +++ b/test/is_pointer_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_pointer) + +TT_TEST_BEGIN(is_pointer) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); + // these were false in previous versions (JM 20 Dec 2000): +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); + // JM 02 Oct 2000: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); + // Steve: was 'true', should be 'false', via 3.9.2p3 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_reference_test.cpp b/test/is_reference_test.cpp new file mode 100644 index 0000000..928bde8 --- /dev/null +++ b/test/is_reference_test.cpp @@ -0,0 +1,30 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_reference) + +TT_TEST_BEGIN(is_reference) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_same_test.cpp b/test/is_same_test.cpp new file mode 100644 index 0000000..b56a77b --- /dev/null +++ b/test/is_same_test.cpp @@ -0,0 +1,25 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_COMPARE(is_same) + +TT_TEST_BEGIN(is_same) + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); + +TT_TEST_END + + + + + + diff --git a/test/is_scalar_test.cpp b/test/is_scalar_test.cpp new file mode 100644 index 0000000..534b779 --- /dev/null +++ b/test/is_scalar_test.cpp @@ -0,0 +1,145 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_scalar) + +TT_TEST_BEGIN(is_scalar) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_union_test.cpp b/test/is_union_test.cpp new file mode 100644 index 0000000..0ee1526 --- /dev/null +++ b/test/is_union_test.cpp @@ -0,0 +1,46 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_union) + +TT_TEST_BEGIN(is_union) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); + +TT_TEST_END + + + + + + + diff --git a/test/is_void_test.cpp b/test/is_void_test.cpp new file mode 100644 index 0000000..7c40c64 --- /dev/null +++ b/test/is_void_test.cpp @@ -0,0 +1,23 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_void) + +TT_TEST_BEGIN(is_void) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::boost::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::boost::is_void::value, false); + +TT_TEST_END + + + + + + diff --git a/test/is_volatile_test.cpp b/test/is_volatile_test.cpp new file mode 100644 index 0000000..4444673 --- /dev/null +++ b/test/is_volatile_test.cpp @@ -0,0 +1,23 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_volatile) + +TT_TEST_BEGIN(is_volatile) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile::value, true); + +TT_TEST_END + + + + + + diff --git a/test/remove_bounds_test.cpp b/test/remove_bounds_test.cpp new file mode 100644 index 0000000..e94f419 --- /dev/null +++ b/test/remove_bounds_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(remove_bounds) + +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_1, ::boost::remove_bounds, const, const) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_2, ::boost::remove_bounds, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST3(remove_bounds_test_3, ::boost::remove_bounds, [2]) +BOOST_DECL_TRANSFORM_TEST0(remove_bounds_test_4, ::boost::remove_bounds) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_5, ::boost::remove_bounds, const &, const&) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_6, ::boost::remove_bounds, *, *) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_7, ::boost::remove_bounds, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_8, ::boost::remove_bounds, const [2], const) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_9, ::boost::remove_bounds, const &, const&) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_10, ::boost::remove_bounds, const*, const*) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_11, ::boost::remove_bounds, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_12, ::boost::remove_bounds, const[2][3], const[3]) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_13, ::boost::remove_bounds, (&)[2], (&)[2]) + +TT_TEST_BEGIN(remove_bounds) + + remove_bounds_test_1(); + remove_bounds_test_2(); + remove_bounds_test_3(); + remove_bounds_test_4(); + remove_bounds_test_5(); + remove_bounds_test_6(); + remove_bounds_test_7(); + remove_bounds_test_8(); + remove_bounds_test_9(); + remove_bounds_test_10(); + remove_bounds_test_11(); + remove_bounds_test_12(); + remove_bounds_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/remove_const_test.cpp b/test/remove_const_test.cpp new file mode 100644 index 0000000..9afe996 --- /dev/null +++ b/test/remove_const_test.cpp @@ -0,0 +1,48 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(remove_const) + +BOOST_DECL_TRANSFORM_TEST3(remove_const_test_1, ::boost::remove_const, const) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_2, ::boost::remove_const, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_3, ::boost::remove_const, const volatile, volatile) +BOOST_DECL_TRANSFORM_TEST0(remove_const_test_4, ::boost::remove_const) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_6, ::boost::remove_const, *const, *) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_7, ::boost::remove_const, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_8, ::boost::remove_const, *const volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_9, ::boost::remove_const, *, *) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_11, ::boost::remove_const, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_12, ::boost::remove_const, const[2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_13, ::boost::remove_const, volatile[2], volatile[2]) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_14, ::boost::remove_const, const volatile[2], volatile[2]) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_15, ::boost::remove_const, [2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_16, ::boost::remove_const, const*, const*) +BOOST_DECL_TRANSFORM_TEST(remove_const_test_17, ::boost::remove_const, const*const, const*) + +TT_TEST_BEGIN(remove_const) + +BOOST_CHECK_TYPE(int, int); + + remove_const_test_1(); + remove_const_test_2(); + remove_const_test_3(); + remove_const_test_4(); + remove_const_test_6(); + remove_const_test_7(); + remove_const_test_8(); + remove_const_test_9(); + remove_const_test_11(); + remove_const_test_12(); + remove_const_test_13(); + remove_const_test_14(); + remove_const_test_15(); + remove_const_test_16(); + remove_const_test_17(); + +TT_TEST_END + + + + + + diff --git a/test/remove_cv_test.cpp b/test/remove_cv_test.cpp new file mode 100644 index 0000000..5c35ea4 --- /dev/null +++ b/test/remove_cv_test.cpp @@ -0,0 +1,50 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(remove_cv) + +BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_1, ::boost::remove_cv, const) +BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_2, ::boost::remove_cv, volatile) +BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_3, ::boost::remove_cv, const volatile) +BOOST_DECL_TRANSFORM_TEST0(remove_cv_test_4, ::boost::remove_cv) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_5, ::boost::remove_cv, const &, const&) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_6, ::boost::remove_cv, *const, *) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_7, ::boost::remove_cv, *volatile, *) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_8, ::boost::remove_cv, *const volatile, *) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_9, ::boost::remove_cv, *, *) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_10, ::boost::remove_cv, const*, const*) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_11, ::boost::remove_cv, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_12, ::boost::remove_cv, const[2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_13, ::boost::remove_cv, volatile[2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_14, ::boost::remove_cv, const volatile[2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_15, ::boost::remove_cv, [2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_16, ::boost::remove_cv, const*, const*) +BOOST_DECL_TRANSFORM_TEST(remove_cv_test_17, ::boost::remove_cv, const*volatile, const*) + +TT_TEST_BEGIN(remove_cv) + + remove_cv_test_1(); + remove_cv_test_2(); + remove_cv_test_3(); + remove_cv_test_4(); + remove_cv_test_5(); + remove_cv_test_6(); + remove_cv_test_7(); + remove_cv_test_8(); + remove_cv_test_9(); + remove_cv_test_10(); + remove_cv_test_11(); + remove_cv_test_12(); + remove_cv_test_13(); + remove_cv_test_14(); + remove_cv_test_15(); + remove_cv_test_16(); + remove_cv_test_17(); + +TT_TEST_END + + + + + + diff --git a/test/remove_pointer_test.cpp b/test/remove_pointer_test.cpp new file mode 100644 index 0000000..ed58b0e --- /dev/null +++ b/test/remove_pointer_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(remove_pointer) + +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_1, ::boost::remove_pointer, const, const) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_2, ::boost::remove_pointer, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_3, ::boost::remove_pointer, *) +BOOST_DECL_TRANSFORM_TEST0(remove_pointer_test_4, ::boost::remove_pointer) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_5, ::boost::remove_pointer, const &, const&) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_6, ::boost::remove_pointer, &, &) +BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_7, ::boost::remove_pointer, *volatile) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_8, ::boost::remove_pointer, const [2], const[2]) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_9, ::boost::remove_pointer, const &, const&) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_10, ::boost::remove_pointer, const*, const) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_11, ::boost::remove_pointer, volatile*, volatile) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_12, ::boost::remove_pointer, const[2][3], const[2][3]) +BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_13, ::boost::remove_pointer, (&)[2], (&)[2]) + +TT_TEST_BEGIN(remove_pointer) + + remove_pointer_test_1(); + remove_pointer_test_2(); + remove_pointer_test_3(); + remove_pointer_test_4(); + remove_pointer_test_5(); + remove_pointer_test_6(); + remove_pointer_test_7(); + remove_pointer_test_8(); + remove_pointer_test_9(); + remove_pointer_test_10(); + remove_pointer_test_11(); + remove_pointer_test_12(); + remove_pointer_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/remove_reference_test.cpp b/test/remove_reference_test.cpp new file mode 100644 index 0000000..46cfc15 --- /dev/null +++ b/test/remove_reference_test.cpp @@ -0,0 +1,42 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(remove_reference) + +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_1, ::boost::remove_reference, const, const) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_2, ::boost::remove_reference, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_3, ::boost::remove_reference, &) +BOOST_DECL_TRANSFORM_TEST0(remove_reference_test_4, ::boost::remove_reference) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_5, ::boost::remove_reference, const &, const) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_6, ::boost::remove_reference, *, *) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_7, ::boost::remove_reference, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_8, ::boost::remove_reference, &) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_9, ::boost::remove_reference, const &, const) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_10, ::boost::remove_reference, const*, const*) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_11, ::boost::remove_reference, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_12, ::boost::remove_reference, const[2], const[2]) +BOOST_DECL_TRANSFORM_TEST(remove_reference_test_13, ::boost::remove_reference, (&)[2], [2]) + +TT_TEST_BEGIN(remove_reference) + + remove_reference_test_1(); + remove_reference_test_2(); + remove_reference_test_3(); + remove_reference_test_4(); + remove_reference_test_5(); + remove_reference_test_6(); + remove_reference_test_7(); + remove_reference_test_8(); + remove_reference_test_9(); + remove_reference_test_10(); + remove_reference_test_11(); + remove_reference_test_12(); + remove_reference_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/remove_volatile_test.cpp b/test/remove_volatile_test.cpp new file mode 100644 index 0000000..5a7746b --- /dev/null +++ b/test/remove_volatile_test.cpp @@ -0,0 +1,50 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(remove_volatile) + +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_1, ::boost::remove_volatile, const, const) +BOOST_DECL_TRANSFORM_TEST3(remove_volatile_test_2, ::boost::remove_volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_3, ::boost::remove_volatile, const volatile, const) +BOOST_DECL_TRANSFORM_TEST0(remove_volatile_test_4, ::boost::remove_volatile) +BOOST_DECL_TRANSFORM_TEST0(remove_volatile_test_5, ::boost::remove_volatile) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_6, ::boost::remove_volatile, *const, *const) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_7, ::boost::remove_volatile, *volatile, *) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_8, ::boost::remove_volatile, *const volatile, *const) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_9, ::boost::remove_volatile, *, *) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_10, ::boost::remove_volatile, *, *) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_11, ::boost::remove_volatile, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_12, ::boost::remove_volatile, const[2], const[2]) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_13, ::boost::remove_volatile, volatile[2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_14, ::boost::remove_volatile, const volatile[2], const[2]) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_15, ::boost::remove_volatile, [2], [2]) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_16, ::boost::remove_volatile, const*, const*) +BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_17, ::boost::remove_volatile, const*volatile, const*) + +TT_TEST_BEGIN(remove_volatile) + + remove_volatile_test_1(); + remove_volatile_test_2(); + remove_volatile_test_3(); + remove_volatile_test_4(); + remove_volatile_test_5(); + remove_volatile_test_6(); + remove_volatile_test_7(); + remove_volatile_test_8(); + remove_volatile_test_9(); + remove_volatile_test_10(); + remove_volatile_test_11(); + remove_volatile_test_12(); + remove_volatile_test_13(); + remove_volatile_test_14(); + remove_volatile_test_15(); + remove_volatile_test_16(); + remove_volatile_test_17(); + +TT_TEST_END + + + + + + diff --git a/test/test.hpp b/test/test.hpp new file mode 100644 index 0000000..d2fd27f --- /dev/null +++ b/test/test.hpp @@ -0,0 +1,249 @@ + +#ifndef TT_TEST_HPP +#define TT_TEST_HPP + +#include + +// +// basic configuration: +// +#ifdef TEST_STD + +#define tt std + +#define TYPE_TRAITS(x) +#define TYPE_COMPARE(x) +#define TYPE_TRANSFORM(x) + +#else + +#define tt boost + +#define TYPE_TRAITS(x) BOOST_STRINGIZE(boost/type_traits/x.hpp) +#define TYPE_COMPARE(x) BOOST_STRINGIZE(boost/type_traits/x.hpp) +#define TYPE_TRANSFORM(x) BOOST_STRINGIZE(boost/type_traits/x.hpp) + +#endif + +// +// global unit, this is not safe, but until the unit test framework uses +// shared_ptr throughout this is about as good as it gets :-( +// +boost::unit_test_framework::test_suite* get_master_unit(const char* name = 0); + +// +// initialisation class: +// +class unit_initialiser +{ +public: + unit_initialiser(void (*f)(), const char* name) + { + get_master_unit("Type Traits")->add( ::boost::unit_test_framework::create_test_case(f, name) ); + } +}; + +#define TT_TEST_BEGIN(trait_name)\ + namespace{\ + void trait_name();\ + unit_initialiser init(trait_name, BOOST_STRINGIZE(trait_name));\ + void trait_name(){ + +#define TT_TEST_END }} + +#define TRANSFORM_CHECK(name, from_suffix, to_suffix)\ + BOOST_CHECK_TYPE(bool to_suffix, name::type);\ + BOOST_CHECK_TYPE(char to_suffix, name::type);\ + BOOST_CHECK_TYPE(wchar_t to_suffix, name::type);\ + BOOST_CHECK_TYPE(signed char to_suffix, name::type);\ + BOOST_CHECK_TYPE(unsigned char to_suffix, name::type);\ + BOOST_CHECK_TYPE(short to_suffix, name::type);\ + BOOST_CHECK_TYPE(unsigned short to_suffix, name::type);\ + BOOST_CHECK_TYPE(int to_suffix, name::type);\ + BOOST_CHECK_TYPE(unsigned int to_suffix, name::type);\ + BOOST_CHECK_TYPE(long to_suffix, name::type);\ + BOOST_CHECK_TYPE(unsigned long to_suffix, name::type);\ + BOOST_CHECK_TYPE(float to_suffix, name::type);\ + BOOST_CHECK_TYPE(long double to_suffix, name::type);\ + BOOST_CHECK_TYPE(double to_suffix, name::type);\ + BOOST_CHECK_TYPE(UDT to_suffix, name::type);\ + BOOST_CHECK_TYPE(enum1 to_suffix, name::type); + +#define BOOST_DUMMY_MACRO_PARAM /**/ + +#define BOOST_DECL_TRANSFORM_TEST(name, type, from, to)\ +void name(){ TRANSFORM_CHECK(type, from, to) } +#define BOOST_DECL_TRANSFORM_TEST3(name, type, from)\ +void name(){ TRANSFORM_CHECK(type, from, BOOST_DUMMY_MACRO_PARAM) } +#define BOOST_DECL_TRANSFORM_TEST2(name, type, to)\ +void name(){ TRANSFORM_CHECK(type, BOOST_DUMMY_MACRO_PARAM, to) } +#define BOOST_DECL_TRANSFORM_TEST0(name, type)\ +void name(){ TRANSFORM_CHECK(type, BOOST_DUMMY_MACRO_PARAM, BOOST_DUMMY_MACRO_PARAM) } + + + +// +// VC++ emits an awful lot of warnings unless we define these: +#ifdef BOOST_MSVC +# pragma warning(disable:4800) +#endif + +// +// define some test types: +// +enum enum_UDT{ one, two, three }; +struct UDT +{ + UDT(){}; + ~UDT(){}; + UDT(const UDT&); + UDT& operator=(const UDT&); + int i; + + void f1(); + int f2(); + int f3(int); + int f4(int, float); +}; + +typedef void(*f1)(); +typedef int(*f2)(int); +typedef int(*f3)(int, bool); +typedef void (UDT::*mf1)(); +typedef int (UDT::*mf2)(); +typedef int (UDT::*mf3)(int); +typedef int (UDT::*mf4)(int, float); +typedef int (UDT::*mp); +typedef int (UDT::*cmf)(int) const; + +// cv-qualifiers applied to reference types should have no effect +// declare these here for later use with is_reference and remove_reference: +# ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4181) +# elif defined(__ICL) +# pragma warning(push) +# pragma warning(disable: 21) +# endif +// +// This is intentional: +// r_type and cr_type should be the same type +// but some compilers wrongly apply cv-qualifiers +// to reference types (this may generate a warning +// on some compilers): +// +typedef int& r_type; +typedef const r_type cr_type; +# ifdef BOOST_MSVC +# pragma warning(pop) +# elif defined(__ICL) +# pragma warning(pop) +# pragma warning(disable: 985) // identifier truncated in debug information +# endif + +struct POD_UDT { int x; }; +struct empty_UDT +{ + ~empty_UDT(){}; + empty_UDT& operator=(const empty_UDT&){ return *this; } + bool operator==(const empty_UDT&)const + { return true; } +}; +struct empty_POD_UDT +{ + empty_POD_UDT& operator=(const empty_POD_UDT&){ return *this; } + bool operator==(const empty_POD_UDT&)const + { return true; } +}; +union union_UDT +{ + int x; + double y; + ~union_UDT(){} +}; +union POD_union_UDT +{ + int x; + double y; +}; +union empty_union_UDT +{ + ~empty_union_UDT(){} +}; +union empty_POD_union_UDT{}; + +class Base { }; + +class Derived : public Base { }; + +class NonDerived { }; + +enum enum1 +{ + one_,two_ +}; + +enum enum2 +{ + three_,four_ +}; + +struct VB +{ + virtual ~VB(){}; +}; + +struct VD : VB +{ + ~VD(){}; +}; +// +// struct non_pointer: +// used to verify that is_pointer does not return +// true for class types that implement operator void*() +// +struct non_pointer +{ + operator void*(){return this;} +}; +struct non_int_pointer +{ + int i; + operator int*(){return &i;} +}; +struct int_constructible +{ + int_constructible(int); +}; +struct int_convertible +{ + operator int(); +}; +// +// struct non_empty: +// used to verify that is_empty does not emit +// spurious warnings or errors. +// +struct non_empty : private boost::noncopyable +{ + int i; +}; +// +// abstract base classes: +struct test_abc1 +{ + virtual void foo() = 0; + virtual void foo2() = 0; +}; + +struct test_abc2 +{ + virtual void foo() = 0; + virtual void foo2() = 0; +}; + +struct incomplete_type; + + + +#endif \ No newline at end of file diff --git a/test/tricky_abstract_type_test.cpp b/test/tricky_abstract_type_test.cpp new file mode 100644 index 0000000..e35026d --- /dev/null +++ b/test/tricky_abstract_type_test.cpp @@ -0,0 +1,61 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_function) +#include TYPE_TRAITS(is_pointer) +#include TYPE_TRAITS(is_void) +#include TYPE_TRAITS(is_integral) +#include TYPE_TRAITS(is_float) +#include TYPE_TRAITS(is_arithmetic) +#include TYPE_TRAITS(is_fundamental) +#include TYPE_TRAITS(is_member_pointer) +#include TYPE_TRAITS(is_enum) +#include TYPE_TRAITS(is_object) +#include TYPE_TRAITS(is_scalar) +#include TYPE_TRAITS(is_class) +#include TYPE_TRAITS(is_POD) +#include TYPE_TRAITS(has_trivial_constructor) +#include TYPE_TRAITS(has_trivial_copy) +#include TYPE_TRAITS(has_trivial_assign) +#include TYPE_TRAITS(has_nothrow_constructor) +#include TYPE_TRAITS(has_nothrow_copy) +#include TYPE_TRAITS(has_nothrow_assign) +#include TYPE_TRAITS(has_trivial_destructor) +#include TYPE_TRAITS(is_empty) +#include TYPE_TRAITS(is_compound) + +TT_TEST_BEGIN(abstract_type_tricky_tests) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); + +TT_TEST_END + + + + + + diff --git a/test/tricky_add_pointer_test.cpp b/test/tricky_add_pointer_test.cpp new file mode 100644 index 0000000..67109c6 --- /dev/null +++ b/test/tricky_add_pointer_test.cpp @@ -0,0 +1,29 @@ + +#include "test.hpp" +#include "check_type.hpp" +#include TYPE_TRANSFORM(add_pointer) + +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_5, ::boost::add_pointer, const &, const*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_6, ::boost::add_pointer, &, *) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_8, ::boost::add_pointer, const [2], const (*)[2]) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_9, ::boost::add_pointer, const &, const*) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_12, ::boost::add_pointer, const[2][3], const (*)[2][3]) +BOOST_DECL_TRANSFORM_TEST(add_pointer_test_13, ::boost::add_pointer, (&)[2], (*)[2]) + + +TT_TEST_BEGIN(partial_specialization_tricky_tests) + + add_pointer_test_5(); + add_pointer_test_6(); + add_pointer_test_8(); + add_pointer_test_9(); + add_pointer_test_12(); + add_pointer_test_13(); + +TT_TEST_END + + + + + + diff --git a/test/tricky_function_type_test.cpp b/test/tricky_function_type_test.cpp new file mode 100644 index 0000000..fb48fb3 --- /dev/null +++ b/test/tricky_function_type_test.cpp @@ -0,0 +1,147 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_function) +#include TYPE_TRAITS(is_pointer) +#include TYPE_TRAITS(is_void) +#include TYPE_TRAITS(is_integral) +#include TYPE_TRAITS(is_float) +#include TYPE_TRAITS(is_arithmetic) +#include TYPE_TRAITS(is_fundamental) +#include TYPE_TRAITS(is_member_pointer) +#include TYPE_TRAITS(is_enum) +#include TYPE_TRAITS(is_object) +#include TYPE_TRAITS(is_scalar) +#include TYPE_TRAITS(is_class) +#include TYPE_TRAITS(is_POD) +#include TYPE_TRAITS(has_trivial_constructor) +#include TYPE_TRAITS(has_trivial_copy) +#include TYPE_TRAITS(has_trivial_assign) +#include TYPE_TRAITS(has_trivial_destructor) +#include TYPE_TRAITS(is_empty) +#include TYPE_TRAITS(is_compound) + +typedef void foo0_t(); +typedef void foo1_t(int); +typedef void foo2_t(int&, double); +typedef void foo3_t(int&, bool, int, int); +typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int); + +TT_TEST_BEGIN(is_function) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty::value, false); + + +TT_TEST_END + + + + + + diff --git a/test/tricky_incomplete_type_test.cpp b/test/tricky_incomplete_type_test.cpp new file mode 100644 index 0000000..56d9d49 --- /dev/null +++ b/test/tricky_incomplete_type_test.cpp @@ -0,0 +1,55 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_function) +#include TYPE_TRAITS(is_pointer) +#include TYPE_TRAITS(is_void) +#include TYPE_TRAITS(is_integral) +#include TYPE_TRAITS(is_float) +#include TYPE_TRAITS(is_arithmetic) +#include TYPE_TRAITS(is_fundamental) +#include TYPE_TRAITS(is_member_pointer) +#include TYPE_TRAITS(is_enum) +#include TYPE_TRAITS(is_object) +#include TYPE_TRAITS(is_scalar) +#include TYPE_TRAITS(is_class) +#include TYPE_TRAITS(is_POD) +#include TYPE_TRAITS(has_trivial_constructor) +#include TYPE_TRAITS(has_trivial_copy) +#include TYPE_TRAITS(has_trivial_assign) +#include TYPE_TRAITS(has_trivial_destructor) +#include TYPE_TRAITS(is_empty) +#include TYPE_TRAITS(is_compound) + +TT_TEST_BEGIN(incomplete_type_tricky_tests) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); + +// this one is only partly correct: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object::value, true); + +TT_TEST_END + + + + + + diff --git a/test/tricky_partial_specialization_test.cpp b/test/tricky_partial_specialization_test.cpp new file mode 100644 index 0000000..7e60002 --- /dev/null +++ b/test/tricky_partial_specialization_test.cpp @@ -0,0 +1,71 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(is_class) +#include TYPE_TRAITS(alignment_of) +#include TYPE_TRAITS(has_nothrow_assign) +#include TYPE_TRAITS(has_nothrow_constructor) +#include TYPE_TRAITS(has_nothrow_copy) +#include TYPE_TRAITS(has_trivial_assign) +#include TYPE_TRAITS(has_trivial_constructor) +#include TYPE_TRAITS(has_trivial_copy) +#include TYPE_TRAITS(has_trivial_destructor) +#include TYPE_TRAITS(is_base_and_derived) +#include TYPE_TRAITS(is_object) +#include TYPE_TRAITS(is_pod) +#include TYPE_TRAITS(is_scalar) +#include TYPE_COMPARE(is_same) +#include TYPE_COMPARE(is_convertible) + +// +// VC++ emits an awful lot of warnings unless we define these: +#ifdef BOOST_MSVC +# pragma warning(disable:4244) +#endif + + +template +struct align_calc +{ + char padding; + T instance; + static std::ptrdiff_t get() + { + static align_calc a; + return reinterpret_cast(&(a.instance)) - reinterpret_cast(&(a.padding)); + } +}; + +#define ALIGNOF(x) align_calc::get() + + +TT_TEST_BEGIN(partial_specialization_tricky_tests) +// +// corner cases which don't compile without partial specialization +// support: +// + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(void*)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(void*)); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(void*)); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived::value), false); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); + +TT_TEST_END + + + + + + diff --git a/test/type_with_alignment_test.cpp b/test/type_with_alignment_test.cpp new file mode 100644 index 0000000..b65dd1b --- /dev/null +++ b/test/type_with_alignment_test.cpp @@ -0,0 +1,204 @@ + +#include "test.hpp" +#include "check_integral_constant.hpp" +#include TYPE_TRAITS(alignment_of) +#include TYPE_TRAITS(type_with_alignment) +#include TYPE_TRAITS(is_pod) + + +TT_TEST_BEGIN(type_with_alignment) + +BOOST_MESSAGE(typeid(::tt::type_with_alignment< + ::tt::alignment_of::value + >::type).name()); + +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +#endif +#ifdef BOOST_HAS_MS_INT64 +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of<__int64>::value + >::type + >::value == ::boost::alignment_of<__int64>::value); +#endif +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); +BOOST_CHECK(::tt::alignment_of< + ::tt::type_with_alignment< + ::tt::alignment_of::value + >::type + >::value == ::boost::alignment_of::value); + +// check that the type produced are POD's: +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +#endif +#ifdef BOOST_HAS_MS_INT64 +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of<__int64>::value>::type + >::value); +#endif +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); +BOOST_CHECK(::tt::is_POD< + ::tt::type_with_alignment< + ::tt::alignment_of::value>::type + >::value); + +TT_TEST_END + + + + + + + diff --git a/tests/Jamfile b/tests/Jamfile deleted file mode 100644 index c8b262b..0000000 --- a/tests/Jamfile +++ /dev/null @@ -1,36 +0,0 @@ -subproject libs/type_traits/tests ; - - -unit-test alignment_test : alignment_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test arithmetic_traits_test : arithmetic_traits_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test composite_traits_test : composite_traits_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test cv_traits_test : cv_traits_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test is_convertible_test : is_convertible_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test is_function_test : is_function_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test is_same_test : is_same_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test object_type_traits_test : object_type_traits_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - -unit-test transform_traits_test : transform_traits_test.cpp ../../test/build/prg_exec_monitor - : $(BOOST_ROOT) : ; - - - - - - - diff --git a/tests/alignment_test.cpp b/tests/alignment_test.cpp deleted file mode 100644 index b3b2be3..0000000 --- a/tests/alignment_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif -#include "boost/type_traits/type_traits_test.hpp" - -NESTED_DECL(alignment_of) - -int cpp_main(int argc, char* argv[]) -{ - NESTED_TEST(alignment_of, int) - NESTED_TEST(alignment_of, int_constructible) - - align_test(int); - align_test(char); - align_test(double); - align_test(int[4]); - align_test(int(*)(int)); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - align_test(char&); - align_test(char (&)(int)); - align_test(char(&)[4]); -#endif - align_test(int*); - //align_test(const int); - align_test(VB); - align_test(VD); - value_test(0, ::boost::alignment_of::value); - - type_with_align_test(int); - type_with_align_test(int(*)(int)); - type_with_align_test(VB); - type_with_align_test(VD); - type_with_align_test(char[13]); - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -unsigned int expected_failures = 0; - - diff --git a/tests/arithmetic_traits_test.cpp b/tests/arithmetic_traits_test.cpp deleted file mode 100644 index 9887142..0000000 --- a/tests/arithmetic_traits_test.cpp +++ /dev/null @@ -1,203 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif -#include "boost/type_traits/type_traits_test.hpp" - -NESTED_DECL(is_void) -NESTED_DECL(is_integral) -NESTED_DECL(is_float) -NESTED_DECL(is_arithmetic) -NESTED_DECL(is_fundamental) - -int cpp_main(int argc, char* argv[]) -{ - NESTED_TEST(is_void, void) - NESTED_TEST(is_void, int) - NESTED_TEST(is_integral, int) - NESTED_TEST(is_integral, float) - NESTED_TEST(is_float, void) - NESTED_TEST(is_float, double) - NESTED_TEST(is_arithmetic, void) - NESTED_TEST(is_arithmetic, int) - NESTED_TEST(is_fundamental, UDT) - NESTED_TEST(is_fundamental, int) - - value_test(true, boost::is_void::value) - value_test(true, boost::is_void::value) - value_test(true, boost::is_void::value) - value_test(true, boost::is_void::value) - value_test(false, boost::is_void::value) - value_test(false, boost::is_void::value) - - value_test(false, boost::is_integral::value) - value_test(false, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(false, boost::is_integral::value) - value_test(false, boost::is_integral::value) - value_test(false, boost::is_integral::value) - #ifdef BOOST_HAS_LONG_LONG - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - #if defined(BOOST_HAS_MS_INT64) - value_test(true, boost::is_integral<__int64>::value) - value_test(true, boost::is_integral::value) - #endif - //const qualified ints: - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #ifdef BOOST_HAS_LONG_LONG - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - #if defined(BOOST_HAS_MS_INT64) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - // volatile qualified ints: - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #ifdef BOOST_HAS_LONG_LONG - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - #if defined(BOOST_HAS_MS_INT64) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - //const qualified ints: - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #ifdef BOOST_HAS_LONG_LONG - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - #if defined(BOOST_HAS_MS_INT64) - value_test(true, boost::is_integral::value) - value_test(true, boost::is_integral::value) - #endif - value_test(false, boost::is_integral::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(true, boost::is_float::value) - value_test(false, boost::is_float::value) - value_test(false, boost::is_float::value) - value_test(false, boost::is_float::value) - value_test(false, boost::is_float::value) - - - value_test(false, boost::is_arithmetic::value) - value_test(false, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - #ifdef BOOST_HAS_LONG_LONG - value_test(true, boost::is_arithmetic::value) - value_test(true, boost::is_arithmetic::value) - #endif - #if defined(BOOST_HAS_MS_INT64) - value_test(true, boost::is_arithmetic<__int64>::value) - value_test(true, boost::is_arithmetic::value) - #endif - value_test(false, boost::is_arithmetic::value) - - value_test(false, boost::is_fundamental::value) - value_test(false, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - #ifdef BOOST_HAS_LONG_LONG - value_test(true, boost::is_fundamental::value) - value_test(true, boost::is_fundamental::value) - #endif - #if defined(BOOST_HAS_MS_INT64) - value_test(true, boost::is_fundamental<__int64>::value) - value_test(true, boost::is_fundamental::value) - #endif - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -unsigned int expected_failures = 0; - diff --git a/tests/composite_traits_test.cpp b/tests/composite_traits_test.cpp deleted file mode 100644 index 87139f8..0000000 --- a/tests/composite_traits_test.cpp +++ /dev/null @@ -1,158 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif -#include "boost/type_traits/type_traits_test.hpp" - -NESTED_DECL(is_array) -NESTED_DECL(is_pointer) -NESTED_DECL(is_reference) - -struct convertible_to_pointer -{ - operator char*() const; -}; - -int cpp_main(int argc, char* argv[]) -{ - NESTED_TEST(is_array, int) - NESTED_TEST(is_array, int[2]) - NESTED_TEST(is_array, int[3][4]) - NESTED_TEST(is_array, int const [5]) - NESTED_TEST(is_array, int(&)[2]) - NESTED_TEST(is_array, int (*)(double)) - NESTED_TEST(is_pointer, int) - NESTED_TEST(is_pointer, int*) - NESTED_TEST(is_reference, int) - NESTED_TEST(is_reference, int&) - - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(true, boost::is_array::value) - value_test(true, boost::is_array::value) - value_test(true, boost::is_array::value) - value_test(true, boost::is_array::value) - value_test(true, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - value_test(false, boost::is_array::value) - - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - // these were false in previous versions (JM 20 Dec 2000): - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - // JM 02 Oct 2000: - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - value_test(true, boost::is_pointer::value) - // Steve: was 'true', should be 'false', via 3.9.2p3 - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - value_test(false, boost::is_pointer::value) - - value_test(false, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(true, boost::is_reference::value) - value_test(false, boost::is_reference::value) - value_test(false, boost::is_reference::value) - - value_test(false, boost::is_member_pointer::value) - value_test(false, boost::is_member_pointer::value) - value_test(false, boost::is_member_pointer::value) - value_test(false, boost::is_member_pointer::value) - value_test(true, boost::is_member_pointer::value) - value_test(true, boost::is_member_pointer::value) - value_test(true, boost::is_member_pointer::value) - value_test(true, boost::is_member_pointer::value) - value_test(true, boost::is_member_pointer::value) - value_test(true, boost::is_member_pointer::value) - value_test(false, boost::is_member_pointer::value) - value_test(false, boost::is_member_pointer::value) - - value_test(false, boost::is_member_function_pointer::value) - value_test(false, boost::is_member_function_pointer::value) - value_test(false, boost::is_member_function_pointer::value) - value_test(false, boost::is_member_function_pointer::value) - value_test(true, boost::is_member_function_pointer::value) - value_test(true, boost::is_member_function_pointer::value) - value_test(true, boost::is_member_function_pointer::value) - value_test(true, boost::is_member_function_pointer::value) - value_test(true, boost::is_member_function_pointer::value) - value_test(false, boost::is_member_function_pointer::value) - value_test(false, boost::is_member_function_pointer::value) - value_test(false, boost::is_member_function_pointer::value) - - value_test(false, boost::is_enum::value) - value_test(true, boost::is_enum::value) - value_test(false, boost::is_enum::value) - value_test(false, boost::is_enum::value) - value_test(false, boost::is_enum::value) - value_test(false, boost::is_enum::value) - value_test(false, boost::is_enum::value) - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) -unsigned int expected_failures = 2; -#elif defined(__BORLANDC__) -unsigned int expected_failures = 1; -#elif defined(__SUNPRO_CC) -#if (__SUNPRO_CC <= 0x520) -unsigned int expected_failures = 11; -#else -unsigned int expected_failures = 1; -#endif -#elif defined(__GNUC__) -#if (__GNUC__ > 3) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1) -unsigned int expected_failures = 0; -# else -unsigned int expected_failures = 1; // can't handle cv-qualified references -# endif -#elif defined(BOOST_MSVC) -unsigned int expected_failures = 0; -#elif defined(__MWERKS__) && __MWERKS__ < 0x3000 || defined(__HP_aCC) -unsigned int expected_failures = 1; // is_enum doesn't work -#else -unsigned int expected_failures = 0; -#endif - - diff --git a/tests/cv_traits_test.cpp b/tests/cv_traits_test.cpp deleted file mode 100644 index 208533f..0000000 --- a/tests/cv_traits_test.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif -#include "boost/type_traits/type_traits_test.hpp" - -NESTED_DECL(is_const) -NESTED_DECL(is_volatile) - -int cpp_main(int argc, char* argv[]) -{ - NESTED_TEST(is_const, int) - NESTED_TEST(is_const, const int) - NESTED_TEST(is_const, volatile int) - NESTED_TEST(is_volatile, int) - NESTED_TEST(is_volatile, const int) - NESTED_TEST(is_volatile, volatile int) - - value_test(false, boost::is_const::value) - value_test(true, boost::is_const::value) - value_test(false, boost::is_const::value) - value_test(true, boost::is_const::value) - value_test(false, boost::is_const::value) - value_test(true, boost::is_const::value) - value_test(true, boost::is_const::value) - value_test(true, boost::is_const::value) - value_test(false, boost::is_const::value) -#if !defined(__GNUC__) || ( __GNUC__ > 3 ) || ( __GNUC__ ==3 && __GNUC_MINOR__ >=1) - value_test(false, boost::is_const::value) -#else - value_fail(false, boost::is_const::value) -#endif - - - value_test(false, boost::is_volatile::value) - value_test(true, boost::is_volatile::value) - value_test(false, boost::is_volatile::value) - value_test(true, boost::is_volatile::value) - value_test(false, boost::is_volatile::value) - value_test(true, boost::is_volatile::value) - value_test(true, boost::is_volatile::value) - value_test(true, boost::is_volatile::value) - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -#if defined(BOOST_MSVC) && _MSC_VER <= 1300 -unsigned int expected_failures = 2; -#elif defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x530) -unsigned int expected_failures = 1; -#else -unsigned int expected_failures = 0; -#endif - diff --git a/tests/function_traits_test.cpp b/tests/function_traits_test.cpp deleted file mode 100644 index 0e30f86..0000000 --- a/tests/function_traits_test.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// (C) Copyright Doug Gregor 2002. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#define BOOST_INCLUDE_MAIN -#include - -template -struct is_int -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template<> -struct is_int -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; - -template -struct is_float -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template<> -struct is_float -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template -struct is_double -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template<> -struct is_double -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; - - -int test_main(int, char*[]) -{ - typedef int F2(float, double); - - typedef boost::function_traits traits; - - BOOST_TEST(traits::arity == 2); - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - BOOST_TEST(is_int::value); - BOOST_TEST(is_float::value); - BOOST_TEST(is_double::value); -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - return 0; -} diff --git a/tests/is_convertible_test.cpp b/tests/is_convertible_test.cpp deleted file mode 100644 index 7c9bb27..0000000 --- a/tests/is_convertible_test.cpp +++ /dev/null @@ -1,112 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include -#include "boost/type_traits/type_traits_test.hpp" - -template -struct convertible_from -{ - convertible_from(T); -}; - -#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) -# define maybe_value_test value_fail -#else -# define maybe_value_test value_test -#endif - -int cpp_main(int argc, char* argv[]) -{ - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - -#ifdef BOOST_MSVC6_MEMBER_TEMPLATES - value_test(false, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); -#endif - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - - value_test(false, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(true, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - value_test(false, (boost::is_convertible::value)); - - // - // the following tests all involve user defined conversions which do - // not compile with Borland C++ Builder: - // - maybe_value_test(true, (boost::is_convertible::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(false, (boost::is_convertible >::value)); - - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - maybe_value_test(true, (boost::is_convertible >::value)); - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) -unsigned int expected_failures = 1; -#elif defined(__BORLANDC__) -unsigned int expected_failures = 3; -#elif defined(__MWERKS__) && __MWERKS__ < 0x3000 -unsigned int expected_failures = 35; -#else -unsigned int expected_failures = 0; -#endif - - - - - - diff --git a/tests/is_function_test.cpp b/tests/is_function_test.cpp deleted file mode 100644 index 995bed0..0000000 --- a/tests/is_function_test.cpp +++ /dev/null @@ -1,82 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include "boost/type_traits/type_traits_test.hpp" - -template -struct is_function_tester -{ - static void check(); -}; - -template -void is_function_tester::check() -{ - // if we're a function then we must not be a - // function pointer: - value_test(true, ::boost::is_function::value); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, ::boost::is_pointer::value); - value_test(false, ::boost::is_void::value); - value_test(false, ::boost::is_integral::value); - value_test(false, ::boost::is_float::value); - value_test(false, ::boost::is_arithmetic::value); - value_test(false, ::boost::is_fundamental::value); - value_test(false, ::boost::is_reference::value); - value_test(false, ::boost::is_member_pointer::value); - value_test(false, ::boost::is_enum::value); - value_test(false, ::boost::is_union::value); - value_test(false, ::boost::is_object::value); - value_test(false, ::boost::is_scalar::value); - value_test(false, ::boost::is_class::value); - value_test(false, ::boost::is_compound::value); - value_test(false, ::boost::is_POD::value); - value_test(false, ::boost::has_trivial_constructor::value); - value_test(false, ::boost::has_trivial_copy::value); - value_test(false, ::boost::has_trivial_assign::value); - value_test(false, ::boost::has_trivial_destructor::value); - value_test(false, ::boost::is_empty::value); -#endif -} - -int cpp_main(int argc, char* argv[]) -{ - typedef void foo0_t(); - typedef void foo1_t(int); - typedef void foo2_t(int&, double); - typedef void foo3_t(int&, bool, int, int); - typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int); - - is_function_tester::check(); - is_function_tester::check(); - is_function_tester::check(); - is_function_tester::check(); - is_function_tester::check(); - - value_test(false, ::boost::is_function::value); - value_test(false, ::boost::is_function::value); - value_test(false, ::boost::is_function::value); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, ::boost::is_function::value); - value_test(false, ::boost::is_function::value); -#endif - value_test(false, ::boost::is_function::value); - value_test(false, ::boost::is_function::value); - value_test(false, ::boost::is_function::value); - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -unsigned int expected_failures = 0; - - - - - diff --git a/tests/is_same_test.cpp b/tests/is_same_test.cpp deleted file mode 100644 index 37e85d7..0000000 --- a/tests/is_same_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif -#include "boost/type_traits/type_traits_test.hpp" - -int cpp_main(int argc, char* argv[]) -{ - value_test(true, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) - value_test(true, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_MSVC) - value_test(true, (::boost::is_same::value)) - value_test(false, (::boost::is_same::value)) -#endif - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -#if defined(BOOST_MSVC) && _MSC_VER <= 1300 -// can't separate void and cv-void: -unsigned int expected_failures = 1; -#elif defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x530) -unsigned int expected_failures = 2; -#else -unsigned int expected_failures = 0; -#endif - - diff --git a/tests/object_type_traits_test.cpp b/tests/object_type_traits_test.cpp deleted file mode 100644 index 67bad5a..0000000 --- a/tests/object_type_traits_test.cpp +++ /dev/null @@ -1,318 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif -#include "boost/type_traits/type_traits_test.hpp" - -NESTED_DECL(is_class) -NESTED_DECL(is_object) -NESTED_DECL(is_scalar) -NESTED_DECL(is_compound) -NESTED_DECL(is_POD) - -struct non_default_constructable_UDT -{ - non_default_constructable_UDT(const non_default_constructable_UDT&){} -private: - non_default_constructable_UDT(){} -}; - -int cpp_main(int argc, char* argv[]) -{ - NESTED_TEST(is_class, int) - NESTED_TEST(is_class, UDT) - NESTED_TEST(is_object, int) - NESTED_TEST(is_object, void) - NESTED_TEST(is_object, UDT) - NESTED_TEST(is_scalar, void) - NESTED_TEST(is_scalar, int) - NESTED_TEST(is_compound, int) - NESTED_TEST(is_compound, UDT) - NESTED_TEST(is_POD, int) - NESTED_TEST(is_POD, UDT) - - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(true, boost::is_class::value) - value_test(true, boost::is_class::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(true, boost::is_class::value) - value_test(true, boost::is_class::value) -#endif - value_test(true, boost::is_class::value) - value_test(true, boost::is_class::value) - value_test(true, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - value_test(false, boost::is_class::value) - - value_test(true, boost::is_object::value) - value_test(true, boost::is_object::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(true, boost::is_object::value) -#endif - value_test(false, boost::is_object::value) - value_test(false, boost::is_object::value) - - value_test(true, boost::is_scalar::value) - value_test(true, boost::is_scalar::value) - value_test(false, boost::is_scalar::value) - value_test(false, boost::is_scalar::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::is_scalar::value) -#endif - value_test(false, boost::is_scalar::value) - - value_test(true, boost::is_compound::value) - value_test(true, boost::is_compound::value) - value_test(false, boost::is_compound::value) - value_test(false, boost::is_compound::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(true, boost::is_compound::value) -#endif - - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(false, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(false, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(false, boost::is_POD::value) - value_test(false, boost::is_POD::value) - value_test(true, boost::is_POD::value) - value_test(true, boost::is_POD::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::is_POD::value) -#endif - - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(false, boost::has_trivial_constructor::value) - soft_value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) - value_test(true, boost::has_trivial_constructor::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_trivial_constructor::value) -#endif - - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - // Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10 - value_test(false, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(false, boost::has_trivial_copy::value) - soft_value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) - value_test(true, boost::has_trivial_copy::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_trivial_copy::value) -#endif - - value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(false, boost::has_trivial_assign::value) - value_test(false, boost::has_trivial_assign::value) - // Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10 - value_test(false, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(false, boost::has_trivial_assign::value) - soft_value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) - value_test(true, boost::has_trivial_assign::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_trivial_assign::value) -#endif - - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(false, boost::has_trivial_destructor::value) - value_test(false, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) - value_test(true, boost::has_trivial_destructor::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_trivial_destructor::value) -#endif - - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(false, boost::has_nothrow_constructor::value) - soft_value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) - value_test(true, boost::has_nothrow_constructor::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_nothrow_constructor::value) -#endif - - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - // Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10 - value_test(false, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(false, boost::has_nothrow_copy::value) - soft_value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) - value_test(true, boost::has_nothrow_copy::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_nothrow_copy::value) -#endif - - value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(false, boost::has_nothrow_assign::value) - value_test(false, boost::has_nothrow_assign::value) - // Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10 - value_test(false, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(false, boost::has_nothrow_assign::value) - soft_value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) - value_test(true, boost::has_nothrow_assign::value) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, boost::has_nothrow_assign::value) -#endif - - soft_value_test(false, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) -#if defined(__MWERKS__) && __MWERKS__ < 0x3000 || defined(__HP_aCC) - // apparent compiler bug causes this to fail to compile: - value_fail(false, boost::is_empty::value) -#else - soft_value_test(false, boost::is_empty::value) -#endif - soft_value_test(false, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) - soft_value_test(true, boost::is_empty::value) - soft_value_test(true, boost::is_empty::value) - // this one will not compile on most compilers, - // because we can't tell the difference between - // unions and classes: - value_fail(true, boost::is_empty::value) -#if defined(__MWERKS__) && __MWERKS__ < 0x3000 || defined(__HP_aCC) - // apparent compiler bug causes this to fail to compile: - value_fail(false, boost::is_empty::value) -#else - soft_value_test(false, boost::is_empty::value) -#endif - soft_value_test(true, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) - soft_value_test(false, boost::is_empty::value) - soft_value_test(true, boost::is_empty::value) - - value_test(false, (boost::is_base_and_derived::value)); - value_test(true, (boost::is_base_and_derived::value)); - value_test(true, (boost::is_base_and_derived::value)); - value_test(true, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); - value_test(false, (boost::is_base_and_derived::value)); -#endif - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) -// can't handle enum's or classes that are POD's -unsigned int expected_failures = 9; -#elif defined(__SUNPRO_CC) -#if (__SUNPRO_CC <= 0x520) -unsigned int expected_failures = 55; -#elif (__SUNPRO_CC < 0x530) -unsigned int expected_failures = 25; -#else -unsigned int expected_failures = 0; -#endif -#elif defined(__MWERKS__) && __MWERKS__ < 0x3000 -unsigned int expected_failures = 10; -#elif defined(BOOST_MSVC) -unsigned int expected_failures = 0; -#elif defined(__HP_aCC) -unsigned int expected_failures = 2; -#elif defined(__EDG_VERSION__) && __EDG_VERSION__ < 240 -unsigned int expected_failures = 3; -#else -unsigned int expected_failures = 0; -#endif - - diff --git a/tests/transform_traits_test.cpp b/tests/transform_traits_test.cpp deleted file mode 100644 index 681393a..0000000 --- a/tests/transform_traits_test.cpp +++ /dev/null @@ -1,482 +0,0 @@ - -// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -#include -#include -#include -#include - -#ifdef __BORLANDC__ -#pragma hrdstop -#endif - -// -// some of these tests, particularly those involving -// the use of the transform_check macro are tantamount -// to "compiler-abuse", and actually hide a *lot* of -// template test code. To prevent "Internal Compiler Error" -// type messages, we have to split these up into lots of -// separate functions: -#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || (defined(__BORLANDC__) && (__BORLANDC__ < 0x550)) -#define SHORT_TRANSFORM_TEST -#endif -#include "boost/type_traits/type_traits_test.hpp" - -#define BOOST_DECL_TRANSFORM_TEST(name, type, from, to)\ -void name(){ transform_check(type, from, to) } -#define BOOST_DECL_TRANSFORM_TEST3(name, type, from)\ -void name(){ transform_check(type, from, boost_dummy_macro_param) } -#define BOOST_DECL_TRANSFORM_TEST2(name, type)\ -void name(){ transform_check(type, boost_dummy_macro_param, boost_dummy_macro_param) } - -/*********************************************************************** - * - * tests for remove_const: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST3(remove_const_test_1, ::boost::remove_const, const) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_2, ::boost::remove_const, volatile, volatile) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_3, ::boost::remove_const, const volatile, volatile) -BOOST_DECL_TRANSFORM_TEST2(remove_const_test_4, ::boost::remove_const) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_6, ::boost::remove_const, *const, *) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_7, ::boost::remove_const, *volatile, *volatile) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_8, ::boost::remove_const, *const volatile, *volatile) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_9, ::boost::remove_const, *, *) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_11, ::boost::remove_const, volatile*, volatile*) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_12, ::boost::remove_const, const[2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_13, ::boost::remove_const, volatile[2], volatile[2]) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_14, ::boost::remove_const, const volatile[2], volatile[2]) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_15, ::boost::remove_const, [2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_16, ::boost::remove_const, const*, const*) -BOOST_DECL_TRANSFORM_TEST(remove_const_test_17, ::boost::remove_const, const*const, const*) - -void check_remove_const() -{ - remove_const_test_1(); - remove_const_test_2(); - remove_const_test_3(); - remove_const_test_4(); - remove_const_test_6(); - remove_const_test_7(); - remove_const_test_8(); - remove_const_test_9(); - remove_const_test_11(); - remove_const_test_12(); - remove_const_test_13(); - remove_const_test_14(); - remove_const_test_15(); - remove_const_test_16(); - remove_const_test_17(); -} - -/*********************************************************************** - * - * tests for remove_volatile: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_1, ::boost::remove_volatile, const, const) -BOOST_DECL_TRANSFORM_TEST3(remove_volatile_test_2, ::boost::remove_volatile, volatile) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_3, ::boost::remove_volatile, const volatile, const) -BOOST_DECL_TRANSFORM_TEST2(remove_volatile_test_4, ::boost::remove_volatile) -BOOST_DECL_TRANSFORM_TEST2(remove_volatile_test_5, ::boost::remove_volatile) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_6, ::boost::remove_volatile, *const, *const) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_7, ::boost::remove_volatile, *volatile, *) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_8, ::boost::remove_volatile, *const volatile, *const) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_9, ::boost::remove_volatile, *, *) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_10, ::boost::remove_volatile, *, *) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_11, ::boost::remove_volatile, volatile*, volatile*) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_12, ::boost::remove_volatile, const[2], const[2]) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_13, ::boost::remove_volatile, volatile[2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_14, ::boost::remove_volatile, const volatile[2], const[2]) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_15, ::boost::remove_volatile, [2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_16, ::boost::remove_volatile, const*, const*) -BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_17, ::boost::remove_volatile, const*volatile, const*) - -void check_remove_volatile() -{ - remove_volatile_test_1(); - remove_volatile_test_2(); - remove_volatile_test_3(); - remove_volatile_test_4(); - remove_volatile_test_5(); - remove_volatile_test_6(); - remove_volatile_test_7(); - remove_volatile_test_8(); - remove_volatile_test_9(); - remove_volatile_test_10(); - remove_volatile_test_11(); - remove_volatile_test_12(); - remove_volatile_test_13(); - remove_volatile_test_14(); - remove_volatile_test_15(); - remove_volatile_test_16(); - remove_volatile_test_17(); -} - -/*********************************************************************** - * - * tests for remove_cv: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_1, ::boost::remove_cv, const) -BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_2, ::boost::remove_cv, volatile) -BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_3, ::boost::remove_cv, const volatile) -BOOST_DECL_TRANSFORM_TEST2(remove_cv_test_4, ::boost::remove_cv) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_5, ::boost::remove_cv, const &, const&) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_6, ::boost::remove_cv, *const, *) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_7, ::boost::remove_cv, *volatile, *) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_8, ::boost::remove_cv, *const volatile, *) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_9, ::boost::remove_cv, *, *) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_10, ::boost::remove_cv, const*, const*) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_11, ::boost::remove_cv, volatile*, volatile*) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_12, ::boost::remove_cv, const[2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_13, ::boost::remove_cv, volatile[2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_14, ::boost::remove_cv, const volatile[2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_15, ::boost::remove_cv, [2], [2]) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_16, ::boost::remove_cv, const*, const*) -BOOST_DECL_TRANSFORM_TEST(remove_cv_test_17, ::boost::remove_cv, const*volatile, const*) - -void check_remove_cv() -{ - remove_cv_test_1(); - remove_cv_test_2(); - remove_cv_test_3(); - remove_cv_test_4(); - remove_cv_test_5(); - remove_cv_test_6(); - remove_cv_test_7(); - remove_cv_test_8(); - remove_cv_test_9(); - remove_cv_test_10(); - remove_cv_test_11(); - remove_cv_test_12(); - remove_cv_test_13(); - remove_cv_test_14(); - remove_cv_test_15(); - remove_cv_test_16(); - remove_cv_test_17(); -} - -/*********************************************************************** - * - * tests for remove_reference: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_1, ::boost::remove_reference, const, const) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_2, ::boost::remove_reference, volatile, volatile) -BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_3, ::boost::remove_reference, &) -BOOST_DECL_TRANSFORM_TEST2(remove_reference_test_4, ::boost::remove_reference) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_5, ::boost::remove_reference, const &, const) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_6, ::boost::remove_reference, *, *) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_7, ::boost::remove_reference, *volatile, *volatile) -BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_8, ::boost::remove_reference, &) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_9, ::boost::remove_reference, const &, const) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_10, ::boost::remove_reference, const*, const*) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_11, ::boost::remove_reference, volatile*, volatile*) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_12, ::boost::remove_reference, const[2], const[2]) -BOOST_DECL_TRANSFORM_TEST(remove_reference_test_13, ::boost::remove_reference, (&)[2], [2]) - -void check_remove_reference() -{ - remove_reference_test_1(); - remove_reference_test_2(); - remove_reference_test_3(); - remove_reference_test_4(); - remove_reference_test_5(); - remove_reference_test_6(); - remove_reference_test_7(); - remove_reference_test_8(); - remove_reference_test_9(); - remove_reference_test_10(); - remove_reference_test_11(); - remove_reference_test_12(); - remove_reference_test_13(); -} - -/*********************************************************************** - * - * tests for remove_bounds: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_1, ::boost::remove_bounds, const, const) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_2, ::boost::remove_bounds, volatile, volatile) -BOOST_DECL_TRANSFORM_TEST3(remove_bounds_test_3, ::boost::remove_bounds, [2]) -BOOST_DECL_TRANSFORM_TEST2(remove_bounds_test_4, ::boost::remove_bounds) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_5, ::boost::remove_bounds, const &, const&) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_6, ::boost::remove_bounds, *, *) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_7, ::boost::remove_bounds, *volatile, *volatile) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_8, ::boost::remove_bounds, const [2], const) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_9, ::boost::remove_bounds, const &, const&) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_10, ::boost::remove_bounds, const*, const*) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_11, ::boost::remove_bounds, volatile*, volatile*) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_12, ::boost::remove_bounds, const[2][3], const[3]) -BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_13, ::boost::remove_bounds, (&)[2], (&)[2]) - -void check_remove_bounds() -{ - remove_bounds_test_1(); - remove_bounds_test_2(); - remove_bounds_test_3(); - remove_bounds_test_4(); - remove_bounds_test_5(); - remove_bounds_test_6(); - remove_bounds_test_7(); - remove_bounds_test_8(); - remove_bounds_test_9(); - remove_bounds_test_10(); - remove_bounds_test_11(); - remove_bounds_test_12(); - remove_bounds_test_13(); -} - -/*********************************************************************** - * - * tests for remove_pointer: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_1, ::boost::remove_pointer, const, const) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_2, ::boost::remove_pointer, volatile, volatile) -BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_3, ::boost::remove_pointer, *) -BOOST_DECL_TRANSFORM_TEST2(remove_pointer_test_4, ::boost::remove_pointer) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_5, ::boost::remove_pointer, const &, const&) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_6, ::boost::remove_pointer, &, &) -BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_7, ::boost::remove_pointer, *volatile) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_8, ::boost::remove_pointer, const [2], const[2]) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_9, ::boost::remove_pointer, const &, const&) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_10, ::boost::remove_pointer, const*, const) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_11, ::boost::remove_pointer, volatile*, volatile) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_12, ::boost::remove_pointer, const[2][3], const[2][3]) -BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_13, ::boost::remove_pointer, (&)[2], (&)[2]) - -void check_remove_pointer() -{ - remove_pointer_test_1(); - remove_pointer_test_2(); - remove_pointer_test_3(); - remove_pointer_test_4(); - remove_pointer_test_5(); - remove_pointer_test_6(); - remove_pointer_test_7(); - remove_pointer_test_8(); - remove_pointer_test_9(); - remove_pointer_test_10(); - remove_pointer_test_11(); - remove_pointer_test_12(); - remove_pointer_test_13(); -} - -/*********************************************************************** - * - * tests for add_reference: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(add_reference_test_1, ::boost::add_reference, const, const&) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_2, ::boost::add_reference, volatile, volatile&) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_3, ::boost::add_reference, *, *&) -//BOOST_DECL_TRANSFORM_TEST2(add_reference_test_4, ::boost::add_reference) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_5, ::boost::add_reference, const &, const&) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_6, ::boost::add_reference, &, &) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_7, ::boost::add_reference, *volatile, *volatile&) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_8, ::boost::add_reference, const [2], const (&)[2]) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_9, ::boost::add_reference, const &, const&) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_10, ::boost::add_reference, const*, const*&) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_11, ::boost::add_reference, volatile*, volatile*&) -//BOOST_DECL_TRANSFORM_TEST(add_reference_test_12, ::boost::add_reference, const[2][3], const (&)[2][3]) -BOOST_DECL_TRANSFORM_TEST(add_reference_test_13, ::boost::add_reference, (&)[2], (&)[2]) - -void check_add_reference() -{ - add_reference_test_1(); - add_reference_test_2(); - add_reference_test_3(); - //add_reference_test_4(); - add_reference_test_5(); - add_reference_test_6(); - add_reference_test_7(); - add_reference_test_8(); - add_reference_test_9(); - add_reference_test_10(); - add_reference_test_11(); - //add_reference_test_12(); - add_reference_test_13(); -} - -/*********************************************************************** - * - * tests for add_pointer: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_1, ::boost::add_pointer, const, const*) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_2, ::boost::add_pointer, volatile, volatile*) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_3, ::boost::add_pointer, *, **) -//BOOST_DECL_TRANSFORM_TEST2(add_pointer_test_4, ::boost::add_pointer) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_7, ::boost::add_pointer, *volatile, *volatile*) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_10, ::boost::add_pointer, const*, const**) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_11, ::boost::add_pointer, volatile*, volatile**) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_5, ::boost::add_pointer, const &, const*) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_6, ::boost::add_pointer, &, *) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_8, ::boost::add_pointer, const [2], const (*)[2]) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_9, ::boost::add_pointer, const &, const*) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_12, ::boost::add_pointer, const[2][3], const (*)[2][3]) -BOOST_DECL_TRANSFORM_TEST(add_pointer_test_13, ::boost::add_pointer, (&)[2], (*)[2]) -#endif - -void check_add_pointer() -{ - add_pointer_test_1(); - add_pointer_test_2(); - add_pointer_test_3(); - //add_pointer_test_4(); - add_pointer_test_7(); - add_pointer_test_10(); - add_pointer_test_11(); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - add_pointer_test_5(); - add_pointer_test_6(); - add_pointer_test_8(); - add_pointer_test_9(); - add_pointer_test_12(); - add_pointer_test_13(); -#endif -} - -/*********************************************************************** - * - * tests for add_const: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(add_const_test_1, ::boost::add_const, const, const) -BOOST_DECL_TRANSFORM_TEST(add_const_test_2, ::boost::add_const, volatile, volatile const) -BOOST_DECL_TRANSFORM_TEST(add_const_test_3, ::boost::add_const, *, *const) -//BOOST_DECL_TRANSFORM_TEST2(add_const_test_4, ::boost::add_const) -BOOST_DECL_TRANSFORM_TEST(add_const_test_7, ::boost::add_const, *volatile, *volatile const) -BOOST_DECL_TRANSFORM_TEST(add_const_test_10, ::boost::add_const, const*, const*const) -BOOST_DECL_TRANSFORM_TEST(add_const_test_11, ::boost::add_const, volatile*, volatile*const) -BOOST_DECL_TRANSFORM_TEST(add_const_test_5, ::boost::add_const, const &, const&) -BOOST_DECL_TRANSFORM_TEST(add_const_test_6, ::boost::add_const, &, &) -BOOST_DECL_TRANSFORM_TEST(add_const_test_8, ::boost::add_const, const [2], const [2]) -BOOST_DECL_TRANSFORM_TEST(add_const_test_9, ::boost::add_const, volatile &, volatile&) -BOOST_DECL_TRANSFORM_TEST(add_const_test_12, ::boost::add_const, [2][3], const[2][3]) -BOOST_DECL_TRANSFORM_TEST(add_const_test_13, ::boost::add_const, (&)[2], (&)[2]) - -void check_add_const() -{ - add_const_test_1(); - add_const_test_2(); - add_const_test_3(); - //add_const_test_4(); - add_const_test_7(); - add_const_test_10(); - add_const_test_11(); - add_const_test_5(); - add_const_test_6(); - add_const_test_8(); - add_const_test_9(); - add_const_test_12(); - add_const_test_13(); -} - -/*********************************************************************** - * - * tests for add_volatile: - * - **********************************************************************/ - -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_1, ::boost::add_volatile, const, const volatile) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_2, ::boost::add_volatile, volatile, volatile) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_3, ::boost::add_volatile, *, *volatile) -//BOOST_DECL_TRANSFORM_TEST2(add_volatile_test_4, ::boost::add_volatile) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_7, ::boost::add_volatile, *volatile, *volatile) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_10, ::boost::add_volatile, const*, const*volatile) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_11, ::boost::add_volatile, volatile*, volatile*volatile) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_5, ::boost::add_volatile, const &, const&) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_6, ::boost::add_volatile, &, &) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_8, ::boost::add_volatile, const [2], const volatile [2]) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_9, ::boost::add_volatile, volatile &, volatile&) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_12, ::boost::add_volatile, [2][3], volatile[2][3]) -BOOST_DECL_TRANSFORM_TEST(add_volatile_test_13, ::boost::add_volatile, (&)[2], (&)[2]) - -void check_add_volatile() -{ - add_volatile_test_1(); - add_volatile_test_2(); - add_volatile_test_3(); - //add_volatile_test_4(); - add_volatile_test_7(); - add_volatile_test_10(); - add_volatile_test_11(); - add_volatile_test_5(); - add_volatile_test_6(); - add_volatile_test_8(); - add_volatile_test_9(); - add_volatile_test_12(); - add_volatile_test_13(); -} - - -int cpp_main(int argc, char* argv[]) -{ - check_remove_const(); - check_remove_volatile(); - check_remove_cv(); - check_remove_reference(); - check_remove_bounds(); - check_remove_pointer(); - check_add_reference(); - check_add_pointer(); - check_add_const(); - check_add_volatile(); - - type_test(void, boost::remove_const::type) - type_test(void, boost::remove_volatile::type) - type_test(void, boost::remove_cv::type) - - type_test(int, boost::remove_reference::type) - type_test(void, boost::remove_reference::type) - - type_test(void, boost::remove_bounds::type) - type_test(void, boost::remove_pointer::type) - - return check_result(argc, argv); -} - -// -// define the number of failures expected for given compilers: -#ifdef __BORLANDC__ -# ifdef SHORT_TRANSFORM_TEST -unsigned int expected_failures = 97; // cv-qualifiers -# else -unsigned int expected_failures = 474; // cv-qualifiers -# endif -#elif defined(BOOST_MSVC) && _MSC_VER <= 1300 -unsigned int expected_failures = 84; // partial specialisation (fails for UDT's) -#elif defined(__SUNPRO_CC) -unsigned int expected_failures = 1; // cv-qualified references -#elif defined(__GNUC__) -# if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) -unsigned int expected_failures = 0; -# else -unsigned int expected_failures = 1; // cv-qualified references -# endif -#elif defined(__HP_aCC) -unsigned int expected_failures = 272; // remove_const/remove_volatile/remove_cv don't work -#elif defined(__EDG_VERSION__) && __EDG_VERSION__ < 238 -unsigned int expected_failures = 1; -#else -unsigned int expected_failures = 0; -#endif - -