From feb17336f9f69df4759757ae85f11e331bc7f50a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 21 Apr 2006 11:59:50 +0000 Subject: [PATCH] Added stronger tests for the intrinsic compiler support. [SVN r33755] --- test/has_trivial_assign_test.cpp | 9 ++++++++ test/has_trivial_constr_test.cpp | 10 +++++++++ test/has_trivial_copy_test.cpp | 9 ++++++++ test/has_trivial_destructor_test.cpp | 9 ++++++++ test/is_pod_test.cpp | 8 +++++++ test/test.hpp | 31 ++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+) diff --git a/test/has_trivial_assign_test.cpp b/test/has_trivial_assign_test.cpp index ce4029a..61be263 100644 --- a/test/has_trivial_assign_test.cpp +++ b/test/has_trivial_assign_test.cpp @@ -189,6 +189,15 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, tru 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_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, 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); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, 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); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); TT_TEST_END diff --git a/test/has_trivial_constr_test.cpp b/test/has_trivial_constr_test.cpp index ccadb1f..a651157 100644 --- a/test/has_trivial_constr_test.cpp +++ b/test/has_trivial_constr_test.cpp @@ -155,6 +155,16 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value 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_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, 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); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, 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); + + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); TT_TEST_END diff --git a/test/has_trivial_copy_test.cpp b/test/has_trivial_copy_test.cpp index 18b4d68..f845240 100644 --- a/test/has_trivial_copy_test.cpp +++ b/test/has_trivial_copy_test.cpp @@ -189,6 +189,15 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, 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_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, 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); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, 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); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); TT_TEST_END diff --git a/test/has_trivial_destructor_test.cpp b/test/has_trivial_destructor_test.cpp index 577c5e4..98db25d 100644 --- a/test/has_trivial_destructor_test.cpp +++ b/test/has_trivial_destructor_test.cpp @@ -161,6 +161,15 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, 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_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, 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); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, 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/is_pod_test.cpp b/test/is_pod_test.cpp index 59523dd..c21a7af 100644 --- a/test/is_pod_test.cpp +++ b/test/is_pod_test.cpp @@ -158,6 +158,14 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_pod::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_pod::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_pod::value, true, false); +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, false); +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, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); TT_TEST_END diff --git a/test/test.hpp b/test/test.hpp index 7c83d1b..2e354b9 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -376,6 +376,37 @@ 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); +struct trivial_except_construct +{ + trivial_except_construct(); + int i; +}; + +struct trivial_except_destroy +{ + ~trivial_except_destroy(); + int i; +}; + +struct trivial_except_copy +{ + trivial_except_copy(trivial_except_copy const&); + int i; +}; + +struct trivial_except_assign +{ + trivial_except_assign& operator=(trivial_except_assign const&); + int i; +}; + +template +struct wrap +{ + T t; + int j; +}; + #endif