From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/tti/test/Jamfile.v2 | 435 +++++++++++++++++++++ src/boost/libs/tti/test/test_has_data.cpp | 37 ++ src/boost/libs/tti/test/test_has_data.hpp | 26 ++ src/boost/libs/tti/test/test_has_data_compile.cpp | 36 ++ src/boost/libs/tti/test/test_has_data_fail.cpp | 19 + src/boost/libs/tti/test/test_has_data_fail2.cpp | 19 + src/boost/libs/tti/test/test_has_data_fail3.cpp | 18 + src/boost/libs/tti/test/test_has_data_fail4.cpp | 19 + src/boost/libs/tti/test/test_has_data_fail5.cpp | 19 + src/boost/libs/tti/test/test_has_data_fail6.cpp | 18 + src/boost/libs/tti/test/test_has_fun.cpp | 33 ++ src/boost/libs/tti/test/test_has_fun.hpp | 24 ++ src/boost/libs/tti/test/test_has_fun_compile.cpp | 33 ++ src/boost/libs/tti/test/test_has_fun_fail.cpp | 19 + src/boost/libs/tti/test/test_has_fun_fail2.cpp | 18 + src/boost/libs/tti/test/test_has_fun_fail3.cpp | 19 + src/boost/libs/tti/test/test_has_fun_fail4.cpp | 18 + src/boost/libs/tti/test/test_has_fun_fail5.cpp | 19 + src/boost/libs/tti/test/test_has_mem_data.cpp | 33 ++ src/boost/libs/tti/test/test_has_mem_data.hpp | 22 ++ src/boost/libs/tti/test/test_has_mem_data2.cpp | 26 ++ .../libs/tti/test/test_has_mem_data_compile.cpp | 31 ++ src/boost/libs/tti/test/test_has_mem_data_fail.cpp | 19 + .../libs/tti/test/test_has_mem_data_fail2.cpp | 19 + .../libs/tti/test/test_has_mem_data_fail3.cpp | 18 + src/boost/libs/tti/test/test_has_mem_fun.cpp | 30 ++ src/boost/libs/tti/test/test_has_mem_fun.hpp | 35 ++ .../libs/tti/test/test_has_mem_fun_compile.cpp | 28 ++ src/boost/libs/tti/test/test_has_mem_fun_cv.cpp | 45 +++ .../libs/tti/test/test_has_mem_fun_cv_compile.cpp | 49 +++ .../libs/tti/test/test_has_mem_fun_cv_fail.cpp | 19 + .../libs/tti/test/test_has_mem_fun_cv_fail2.cpp | 19 + .../libs/tti/test/test_has_mem_fun_cv_fail3.cpp | 19 + .../libs/tti/test/test_has_mem_fun_cv_fail4.cpp | 19 + .../libs/tti/test/test_has_mem_fun_cv_fail5.cpp | 19 + .../libs/tti/test/test_has_mem_fun_cv_fail6.cpp | 19 + src/boost/libs/tti/test/test_has_mem_fun_fail.cpp | 19 + src/boost/libs/tti/test/test_has_mem_fun_fail2.cpp | 18 + src/boost/libs/tti/test/test_has_mem_fun_fail3.cpp | 19 + src/boost/libs/tti/test/test_has_member.cpp | 23 ++ .../libs/tti/test/test_has_member_compile.cpp | 28 ++ src/boost/libs/tti/test/test_has_member_cv.cpp | 36 ++ .../libs/tti/test/test_has_member_cv_compile.cpp | 40 ++ .../libs/tti/test/test_has_member_cv_fail.cpp | 19 + .../libs/tti/test/test_has_member_cv_fail2.cpp | 19 + .../libs/tti/test/test_has_member_cv_fail3.cpp | 19 + .../libs/tti/test/test_has_member_cv_fail4.cpp | 19 + .../libs/tti/test/test_has_member_cv_fail5.cpp | 19 + src/boost/libs/tti/test/test_has_member_fail.cpp | 19 + src/boost/libs/tti/test/test_has_member_fail2.cpp | 18 + src/boost/libs/tti/test/test_has_member_fail3.cpp | 19 + .../libs/tti/test/test_has_static_mem_data.cpp | 25 ++ .../libs/tti/test/test_has_static_mem_data.hpp | 18 + .../tti/test/test_has_static_mem_data_compile.cpp | 24 ++ .../tti/test/test_has_static_mem_data_fail.cpp | 19 + .../tti/test/test_has_static_mem_data_fail2.cpp | 19 + .../tti/test/test_has_static_mem_data_fail3.cpp | 18 + .../libs/tti/test/test_has_static_mem_fun.cpp | 27 ++ .../libs/tti/test/test_has_static_mem_fun.hpp | 18 + .../tti/test/test_has_static_mem_fun_compile.cpp | 26 ++ .../libs/tti/test/test_has_static_mem_fun_fail.cpp | 19 + .../tti/test/test_has_static_mem_fun_fail2.cpp | 18 + src/boost/libs/tti/test/test_has_static_member.cpp | 26 ++ .../tti/test/test_has_static_member_compile.cpp | 26 ++ .../libs/tti/test/test_has_static_member_fail.cpp | 19 + .../libs/tti/test/test_has_static_member_fail2.cpp | 18 + src/boost/libs/tti/test/test_has_template.cpp | 28 ++ src/boost/libs/tti/test/test_has_template.hpp | 37 ++ .../libs/tti/test/test_has_template_compile.cpp | 28 ++ src/boost/libs/tti/test/test_has_template_cp.cpp | 30 ++ src/boost/libs/tti/test/test_has_template_cp.hpp | 24 ++ .../libs/tti/test/test_has_template_cp_compile.cpp | 30 ++ .../libs/tti/test/test_has_template_cp_fail.cpp | 19 + .../libs/tti/test/test_has_template_cp_fail2.cpp | 19 + .../libs/tti/test/test_has_template_cp_fail3.cpp | 19 + .../libs/tti/test/test_has_template_cp_fail4.cpp | 19 + src/boost/libs/tti/test/test_has_template_fail.cpp | 19 + .../libs/tti/test/test_has_template_fail2.cpp | 19 + .../libs/tti/test/test_has_template_fail3.cpp | 19 + .../libs/tti/test/test_has_template_fail4.cpp | 19 + src/boost/libs/tti/test/test_has_type.cpp | 30 ++ src/boost/libs/tti/test/test_has_type.hpp | 23 ++ src/boost/libs/tti/test/test_has_type_compile.cpp | 31 ++ src/boost/libs/tti/test/test_has_type_ct.cpp | 33 ++ .../libs/tti/test/test_has_type_ct_compile.cpp | 34 ++ src/boost/libs/tti/test/test_has_type_ct_fail.cpp | 22 ++ src/boost/libs/tti/test/test_has_type_ct_fail2.cpp | 22 ++ src/boost/libs/tti/test/test_has_type_ct_fail3.cpp | 21 + src/boost/libs/tti/test/test_has_type_ct_fail4.cpp | 21 + src/boost/libs/tti/test/test_has_type_ct_fail5.cpp | 22 ++ src/boost/libs/tti/test/test_has_type_fail.cpp | 19 + src/boost/libs/tti/test/test_has_type_fail2.cpp | 19 + src/boost/libs/tti/test/test_has_type_fail3.cpp | 18 + src/boost/libs/tti/test/test_mem_type.cpp | 34 ++ src/boost/libs/tti/test/test_mem_type.hpp | 24 ++ src/boost/libs/tti/test/test_mem_type_compile.cpp | 28 ++ src/boost/libs/tti/test/test_structs.hpp | 156 ++++++++ .../libs/tti/test/test_vm_has_template_cp.cpp | 34 ++ .../libs/tti/test/test_vm_has_template_cp.hpp | 30 ++ .../tti/test/test_vm_has_template_cp_compile.cpp | 34 ++ .../libs/tti/test/test_vm_has_template_cp_fail.cpp | 27 ++ .../tti/test/test_vm_has_template_cp_fail2.cpp | 27 ++ .../tti/test/test_vm_has_template_cp_fail3.cpp | 27 ++ .../tti/test/test_vm_has_template_cp_fail4.cpp | 27 ++ 104 files changed, 3044 insertions(+) create mode 100644 src/boost/libs/tti/test/Jamfile.v2 create mode 100644 src/boost/libs/tti/test/test_has_data.cpp create mode 100644 src/boost/libs/tti/test/test_has_data.hpp create mode 100644 src/boost/libs/tti/test/test_has_data_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_data_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_data_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_data_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_data_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_data_fail5.cpp create mode 100644 src/boost/libs/tti/test/test_has_data_fail6.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun.hpp create mode 100644 src/boost/libs/tti/test/test_has_fun_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_fun_fail5.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data.hpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data2.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_data_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun.hpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_fail5.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_cv_fail6.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_mem_fun_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_member.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_cv_fail5.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_member_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_data.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_data.hpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_data_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_data_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_data_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_data_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_fun.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_fun.hpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_fun_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_fun_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_mem_fun_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_member.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_member_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_member_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_static_member_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_template.cpp create mode 100644 src/boost/libs/tti/test/test_has_template.hpp create mode 100644 src/boost/libs/tti/test/test_has_template_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp.hpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_cp_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_template_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_type.cpp create mode 100644 src/boost/libs/tti/test/test_has_type.hpp create mode 100644 src/boost/libs/tti/test/test_has_type_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct_compile.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct_fail4.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_ct_fail5.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_fail.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_has_type_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_mem_type.cpp create mode 100644 src/boost/libs/tti/test/test_mem_type.hpp create mode 100644 src/boost/libs/tti/test/test_mem_type_compile.cpp create mode 100644 src/boost/libs/tti/test/test_structs.hpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp.cpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp.hpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp_compile.cpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp_fail.cpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp_fail2.cpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp_fail3.cpp create mode 100644 src/boost/libs/tti/test/test_vm_has_template_cp_fail4.cpp (limited to 'src/boost/libs/tti/test') diff --git a/src/boost/libs/tti/test/Jamfile.v2 b/src/boost/libs/tti/test/Jamfile.v2 new file mode 100644 index 00000000..e63ab201 --- /dev/null +++ b/src/boost/libs/tti/test/Jamfile.v2 @@ -0,0 +1,435 @@ + +# (C) Copyright Edward Diener 2011,2012 +# Use, modification and distribution are subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt). +# +# Tti testing Jamfile +# + +import testing ; + +project tti_tests : requirements on + gcc:all + msvc:all + gcc-4.3.0:-Wno-variadic-macros + gcc-4.4.0:-Wno-variadic-macros + gcc-4.4.7:-Wno-variadic-macros + gcc-4.5.0:-Wno-variadic-macros + gcc-4.5.0:"-Wl,--enable-auto-import" + gcc-4.5.2:-Wno-variadic-macros + gcc-4.6.0:-Wno-variadic-macros + gcc-4.6.1:-Wno-variadic-macros + gcc-4.6.2:-Wno-variadic-macros + gcc-4.6.3:-Wno-variadic-macros + gcc-4.7.0:-Wno-variadic-macros + gcc-4.7.2:-Wno-variadic-macros + ; + +# +# Member functions composite syntax +# +alias ttimfsig + : + [ run test_has_member.cpp ] + [ compile test_has_member_compile.cpp ] + [ compile-fail test_has_member_fail.cpp ] + [ compile-fail test_has_member_fail2.cpp ] + [ compile-fail test_has_member_fail3.cpp ] + ; + +# +# Member functions composite syntax, cv-qualified +# +alias ttimfsigcv + : + [ run test_has_member_cv.cpp ] + [ compile test_has_member_cv_compile.cpp ] + [ compile-fail test_has_member_cv_fail.cpp ] + [ compile-fail test_has_member_cv_fail2.cpp ] + [ compile-fail test_has_member_cv_fail3.cpp ] + [ compile-fail test_has_member_cv_fail4.cpp ] + [ compile-fail test_has_member_cv_fail5.cpp ] + ; + +# +# Member data +# +alias ttimd + : + [ run test_has_mem_data.cpp ] + [ run test_has_mem_data2.cpp ] + [ compile test_has_mem_data_compile.cpp ] + [ compile-fail test_has_mem_data_fail.cpp ] + [ compile-fail test_has_mem_data_fail2.cpp ] + [ compile-fail test_has_mem_data_fail3.cpp ] + ; + +# +# Member functions specific syntax +# +alias ttimfn + : + [ run test_has_mem_fun.cpp ] + [ compile test_has_mem_fun_compile.cpp ] + [ compile-fail test_has_mem_fun_fail.cpp ] + [ compile-fail test_has_mem_fun_fail2.cpp ] + [ compile-fail test_has_mem_fun_fail3.cpp ] + ; + +# +# Member functions specific syntax, cv-qualified +# +alias ttimfncv + : + [ run test_has_mem_fun_cv.cpp ] + [ compile test_has_mem_fun_cv_compile.cpp ] + [ compile-fail test_has_mem_fun_cv_fail.cpp ] + [ compile-fail test_has_mem_fun_cv_fail2.cpp ] + [ compile-fail test_has_mem_fun_cv_fail3.cpp ] + [ compile-fail test_has_mem_fun_cv_fail4.cpp ] + [ compile-fail test_has_mem_fun_cv_fail5.cpp ] + [ compile-fail test_has_mem_fun_cv_fail6.cpp ] + ; + +# +# Static member functions composite syntax +# +alias ttismfsig + : + [ run test_has_static_member.cpp ] + [ compile test_has_static_member_compile.cpp ] + [ compile-fail test_has_static_member_fail.cpp ] + [ compile-fail test_has_static_member_fail2.cpp ] + ; + +# +# Static member data +# +alias ttismd + : + [ run test_has_static_mem_data.cpp ] + [ compile test_has_static_mem_data_compile.cpp ] + [ compile-fail test_has_static_mem_data_fail.cpp ] + [ compile-fail test_has_static_mem_data_fail2.cpp ] + [ compile-fail test_has_static_mem_data_fail3.cpp ] + ; + +# +# Static member functions +# +alias ttismfn + : + [ run test_has_static_mem_fun.cpp ] + [ compile test_has_static_mem_fun_compile.cpp ] + [ compile-fail test_has_static_mem_fun_fail.cpp ] + [ compile-fail test_has_static_mem_fun_fail2.cpp ] + ; + +# +# Member or static member data +# +alias ttidata + : + [ run test_has_data.cpp ] + [ compile test_has_data_compile.cpp ] + [ compile-fail test_has_data_fail.cpp ] + [ compile-fail test_has_data_fail2.cpp ] + [ compile-fail test_has_data_fail3.cpp ] + [ compile-fail test_has_data_fail4.cpp ] + [ compile-fail test_has_data_fail5.cpp ] + [ compile-fail test_has_data_fail6.cpp ] + ; + +# +# Member or static member function +# +alias ttifun + : + [ run test_has_fun.cpp ] + [ compile test_has_fun_compile.cpp ] + [ compile-fail test_has_fun_fail.cpp ] + [ compile-fail test_has_fun_fail2.cpp ] + [ compile-fail test_has_fun_fail3.cpp ] + [ compile-fail test_has_fun_fail4.cpp ] + [ compile-fail test_has_fun_fail5.cpp ] + ; + +# +# Templates +# +alias ttitmp + : + [ run test_has_template.cpp : : : BOOST_PP_VARIADICS=0 ] + [ compile test_has_template_compile.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_fail.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_fail2.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_fail3.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_fail4.cpp : BOOST_PP_VARIADICS=0 ] + ; + +# +# Templates, check params +# +alias ttitmpcp + : + [ run test_has_template_cp.cpp : : : BOOST_PP_VARIADICS=0 ] + [ compile test_has_template_cp_compile.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_cp_fail.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_cp_fail2.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_cp_fail3.cpp : BOOST_PP_VARIADICS=0 ] + [ compile-fail test_has_template_cp_fail4.cpp : BOOST_PP_VARIADICS=0 ] + ; + +# +# Type +# +alias ttity + : + [ run test_has_type.cpp ] + [ compile test_has_type_compile.cpp ] + [ compile-fail test_has_type_fail.cpp ] + [ compile-fail test_has_type_fail2.cpp ] + [ compile-fail test_has_type_fail3.cpp ] + [ run test_has_type_ct.cpp ] + [ compile test_has_type_ct_compile.cpp ] + [ compile-fail test_has_type_ct_fail.cpp ] + [ compile-fail test_has_type_ct_fail2.cpp ] + [ compile-fail test_has_type_ct_fail3.cpp ] + [ compile-fail test_has_type_ct_fail4.cpp ] + [ compile-fail test_has_type_ct_fail5.cpp ] + ; + +# +# Nested type +# +alias ttimemty + : + [ run test_mem_type.cpp ] + [ compile test_mem_type_compile.cpp ] + ; +# +# All of tti, non-variadic macros +# +alias ttinovm : ttimfsig ttimfsigcv ttimd ttimfn ttimfncv ttismfsig ttismd ttismfn ttidata ttifun ttitmp ttitmpcp ttity ttimemty ; + +alias ttitmpv : : + gcc + 3.4.2 + ; + +alias ttitmpv : : + gcc + 3.4.5 + ; + +alias ttitmpv : : + gcc + 4.1.2 + ; + +alias ttitmpv : : + gcc + 4.2.1 + ; + +# +# Templates, variadic macro +# +alias ttitmpv + : + [ run test_has_template.cpp : : : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_v ] + [ compile test_has_template_compile.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_compile_v ] + [ compile-fail test_has_template_fail.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_fail_v ] + [ compile-fail test_has_template_fail2.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_fail2_v ] + [ compile-fail test_has_template_fail3.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_fail3_v ] + [ compile-fail test_has_template_fail4.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_fail4_v ] + ; + +alias ttitmpcpv : : + gcc + 3.4.2 + ; + +alias ttitmpcpv : : + gcc + 3.4.5 + ; + +alias ttitmpcpv : : + gcc + 4.1.2 + ; + +alias ttitmpcpv : : + gcc + 4.2.1 + ; + +# +# Templates, variadic macro, check params, non-variadic syntax +# +alias ttitmpcpv + : + [ run test_has_template_cp.cpp : : : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_cp_v ] + [ compile test_has_template_cp_compile.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_cp_compile_v ] + [ compile-fail test_has_template_cp_fail.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_cp_fail_v ] + [ compile-fail test_has_template_cp_fail2.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_cp_fail2_v ] + [ compile-fail test_has_template_cp_fail3.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_cp_fail3_v ] + [ compile-fail test_has_template_cp_fail4.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 : + test_has_template_cp_fail4_v ] + ; + +alias ttitmpcpvm : : + gcc + 3.4.2 + ; + +alias ttitmpcpvm : : + gcc + 3.4.5 + ; + +alias ttitmpcpvm : : + gcc + 4.1.2 + ; + +alias ttitmpcpvm : : + gcc + 4.2.1 + ; + +# +# Templates, variadic macro, check params, variadic syntax +# +alias ttitmpcpvm + : + [ run test_vm_has_template_cp.cpp : : : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 ] + [ compile test_vm_has_template_cp_compile.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 ] + [ compile-fail test_vm_has_template_cp_fail.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 ] + [ compile-fail test_vm_has_template_cp_fail2.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 ] + [ compile-fail test_vm_has_template_cp_fail3.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 ] + [ compile-fail test_vm_has_template_cp_fail4.cpp : + gcc:-std=c++0x + gcc-4.3.0:-U__STRICT_ANSI__ + gcc-4.4.0:-U__STRICT_ANSI__ + gcc-4.4.7:-U__STRICT_ANSI__ + BOOST_PP_VARIADICS=1 ] + ; + +# +# Templates, non-variadic macro +# +alias ttitemplate : ttitmp ttitmpcp ; + +# +# Templates, variadic macro +# +alias ttivm : ttitmpv ttitmpcpv ttitmpcpvm ; + +# +# All templates +# +alias ttitemplate_all : ttitemplate ttivm ; + +# +# All tests +# +alias tti : ttinovm ttivm ; diff --git a/src/boost/libs/tti/test/test_has_data.cpp b/src/boost/libs/tti/test/test_has_data.cpp new file mode 100644 index 00000000..4c705717 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data.cpp @@ -0,0 +1,37 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(AnInt)::value)); + BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(SomeStaticData)::value)); + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(AnInt)::value)); + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(DSMember)::value)); + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(aMember)::value)); + BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(aMember)::value)); + BOOST_TEST((DCMember::value)); + BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(someDataMember)::value)); + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(IntBT)::value)); + BOOST_TEST((DStatName::value)); + BOOST_TEST((DNestedData::value)); + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(CIntValue)::value)); + BOOST_TEST((DAOther::value)); + BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(ONestStr)::value)); + + // Passing non-class enclosing type will return false + + BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(IntBT)::value)); + BOOST_TEST((!DCMember::value)); + BOOST_TEST((!DCMember::value)); + BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(AnInt)::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_data.hpp b/src/boost/libs/tti/test/test_has_data.hpp new file mode 100644 index 00000000..c48dc1c2 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_DATA_HPP) +#define TEST_HAS_DATA_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_DATA(AnInt) +BOOST_TTI_HAS_DATA(DSMember) +BOOST_TTI_HAS_DATA(aMember) +BOOST_TTI_TRAIT_HAS_DATA(DCMember,cMem) +BOOST_TTI_HAS_DATA(someDataMember) +BOOST_TTI_HAS_DATA(CIntValue) +BOOST_TTI_HAS_DATA(SomeStaticData) +BOOST_TTI_TRAIT_HAS_DATA(DStatName,AnStat) +BOOST_TTI_HAS_DATA(IntBT) +BOOST_TTI_TRAIT_HAS_DATA(DNestedData,NestedCT) +BOOST_TTI_TRAIT_HAS_DATA(DAOther,OtherAT) +BOOST_TTI_HAS_DATA(ONestStr) + +#endif // TEST_HAS_DATA_HPP diff --git a/src/boost/libs/tti/test/test_has_data_compile.cpp b/src/boost/libs/tti/test/test_has_data_compile.cpp new file mode 100644 index 00000000..4480d033 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_compile.cpp @@ -0,0 +1,36 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_DATA_GEN(aMember) aVar; + BOOST_TTI_HAS_DATA_GEN(SomeStaticData) aVar2; + BOOST_TTI_HAS_DATA_GEN(someDataMember) aVar3; + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(AnInt))); + BOOST_MPL_ASSERT_NOT((BOOST_TTI_HAS_DATA_GEN(SomeStaticData))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(AnInt))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(DSMember))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(aMember))); + BOOST_MPL_ASSERT_NOT((BOOST_TTI_HAS_DATA_GEN(aMember))); + BOOST_MPL_ASSERT((DCMember)); + BOOST_MPL_ASSERT_NOT((BOOST_TTI_HAS_DATA_GEN(someDataMember))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(IntBT))); + BOOST_MPL_ASSERT((DStatName)); + BOOST_MPL_ASSERT((DNestedData)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(CIntValue))); + BOOST_MPL_ASSERT((DAOther)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(ONestStr))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_data_fail.cpp b/src/boost/libs/tti/test/test_has_data_fail.cpp new file mode 100644 index 00000000..edff6235 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" +#include + +int main() + { + + // someDataMember does not exist at all + + BOOST_MPL_ASSERT(( BOOST_TTI_HAS_DATA_GEN(someDataMember) )); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_data_fail2.cpp b/src/boost/libs/tti/test/test_has_data_fail2.cpp new file mode 100644 index 00000000..6383c36e --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" +#include + +int main() + { + + // Wrong data signature for aMember + + BOOST_MPL_ASSERT(( BOOST_TTI_HAS_DATA_GEN(aMember) )); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_data_fail3.cpp b/src/boost/libs/tti/test/test_has_data_fail3.cpp new file mode 100644 index 00000000..a5567cdf --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_fail3.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" + +int main() + { + + // Data signature has type which does not exist + + BOOST_TTI_HAS_DATA_GEN(aMember) aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_data_fail4.cpp b/src/boost/libs/tti/test/test_has_data_fail4.cpp new file mode 100644 index 00000000..fbe5fee0 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_fail4.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" +#include + +int main() + { + + // SomeStaticData does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(SomeStaticData))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_data_fail5.cpp b/src/boost/libs/tti/test/test_has_data_fail5.cpp new file mode 100644 index 00000000..a2470014 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_fail5.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" +#include + +int main() + { + + // Wrong enclosing type for DSMember + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(DSMember))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_data_fail6.cpp b/src/boost/libs/tti/test/test_has_data_fail6.cpp new file mode 100644 index 00000000..95a2a9f5 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_data_fail6.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_data.hpp" + +int main() + { + + // Data signature has type which does not exist + + BOOST_TTI_HAS_DATA_GEN(DSMember) aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_fun.cpp b/src/boost/libs/tti/test/test_has_fun.cpp new file mode 100644 index 00000000..8a4f7216 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun.cpp @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(VoidFunction)::value)); + BOOST_TEST((HaveTheSIntFunction >::value)); + BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(TSFunction) >::value)); + BOOST_TEST((FunctionReturningInt::value)); + BOOST_TEST((!Pickedname::value)); + BOOST_TEST((!TheTIntFunction >::value)); + BOOST_TEST((FunctionReturningInt >::value)); + BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(aFunction) >::value)); + BOOST_TEST((AnotherIntFunction >::value)); + BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(sFunction) >::value)); + BOOST_TEST((!BOOST_TTI_HAS_FUNCTION_GEN(someFunctionMember) >::value)); + BOOST_TEST((TheTIntFunction >::value)); + + // Passing non-class enclosing type will return false + + BOOST_TEST((!HaveTheSIntFunction >::value)); + BOOST_TEST((!BOOST_TTI_HAS_FUNCTION_GEN(TSFunction) >::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_fun.hpp b/src/boost/libs/tti/test/test_has_fun.hpp new file mode 100644 index 00000000..dd4a7bb5 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun.hpp @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(BOOST_TEST_HAS_FUNCTION_HPP) +#define BOOST_TEST_HAS_FUNCTION_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_FUNCTION(VoidFunction) +BOOST_TTI_TRAIT_HAS_FUNCTION(TheTIntFunction,TIntFunction) +BOOST_TTI_TRAIT_HAS_FUNCTION(FunctionReturningInt,IntFunction) +BOOST_TTI_HAS_FUNCTION(aFunction) +BOOST_TTI_TRAIT_HAS_FUNCTION(AnotherIntFunction,anotherFunction) +BOOST_TTI_TRAIT_HAS_FUNCTION(Pickedname,SomeStaticFunction) +BOOST_TTI_HAS_FUNCTION(sFunction) +BOOST_TTI_HAS_FUNCTION(someFunctionMember) +BOOST_TTI_TRAIT_HAS_FUNCTION(HaveTheSIntFunction,SIntFunction) +BOOST_TTI_HAS_FUNCTION(TSFunction) + +#endif // BOOST_TEST_HAS_FUNCTION_HPP diff --git a/src/boost/libs/tti/test/test_has_fun_compile.cpp b/src/boost/libs/tti/test/test_has_fun_compile.cpp new file mode 100644 index 00000000..7f0e36c9 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun_compile.cpp @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + TheTIntFunction > aVar; + BOOST_TTI_HAS_FUNCTION_GEN(someFunctionMember) > aVar2; + Pickedname > aVar3; + + // Compile time asserts + + BOOST_MPL_ASSERT((TheTIntFunction >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(VoidFunction))); + BOOST_MPL_ASSERT((FunctionReturningInt)); + BOOST_MPL_ASSERT((FunctionReturningInt >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(TSFunction) >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(aFunction) >)); + BOOST_MPL_ASSERT((AnotherIntFunction >)); + BOOST_MPL_ASSERT((HaveTheSIntFunction >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(sFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_fun_fail.cpp b/src/boost/libs/tti/test/test_has_fun_fail.cpp new file mode 100644 index 00000000..d80b6411 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" +#include + +int main() + { + + // Wrong function signature for sFunction + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(sFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_fun_fail2.cpp b/src/boost/libs/tti/test/test_has_fun_fail2.cpp new file mode 100644 index 00000000..bbc465bb --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun_fail2.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" + +int main() + { + + // Function signature has type which does not exist + + BOOST_TTI_HAS_FUNCTION_GEN(sFunction) > aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_fun_fail3.cpp b/src/boost/libs/tti/test/test_has_fun_fail3.cpp new file mode 100644 index 00000000..9d830f5f --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" +#include + +int main() + { + + // Wrong function signature for SIntFunction + + BOOST_MPL_ASSERT((HaveTheSIntFunction >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_fun_fail4.cpp b/src/boost/libs/tti/test/test_has_fun_fail4.cpp new file mode 100644 index 00000000..54e0dbde --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun_fail4.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" + +int main() + { + + // Function signature has type which does not exist + + BOOST_TTI_HAS_FUNCTION_GEN(TSFunction) > aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_fun_fail5.cpp b/src/boost/libs/tti/test/test_has_fun_fail5.cpp new file mode 100644 index 00000000..3eea9daf --- /dev/null +++ b/src/boost/libs/tti/test/test_has_fun_fail5.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2012,2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_fun.hpp" +#include + +int main() + { + + // With default parameters you must still specify complete function prototype + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(aFunction))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_data.cpp b/src/boost/libs/tti/test/test_has_mem_data.cpp new file mode 100644 index 00000000..505862c0 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data.cpp @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_data.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)::value)); + BOOST_TEST((CMember::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_DATA_GEN(someDataMember)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(IntBT)::value)); + BOOST_TEST((NestedData::value)); + BOOST_TEST((AOther::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(ONestStr)::value)); + + // Test enclosing class as non-class type + + BOOST_TEST((!CMember::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_DATA_GEN(IntBT)::value)); + BOOST_TEST((!AOther::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_mem_data.hpp b/src/boost/libs/tti/test/test_has_mem_data.hpp new file mode 100644 index 00000000..1238c0d8 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data.hpp @@ -0,0 +1,22 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_MEMBER_DATA_HPP) +#define TEST_HAS_MEMBER_DATA_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_MEMBER_DATA(AnInt) +BOOST_TTI_HAS_MEMBER_DATA(aMember) +BOOST_TTI_TRAIT_HAS_MEMBER_DATA(CMember,cMem) +BOOST_TTI_HAS_MEMBER_DATA(someDataMember) +BOOST_TTI_HAS_MEMBER_DATA(IntBT) +BOOST_TTI_TRAIT_HAS_MEMBER_DATA(NestedData,NestedCT) +BOOST_TTI_TRAIT_HAS_MEMBER_DATA(AOther,OtherAT) +BOOST_TTI_HAS_MEMBER_DATA(ONestStr) + +#endif // TEST_HAS_MEMBER_DATA_HPP diff --git a/src/boost/libs/tti/test/test_has_mem_data2.cpp b/src/boost/libs/tti/test/test_has_mem_data2.cpp new file mode 100644 index 00000000..a39cc0d5 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data2.cpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_data.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)::value)); + BOOST_TEST((CMember::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_DATA_GEN(someDataMember)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(IntBT)::value)); + BOOST_TEST((NestedData::value)); + BOOST_TEST((AOther::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_DATA_GEN(ONestStr)::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_mem_data_compile.cpp b/src/boost/libs/tti/test/test_has_mem_data_compile.cpp new file mode 100644 index 00000000..e5d31f18 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data_compile.cpp @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_data.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember) aVar; + BOOST_TTI_HAS_MEMBER_DATA_GEN(someDataMember) aVar2; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember))); + BOOST_MPL_ASSERT((CMember)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(IntBT))); + BOOST_MPL_ASSERT((NestedData)); + BOOST_MPL_ASSERT((AOther)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(ONestStr))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_data_fail.cpp b/src/boost/libs/tti/test/test_has_mem_data_fail.cpp new file mode 100644 index 00000000..50d059e4 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_data.hpp" +#include + +int main() + { + + // someDataMember does not exist at all + + BOOST_MPL_ASSERT(( BOOST_TTI_HAS_MEMBER_DATA_GEN(someDataMember) )); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_data_fail2.cpp b/src/boost/libs/tti/test/test_has_mem_data_fail2.cpp new file mode 100644 index 00000000..b0f782ab --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_data.hpp" +#include + +int main() + { + + // Wrong data signature for aMember + + BOOST_MPL_ASSERT(( BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember) )); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_data_fail3.cpp b/src/boost/libs/tti/test/test_has_mem_data_fail3.cpp new file mode 100644 index 00000000..eeefccab --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_data_fail3.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_data.hpp" + +int main() + { + + // Data signature has type which does not exist + + BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember) aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun.cpp b/src/boost/libs/tti/test/test_has_mem_fun.cpp new file mode 100644 index 00000000..ce1488f5 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction)::value)); + BOOST_TEST((FunctionReturningInt::value)); + BOOST_TEST((FunctionReturningInt >::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction) >::value)); + BOOST_TEST((AnotherIntFunction >::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) >::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember) >::value)); + + // Test enclosing class as non-class type + + BOOST_TEST((!AnotherIntFunction >::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction)::value)); + BOOST_TEST((!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) >::value)); + BOOST_TEST((!FunctionReturningInt::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun.hpp b/src/boost/libs/tti/test/test_has_mem_fun.hpp new file mode 100644 index 00000000..84ce95fc --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun.hpp @@ -0,0 +1,35 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_MEMBER_FUNCTION_HPP) +#define TEST_HAS_MEMBER_FUNCTION_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_MEMBER_FUNCTION(VoidFunction) +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(FunctionReturningInt,IntFunction) +BOOST_TTI_HAS_MEMBER_FUNCTION(aFunction) +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(AnotherIntFunction,anotherFunction) +BOOST_TTI_HAS_MEMBER_FUNCTION(sFunction) +BOOST_TTI_HAS_MEMBER_FUNCTION(someFunctionMember) + +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(AskIfConst,WFunction) // const +BOOST_TTI_HAS_MEMBER_FUNCTION(AnotherConstFunction) // const +BOOST_TTI_HAS_MEMBER_FUNCTION(AConstFunction) // const +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(StillTest,StillSame) // const + +BOOST_TTI_HAS_MEMBER_FUNCTION(AVolatileFunction) // volatile +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(Volly,VolFunction) // volatile +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(AnVol,AnotherVolatileFunction) // volatile +BOOST_TTI_HAS_MEMBER_FUNCTION(StillVolatile) // volatile + +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(CVBoth,ACVFunction) // const volatile +BOOST_TTI_HAS_MEMBER_FUNCTION(ConstVolFunction) // const volatile +BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(CVAnother,AnotherConstVolatileFunction) // const volatile +BOOST_TTI_HAS_MEMBER_FUNCTION(StillCV) // const volatile + +#endif // TEST_HAS_MEMBER_FUNCTION_HPP diff --git a/src/boost/libs/tti/test/test_has_mem_fun_compile.cpp b/src/boost/libs/tti/test/test_has_mem_fun_compile.cpp new file mode 100644 index 00000000..58a65fdb --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_compile.cpp @@ -0,0 +1,28 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember) > aVar3; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction))); + BOOST_MPL_ASSERT((FunctionReturningInt)); + BOOST_MPL_ASSERT((FunctionReturningInt >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction) >)); + BOOST_MPL_ASSERT((AnotherIntFunction >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv.cpp new file mode 100644 index 00000000..adb6c97e --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv.cpp @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Use const enclosing type + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AConstFunction) >::value)); + BOOST_TEST((StillTest >::value)); + + // Use const_qualified + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AnotherConstFunction),boost::function_types::const_qualified>::value)); + BOOST_TEST((AskIfConst,boost::function_types::const_qualified>::value)); + + // Use volatile enclosing type + + BOOST_TEST((AnVol >::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction) >::value)); + + // Use volatile_qualified + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillVolatile),boost::function_types::volatile_qualified>::value)); + BOOST_TEST((Volly,boost::function_types::volatile_qualified>::value)); + + // Use const volatile enclosing type + + BOOST_TEST((CVAnother >::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV) >::value)); + + // Use cv_qualified + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(ConstVolFunction),boost::function_types::cv_qualified>::value)); + BOOST_TEST((CVBoth,boost::function_types::cv_qualified>::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_compile.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_compile.cpp new file mode 100644 index 00000000..f424cce4 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_compile.cpp @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors even if the member function does not exist + + BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember),boost::function_types::const_qualified> aVar1; + + // Use const enclosing type + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AnotherConstFunction) >)); + BOOST_MPL_ASSERT((AskIfConst >)); + + // Use const_qualified + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AConstFunction),boost::function_types::const_qualified>)); + BOOST_MPL_ASSERT((StillTest,boost::function_types::const_qualified>)); + + // Use volatile enclosing type + + BOOST_MPL_ASSERT((AnVol >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction) >)); + + // Use volatile_qualified + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillVolatile),boost::function_types::volatile_qualified>)); + BOOST_MPL_ASSERT((Volly,boost::function_types::volatile_qualified>)); + + // Use const volatile enclosing type + + BOOST_MPL_ASSERT((CVAnother >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV) >)); + + // Use cv_qualified + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(ConstVolFunction),boost::function_types::cv_qualified>)); + BOOST_MPL_ASSERT((CVBoth,boost::function_types::cv_qualified>)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_fail.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail.cpp new file mode 100644 index 00000000..97d79466 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is const + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AnotherConstFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_fail2.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail2.cpp new file mode 100644 index 00000000..7520b4d4 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is not const + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_fail3.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail3.cpp new file mode 100644 index 00000000..4c6bffb7 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is const volatile + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(ConstVolFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_fail4.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail4.cpp new file mode 100644 index 00000000..4f807c98 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail4.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is volatile + + BOOST_MPL_ASSERT((Volly,boost::function_types::cv_qualified>)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_fail5.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail5.cpp new file mode 100644 index 00000000..518df247 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail5.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // With default parameters you must still specify complete member function prototype + + BOOST_MPL_ASSERT((AskIfConst >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_cv_fail6.cpp b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail6.cpp new file mode 100644 index 00000000..e3e3589a --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_cv_fail6.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // With default parameters you must still specify complete member function prototype + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_fail.cpp b/src/boost/libs/tti/test/test_has_mem_fun_fail.cpp new file mode 100644 index 00000000..8ca70590 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Wrong function signature for sFunction + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_fail2.cpp b/src/boost/libs/tti/test/test_has_mem_fun_fail2.cpp new file mode 100644 index 00000000..df3e4b9e --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_fail2.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" + +int main() + { + + // Function signature has type which does not exist + + BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) > aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_mem_fun_fail3.cpp b/src/boost/libs/tti/test/test_has_mem_fun_fail3.cpp new file mode 100644 index 00000000..414e02ec --- /dev/null +++ b/src/boost/libs/tti/test/test_has_mem_fun_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011,2012,2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // With default parameters you must still specify complete member function prototype + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member.cpp b/src/boost/libs/tti/test/test_has_member.cpp new file mode 100644 index 00000000..4ce46335 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member.cpp @@ -0,0 +1,23 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction)::value)); + BOOST_TEST(FunctionReturningInt::value); + BOOST_TEST(FunctionReturningInt::value); + BOOST_TEST(BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction)::value); + BOOST_TEST(AnotherIntFunction::value); + BOOST_TEST(BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)::value); + BOOST_TEST(!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember)::value); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_member_compile.cpp b/src/boost/libs/tti/test/test_has_member_compile.cpp new file mode 100644 index 00000000..372ad028 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_compile.cpp @@ -0,0 +1,28 @@ + +// (C) Copyright Edward Diener 2011,2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember) aVar3; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction))); + BOOST_MPL_ASSERT((FunctionReturningInt)); + BOOST_MPL_ASSERT((FunctionReturningInt)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction))); + BOOST_MPL_ASSERT((AnotherIntFunction)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv.cpp b/src/boost/libs/tti/test/test_has_member_cv.cpp new file mode 100644 index 00000000..44db949d --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv.cpp @@ -0,0 +1,36 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Use const + + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AConstFunction)::value)); + BOOST_TEST((StillTest::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AnotherConstFunction)::value)); + BOOST_TEST((AskIfConst::value)); + + // Use volatile + + BOOST_TEST((AnVol::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillVolatile)::value)); + BOOST_TEST((Volly::value)); + + // Use const volatile + + BOOST_TEST((CVAnother::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV)::value)); + BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(ConstVolFunction)::value)); + BOOST_TEST((CVBoth::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv_compile.cpp b/src/boost/libs/tti/test/test_has_member_cv_compile.cpp new file mode 100644 index 00000000..4a11d222 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv_compile.cpp @@ -0,0 +1,40 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember) aVar1; + + // Use const + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AConstFunction))); + BOOST_MPL_ASSERT((StillTest)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AnotherConstFunction))); + BOOST_MPL_ASSERT((AskIfConst)); + + // Use volatile + + BOOST_MPL_ASSERT((AnVol)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillVolatile))); + BOOST_MPL_ASSERT((Volly)); + + // Use const volatile + + BOOST_MPL_ASSERT((CVAnother)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(ConstVolFunction))); + BOOST_MPL_ASSERT((CVBoth)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv_fail.cpp b/src/boost/libs/tti/test/test_has_member_cv_fail.cpp new file mode 100644 index 00000000..54882478 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is not const + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv_fail2.cpp b/src/boost/libs/tti/test/test_has_member_cv_fail2.cpp new file mode 100644 index 00000000..a194dc46 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is const + + BOOST_MPL_ASSERT((AskIfConst)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv_fail3.cpp b/src/boost/libs/tti/test/test_has_member_cv_fail3.cpp new file mode 100644 index 00000000..a1a5c3f7 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is const volatile, not volatile + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv_fail4.cpp b/src/boost/libs/tti/test/test_has_member_cv_fail4.cpp new file mode 100644 index 00000000..8cf40d31 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv_fail4.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Member function is volatile, not const + + BOOST_MPL_ASSERT((AnVol)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_cv_fail5.cpp b/src/boost/libs/tti/test/test_has_member_cv_fail5.cpp new file mode 100644 index 00000000..c973b750 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_cv_fail5.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // With default parameters you must still specify complete member function prototype + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_fail.cpp b/src/boost/libs/tti/test/test_has_member_fail.cpp new file mode 100644 index 00000000..aeb4f669 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // Wrong function signature for sFunction + + BOOST_MPL_ASSERT(( BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) )); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_fail2.cpp b/src/boost/libs/tti/test/test_has_member_fail2.cpp new file mode 100644 index 00000000..53dc4676 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_fail2.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" + +int main() + { + + // Function signature has type which does not exist + + BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction) aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_member_fail3.cpp b/src/boost/libs/tti/test/test_has_member_fail3.cpp new file mode 100644 index 00000000..2e0df8d4 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_member_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011,2012,2013 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_mem_fun.hpp" +#include + +int main() + { + + // With default parameters you must still specify complete member function prototype + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_data.cpp b/src/boost/libs/tti/test/test_has_static_mem_data.cpp new file mode 100644 index 00000000..395b6746 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_data.cpp @@ -0,0 +1,25 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_data.hpp" +#include + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember)::value)); + BOOST_TEST((!BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(SomeStaticData)::value)); + BOOST_TEST((StatName::value)); + BOOST_TEST((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(CIntValue)::value)); + + // Passing non-class enclosing type will return false + + BOOST_TEST((!BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember)::value)); + BOOST_TEST((!StatName::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_data.hpp b/src/boost/libs/tti/test/test_has_static_mem_data.hpp new file mode 100644 index 00000000..8aac6e9f --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_data.hpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_STATIC_MEMBER_DATA_HPP) +#define TEST_HAS_STATIC_MEMBER_DATA_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_STATIC_MEMBER_DATA(DSMember) +BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(StatName,AnStat) +BOOST_TTI_HAS_STATIC_MEMBER_DATA(SomeStaticData) +BOOST_TTI_HAS_STATIC_MEMBER_DATA(CIntValue) + +#endif // TEST_HAS_STATIC_MEMBER_DATA_HPP diff --git a/src/boost/libs/tti/test/test_has_static_mem_data_compile.cpp b/src/boost/libs/tti/test/test_has_static_mem_data_compile.cpp new file mode 100644 index 00000000..a1916444 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_data_compile.cpp @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_data.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(SomeStaticData) aVar2; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember))); + BOOST_MPL_ASSERT((StatName)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_data_fail.cpp b/src/boost/libs/tti/test/test_has_static_mem_data_fail.cpp new file mode 100644 index 00000000..25a6a150 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_data_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_data.hpp" +#include + +int main() + { + + // SomeStaticData does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(SomeStaticData))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_data_fail2.cpp b/src/boost/libs/tti/test/test_has_static_mem_data_fail2.cpp new file mode 100644 index 00000000..826f5fea --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_data_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_data.hpp" +#include + +int main() + { + + // Wrong enclosing type for DSMember + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_data_fail3.cpp b/src/boost/libs/tti/test/test_has_static_mem_data_fail3.cpp new file mode 100644 index 00000000..61728fc9 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_data_fail3.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_data.hpp" + +int main() + { + + // Data signature has type which does not exist + + BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember) aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_fun.cpp b/src/boost/libs/tti/test/test_has_static_mem_fun.cpp new file mode 100644 index 00000000..d9227851 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_fun.cpp @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" +#include + +int main() + { + + BOOST_TEST((HaveTheSIntFunction >::value)); + BOOST_TEST((!TheTIntFunction >::value)); + BOOST_TEST((TheTIntFunction >::value)); + BOOST_TEST((TheTIntFunction::value)); + BOOST_TEST((BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction) >::value)); + BOOST_TEST((!Pickedname::value)); + + // Passing non-class enclosing type will return false + + BOOST_TEST((!TheTIntFunction >::value)); + BOOST_TEST((!BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction) >::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_fun.hpp b/src/boost/libs/tti/test/test_has_static_mem_fun.hpp new file mode 100644 index 00000000..4617f57e --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_fun.hpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_STATIC_MEMBER_FUNCTION_HPP) +#define TEST_HAS_STATIC_MEMBER_FUNCTION_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(HaveTheSIntFunction,SIntFunction) +BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(TheTIntFunction,TIntFunction) +BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(TSFunction) +BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(Pickedname,SomeStaticFunction) + +#endif // TEST_HAS_STATIC_MEMBER_FUNCTION_HPP diff --git a/src/boost/libs/tti/test/test_has_static_mem_fun_compile.cpp b/src/boost/libs/tti/test/test_has_static_mem_fun_compile.cpp new file mode 100644 index 00000000..9636d848 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_fun_compile.cpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + TheTIntFunction > aVar; + Pickedname > aVar3; + + // Compile time asserts + + BOOST_MPL_ASSERT((HaveTheSIntFunction >)); + BOOST_MPL_ASSERT((TheTIntFunction >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_fun_fail.cpp b/src/boost/libs/tti/test/test_has_static_mem_fun_fail.cpp new file mode 100644 index 00000000..6f522a20 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_fun_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" +#include + +int main() + { + + // Wrong function signature for SIntFunction + + BOOST_MPL_ASSERT((HaveTheSIntFunction >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_mem_fun_fail2.cpp b/src/boost/libs/tti/test/test_has_static_mem_fun_fail2.cpp new file mode 100644 index 00000000..5fbe0430 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_mem_fun_fail2.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" + +int main() + { + + // Function signature has type which does not exist + + BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction) > aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_member.cpp b/src/boost/libs/tti/test/test_has_static_member.cpp new file mode 100644 index 00000000..2a9f7763 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_member.cpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" +#include + +int main() + { + + BOOST_TEST((HaveTheSIntFunction::value)); + BOOST_TEST((!TheTIntFunction::value)); + BOOST_TEST((TheTIntFunction::value)); + BOOST_TEST((BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction)::value)); + BOOST_TEST((!Pickedname::value)); + + // Passing non-class enclosing type will return false + + BOOST_TEST((!TheTIntFunction::value)); + BOOST_TEST((!BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction)::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_static_member_compile.cpp b/src/boost/libs/tti/test/test_has_static_member_compile.cpp new file mode 100644 index 00000000..f9c1bb42 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_member_compile.cpp @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + TheTIntFunction aVar; + Pickedname aVar3; + + // Compile time asserts + + BOOST_MPL_ASSERT((HaveTheSIntFunction)); + BOOST_MPL_ASSERT((TheTIntFunction)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_member_fail.cpp b/src/boost/libs/tti/test/test_has_static_member_fail.cpp new file mode 100644 index 00000000..cf65d696 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_member_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" +#include + +int main() + { + + // Wrong function signature for SIntFunction + + BOOST_MPL_ASSERT((HaveTheSIntFunction)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_static_member_fail2.cpp b/src/boost/libs/tti/test/test_has_static_member_fail2.cpp new file mode 100644 index 00000000..5fcbaab0 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_static_member_fail2.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_static_mem_fun.hpp" + +int main() + { + + // Function signature has type which does not exist + + BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(TSFunction) aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template.cpp b/src/boost/libs/tti/test/test_has_template.cpp new file mode 100644 index 00000000..d6ca303f --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template.cpp @@ -0,0 +1,28 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template.hpp" +#include + +int main() + { + + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate)::value); + BOOST_TEST(HaveCL::value); + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate)::value); + BOOST_TEST(!HaveAnotherMT::value); + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate)::value); + BOOST_TEST(!ATemplateWithParms::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP)::value); + + // Passing non-class enclosing type will return false + + BOOST_TEST(!HaveCL::value); + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP)::value); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_template.hpp b/src/boost/libs/tti/test/test_has_template.hpp new file mode 100644 index 00000000..cfd61891 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template.hpp @@ -0,0 +1,37 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_TEMPLATE_HPP) +#define TEST_HAS_TEMPLATE_HPP + +#include "test_structs.hpp" +#include + +#if BOOST_PP_VARIADICS + +BOOST_TTI_HAS_TEMPLATE(ATPMemberTemplate) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveCL,CLMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(AMemberTemplate) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveAnotherMT,AnotherMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(SomeMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_TRAIT_HAS_TEMPLATE(ATemplateWithParms,ManyParameters) +BOOST_TTI_HAS_TEMPLATE(SimpleTMP,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(TemplateNotExist) + +#else // !BOOST_PP_VARIADICS + +BOOST_TTI_HAS_TEMPLATE(ATPMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveCL,CLMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(AMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveAnotherMT,AnotherMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(SomeMemberTemplate,BOOST_PP_NIL) +BOOST_TTI_TRAIT_HAS_TEMPLATE(ATemplateWithParms,ManyParameters,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(SimpleTMP,BOOST_PP_NIL) +BOOST_TTI_HAS_TEMPLATE(TemplateNotExist,BOOST_PP_NIL) + +#endif // BOOST_PP_VARIADICS + +#endif // TEST_HAS_TEMPLATE_HPP diff --git a/src/boost/libs/tti/test/test_has_template_compile.cpp b/src/boost/libs/tti/test/test_has_template_compile.cpp new file mode 100644 index 00000000..f789036c --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_compile.cpp @@ -0,0 +1,28 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate) aVar; + HaveAnotherMT aVar2; + BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate) aVar3; + BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist) aVar4; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate))); + BOOST_MPL_ASSERT((HaveCL)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_cp.cpp b/src/boost/libs/tti/test/test_has_template_cp.cpp new file mode 100644 index 00000000..b155de7d --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template_cp.hpp" +#include + +int main() + { + + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate)::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate)::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate)::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP)::value); + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist)::value); + + BOOST_TEST(HaveCL::value); + BOOST_TEST(HaveAnotherMT::value); + BOOST_TEST(ATemplateWithParms::value); + + // Passing non-class enclosing type will return false + + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate)::value); + BOOST_TEST(!HaveAnotherMT::value); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_template_cp.hpp b/src/boost/libs/tti/test/test_has_template_cp.hpp new file mode 100644 index 00000000..001f7463 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp.hpp @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_TEMPLATE_CHECK_PARAMS_HPP) +#define TEST_HAS_TEMPLATE_CHECK_PARAMS_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_TEMPLATE(ATPMemberTemplate,(1,(class))) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveCL,CLMemberTemplate,(2,(class,class))) +BOOST_TTI_HAS_TEMPLATE(AMemberTemplate,(1,(int))) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveAnotherMT,AnotherMemberTemplate,(2,(int,int))) +BOOST_TTI_HAS_TEMPLATE(SomeMemberTemplate,(6,(class,class,class,class,class,class))) +BOOST_TTI_TRAIT_HAS_TEMPLATE(ATemplateWithParms,ManyParameters,(7,(class,class,int,class,template class,class,long))) +BOOST_TTI_HAS_TEMPLATE(SimpleTMP,(4,(class,class,class,class))) +BOOST_TTI_HAS_TEMPLATE(TemplateNotExist,(3,(int,class,template class ATemplate))) +BOOST_TTI_TRAIT_HAS_TEMPLATE(WrongParametersForMP,ManyParameters,(8,(class,class,int,class,template class,class,long))) +BOOST_TTI_TRAIT_HAS_TEMPLATE(WrongParameters2ForMP,ManyParameters,(7,(class,long,int,class,template class,class,long))) + +#endif // TEST_HAS_TEMPLATE_CHECK_PARAMS_HPP diff --git a/src/boost/libs/tti/test/test_has_template_cp_compile.cpp b/src/boost/libs/tti/test/test_has_template_cp_compile.cpp new file mode 100644 index 00000000..0eaa9e0f --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp_compile.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template_cp.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist) aVar1; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP))); + + BOOST_MPL_ASSERT((HaveCL)); + BOOST_MPL_ASSERT((HaveAnotherMT)); + BOOST_MPL_ASSERT((ATemplateWithParms)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_cp_fail.cpp b/src/boost/libs/tti/test/test_has_template_cp_fail.cpp new file mode 100644 index 00000000..92428080 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template_cp.hpp" +#include + +int main() + { + + // TemplateNotExist does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_cp_fail2.cpp b/src/boost/libs/tti/test/test_has_template_cp_fail2.cpp new file mode 100644 index 00000000..a8be1129 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template_cp.hpp" +#include + +int main() + { + + // Wrong enclosing type + + BOOST_MPL_ASSERT((HaveCL)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_cp_fail3.cpp b/src/boost/libs/tti/test/test_has_template_cp_fail3.cpp new file mode 100644 index 00000000..f9e4a4bc --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template_cp.hpp" +#include + +int main() + { + + // Wrong template parameters + + BOOST_MPL_ASSERT((WrongParametersForMP)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_cp_fail4.cpp b/src/boost/libs/tti/test/test_has_template_cp_fail4.cpp new file mode 100644 index 00000000..72582f8b --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_cp_fail4.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template_cp.hpp" +#include + +int main() + { + + // Wrong template parameters + + BOOST_MPL_ASSERT((WrongParameters2ForMP)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_fail.cpp b/src/boost/libs/tti/test/test_has_template_fail.cpp new file mode 100644 index 00000000..0a694b4b --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template.hpp" +#include + +int main() + { + + // TemplateNotExist does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_fail2.cpp b/src/boost/libs/tti/test/test_has_template_fail2.cpp new file mode 100644 index 00000000..76f705ff --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template.hpp" +#include + +int main() + { + + // Wrong enclosing type + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_fail3.cpp b/src/boost/libs/tti/test/test_has_template_fail3.cpp new file mode 100644 index 00000000..173acce2 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_fail3.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template.hpp" +#include + +int main() + { + + // Too many 'typename' parameters + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_template_fail4.cpp b/src/boost/libs/tti/test/test_has_template_fail4.cpp new file mode 100644 index 00000000..5499ce9c --- /dev/null +++ b/src/boost/libs/tti/test/test_has_template_fail4.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_template.hpp" +#include + +int main() + { + + // Not all 'typename' parameters + + BOOST_MPL_ASSERT((HaveAnotherMT)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type.cpp b/src/boost/libs/tti/test/test_has_type.cpp new file mode 100644 index 00000000..c09b122d --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include + +int main() + { + + BOOST_TEST(BOOST_TTI_HAS_TYPE_GEN(AnIntType)::value); + BOOST_TEST(BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)::value); + BOOST_TEST(NameStruct::value); + BOOST_TEST(BOOST_TTI_HAS_TYPE_GEN(BType)::value); + BOOST_TEST(TheInteger::value); + BOOST_TEST(BOOST_TTI_HAS_TYPE_GEN(CType)::value); + BOOST_TEST(BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)::value); + BOOST_TEST(SomethingElse::value); + BOOST_TEST(!BOOST_TTI_HAS_TYPE_GEN(NoOtherType)::value); + + // Passing non-class enclosing type will return false + + BOOST_TEST(!BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)::value); + BOOST_TEST(!NameStruct::value); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_type.hpp b/src/boost/libs/tti/test/test_has_type.hpp new file mode 100644 index 00000000..e17b5c99 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type.hpp @@ -0,0 +1,23 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_HAS_TYPE_HPP) +#define TEST_HAS_TYPE_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_TYPE(AnIntType) +BOOST_TTI_TRAIT_HAS_TYPE(NameStruct,AStructType) +BOOST_TTI_HAS_TYPE(AnIntTypeReference) +BOOST_TTI_HAS_TYPE(BType) +BOOST_TTI_TRAIT_HAS_TYPE(TheInteger,AnIntegerType) +BOOST_TTI_HAS_TYPE(CType) +BOOST_TTI_HAS_TYPE(AnotherIntegerType) +BOOST_TTI_TRAIT_HAS_TYPE(SomethingElse,someOtherType) +BOOST_TTI_HAS_TYPE(NoOtherType) + +#endif // TEST_HAS_TYPE_HPP diff --git a/src/boost/libs/tti/test/test_has_type_compile.cpp b/src/boost/libs/tti/test/test_has_type_compile.cpp new file mode 100644 index 00000000..bf6047c0 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_compile.cpp @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include + +int main() + { + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_TYPE_GEN(AnIntType) aVar1; + BOOST_TTI_HAS_TYPE_GEN(NoOtherType) aVar2; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntType))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference))); + BOOST_MPL_ASSERT((NameStruct)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType))); + BOOST_MPL_ASSERT((TheInteger)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(CType))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType))); + BOOST_MPL_ASSERT((SomethingElse)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct.cpp b/src/boost/libs/tti/test/test_has_type_ct.cpp new file mode 100644 index 00000000..d724262c --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct.cpp @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnIntType) >::value)); + BOOST_TEST((NameStruct >::value)); + BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference) >::value)); + BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(BType) >::value)); + BOOST_TEST((TheInteger >::value)); + BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(CType) >::value)); + BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType) >::value)); + BOOST_TEST((SomethingElse >::value)); + BOOST_TEST((!BOOST_TTI_HAS_TYPE_GEN(NoOtherType) >::value)); + + // Passing non-class enclosing type will return false + + BOOST_TEST((!BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference) >::value)); + BOOST_TEST((!SomethingElse >::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct_compile.cpp b/src/boost/libs/tti/test/test_has_type_ct_compile.cpp new file mode 100644 index 00000000..f82428fe --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct_compile.cpp @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + // You can always instantiate without compiler errors + + TheInteger > aVar; + BOOST_TTI_HAS_TYPE_GEN(NoOtherType) > aVar2; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntType) >)); + BOOST_MPL_ASSERT((NameStruct >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference) >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType) >)); + BOOST_MPL_ASSERT((TheInteger >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(CType) >)); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType) >)); + BOOST_MPL_ASSERT((SomethingElse >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct_fail.cpp b/src/boost/libs/tti/test/test_has_type_ct_fail.cpp new file mode 100644 index 00000000..a71301d1 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct_fail.cpp @@ -0,0 +1,22 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + // NoOtherType does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(NoOtherType) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct_fail2.cpp b/src/boost/libs/tti/test/test_has_type_ct_fail2.cpp new file mode 100644 index 00000000..a2135c4b --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct_fail2.cpp @@ -0,0 +1,22 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + // Wrong enclosing type + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct_fail3.cpp b/src/boost/libs/tti/test/test_has_type_ct_fail3.cpp new file mode 100644 index 00000000..e50e898a --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct_fail3.cpp @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + // Enclosing type does not exist + + TheInteger > aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct_fail4.cpp b/src/boost/libs/tti/test/test_has_type_ct_fail4.cpp new file mode 100644 index 00000000..21328ac2 --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct_fail4.cpp @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + // Typedef type does not exist ( BType is a nested type ) + + BOOST_TTI_HAS_TYPE_GEN(BType) > aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_ct_fail5.cpp b/src/boost/libs/tti/test/test_has_type_ct_fail5.cpp new file mode 100644 index 00000000..1e4e8e0e --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_ct_fail5.cpp @@ -0,0 +1,22 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include +#include +#include +using namespace boost::mpl::placeholders; + +int main() + { + + // Wrong typedef type + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType) >)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_fail.cpp b/src/boost/libs/tti/test/test_has_type_fail.cpp new file mode 100644 index 00000000..152005cf --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include + +int main() + { + + // NoOtherType does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(NoOtherType))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_fail2.cpp b/src/boost/libs/tti/test/test_has_type_fail2.cpp new file mode 100644 index 00000000..8fd9f9fe --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_fail2.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" +#include + +int main() + { + + // Wrong enclosing type + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType))); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_has_type_fail3.cpp b/src/boost/libs/tti/test/test_has_type_fail3.cpp new file mode 100644 index 00000000..cb2ef9df --- /dev/null +++ b/src/boost/libs/tti/test/test_has_type_fail3.cpp @@ -0,0 +1,18 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_has_type.hpp" + +int main() + { + + // Enclosing type does not exist + + TheInteger aVar; + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_mem_type.cpp b/src/boost/libs/tti/test/test_mem_type.cpp new file mode 100644 index 00000000..72f1dfc4 --- /dev/null +++ b/src/boost/libs/tti/test/test_mem_type.cpp @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_mem_type.hpp" +#include + +int main() + { + + BOOST_TEST((boost::tti::valid_member_type::type>::value)); + BOOST_TEST((boost::tti::valid_member_type::type>::value)); + BOOST_TEST((boost::tti::valid_member_type::type>::value)); + BOOST_TEST((boost::tti::valid_member_type::type>::value)); + BOOST_TEST((boost::tti::valid_member_type::type>::value)); + BOOST_TEST((boost::tti::valid_member_type::type>::value)); + + BOOST_TEST((boost::tti::valid_member_type::type,NameStruct::boost_tti_marker_type>::value)); + BOOST_TEST((boost::tti::valid_member_type::type,BOOST_TTI_MEMBER_TYPE_GEN(CType)::boost_tti_marker_type>::value)); + + BOOST_TEST((!boost::tti::valid_member_type::type>::value)); + BOOST_TEST((!boost::tti::valid_member_type::type,BOOST_TTI_MEMBER_TYPE_GEN(NoExistType)::boost_tti_marker_type>::value)); + + // Passing non-class enclosing type will always use the marker type + + BOOST_TEST((!boost::tti::valid_member_type::type>::value)); + BOOST_TEST((!boost::tti::valid_member_type::type>::value)); + BOOST_TEST((!boost::tti::valid_member_type::type,MarkerType>::value)); + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_mem_type.hpp b/src/boost/libs/tti/test/test_mem_type.hpp new file mode 100644 index 00000000..a1bd6d29 --- /dev/null +++ b/src/boost/libs/tti/test/test_mem_type.hpp @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_MEMBER_TYPE_HPP) +#define TEST_MEMBER_TYPE_HPP + +#include "test_structs.hpp" +#include + +BOOST_TTI_MEMBER_TYPE(AnIntType) +BOOST_TTI_TRAIT_MEMBER_TYPE(NameStruct,AStructType) +BOOST_TTI_MEMBER_TYPE(AnIntTypeReference) +BOOST_TTI_MEMBER_TYPE(BType) +BOOST_TTI_TRAIT_MEMBER_TYPE(TheInteger,AnIntegerType) +BOOST_TTI_MEMBER_TYPE(CType) +BOOST_TTI_MEMBER_TYPE(AnotherIntegerType) +BOOST_TTI_TRAIT_MEMBER_TYPE(SomethingElse,someOtherType) + +BOOST_TTI_MEMBER_TYPE(NoExistType) + +#endif // TEST_MEMBER_TYPE_HPP diff --git a/src/boost/libs/tti/test/test_mem_type_compile.cpp b/src/boost/libs/tti/test/test_mem_type_compile.cpp new file mode 100644 index 00000000..ff59bbf1 --- /dev/null +++ b/src/boost/libs/tti/test/test_mem_type_compile.cpp @@ -0,0 +1,28 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_mem_type.hpp" +#include + +int main() + { + + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type>)); + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type>)); + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type>)); + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type>)); + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type>)); + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type>)); + + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type,NameStruct::boost_tti_marker_type>)); + BOOST_MPL_ASSERT((boost::tti::valid_member_type::type,BOOST_TTI_MEMBER_TYPE_GEN(CType)::boost_tti_marker_type>)); + + BOOST_MPL_ASSERT_NOT((boost::tti::valid_member_type::type>)); + BOOST_MPL_ASSERT_NOT((boost::tti::valid_member_type::type,BOOST_TTI_MEMBER_TYPE_GEN(NoExistType)::boost_tti_marker_type>)); + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_structs.hpp b/src/boost/libs/tti/test/test_structs.hpp new file mode 100644 index 00000000..e3d9ac2e --- /dev/null +++ b/src/boost/libs/tti/test/test_structs.hpp @@ -0,0 +1,156 @@ + +// (C) Copyright Edward Diener 2011,2012 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_STRUCTS_HPP) +#define TEST_STRUCTS_HPP + +struct AType + { + + // Type + + typedef int AnIntType; + struct AStructType + { + template struct MStrMemberTemplate { }; + template static int StatFuncTemplate(X *,Y) { int ret(AA); return ret; } + }; + typedef int & AnIntTypeReference; + struct BType + { + typedef int AnIntegerType; + struct CType + { + typedef int AnotherIntegerType; + template class,class> struct CTManyParameters { }; + template double SomeFuncTemplate(X,Y *,Z &) { double ret(AA); return ret; } + }; + }; + + // Template + + template struct ATPMemberTemplate { }; + template struct AMemberTemplate { }; + template struct AnotherMemberTemplate { }; + template struct CLMemberTemplate { }; + + // Data + + int AnInt; + BType IntBT; + BType::CType NestedCT; + + // Function + + void VoidFunction() { } + int IntFunction() { return 0; } + + // Const function + + double AConstFunction(long, char) const { return 2.57; } + void WFunction(float, double = 4.3) const { } + + // Volatile function + + double AVolatileFunction(long, char = 'c') volatile { return 2.58; } + void VolFunction(float, double) volatile { } + + // Const Volatile function + + double ACVFunction(long, char) const volatile { return 2.59; } + void ConstVolFunction(float, double) const volatile { } + + // Function Templates + + template int AFuncTemplate(const X &) { return Y; } + template void AFuncTemplate(X *,Y,Z &) { } + + // Static Data + + static short DSMember; + + // Static Function + + static int SIntFunction(long,double) { return 2; } + + // Static Function Template + + template static void AnotherFuncTemplate(X,Y &,const Z &) { } + + }; + +struct AnotherType + { + + // Type + + typedef AType::AnIntType someOtherType; + + // Template + + template struct SomeMemberTemplate { }; + template class,class,long> struct ManyParameters { }; + template struct SimpleTMP { }; + + // Data + + bool aMember; + bool cMem; + long AnInt; + AType OtherAT; + AType::AStructType ONestStr; + + // Function + + AType aFunction(int = 7) { return AType(); } + int anotherFunction(AType) { return 0; } + AType::AnIntType sFunction(int,long = 88,double = 1.0) { return 0; } + double IntFunction(int = 9922) { return 0; } + + // Const function + + int AnotherConstFunction(AType *, short) const { return 0; } + AType StillSame(int) const { return OtherAT; } + + // Volatile function + + int AnotherVolatileFunction(AType *, short) volatile { return 0; } + bool StillVolatile(int) volatile { return false; } + + // Const Volatile function + + int AnotherConstVolatileFunction(AType *, short) const volatile { return 0; } + short StillCV(int = 3) const volatile { return 32; } + + // Function Templates + + template long MyFuncTemplate(X &) { return 0; } + + // Static Function + + static AType TIntFunction(long,double = 3.0) { return AType(); } + static AType::AStructType TSFunction(AType::AnIntType,double) { return AType::AStructType(); } + + // Static Data + + static AType::AStructType AnStat; + + // Static Function Template + + template static void YetAnotherFuncTemplate(const X &,Y &) { } + + static const int CIntValue = 10; + + }; + +struct MarkerType + { + }; + +short AType::DSMember(5622); +AType::AStructType AnotherType::AnStat; + +#endif // TEST_STRUCTS_HPP diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp.cpp b/src/boost/libs/tti/test/test_vm_has_template_cp.cpp new file mode 100644 index 00000000..ccd4f583 --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp.cpp @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_vm_has_template_cp.hpp" +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate)::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate)::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate)::value); + BOOST_TEST(BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP)::value); + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist)::value); + + BOOST_TEST(HaveCL::value); + BOOST_TEST(HaveAnotherMT::value); + BOOST_TEST(ATemplateWithParms::value); + + // Passing non-class enclosing type will return false + + BOOST_TEST(!BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate)::value); + BOOST_TEST(!ATemplateWithParms::value); + +#endif // BOOST_PP_VARIADICS + + return boost::report_errors(); + + } diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp.hpp b/src/boost/libs/tti/test/test_vm_has_template_cp.hpp new file mode 100644 index 00000000..b9ae3c1d --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp.hpp @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#if !defined(TEST_VM_HAS_TEMPLATE_CHECK_PARAMS_HPP) +#define TEST_VM_HAS_TEMPLATE_CHECK_PARAMS_HPP + +#include + +#if BOOST_PP_VARIADICS + +#include "test_structs.hpp" +#include + +BOOST_TTI_HAS_TEMPLATE(ATPMemberTemplate,class) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveCL,CLMemberTemplate,class,class) +BOOST_TTI_HAS_TEMPLATE(AMemberTemplate,int) +BOOST_TTI_TRAIT_HAS_TEMPLATE(HaveAnotherMT,AnotherMemberTemplate,int,int) +BOOST_TTI_HAS_TEMPLATE(SomeMemberTemplate,class,class,class,class,class,class) +BOOST_TTI_TRAIT_HAS_TEMPLATE(ATemplateWithParms,ManyParameters,class,class,int,class,template class,class,long) +BOOST_TTI_HAS_TEMPLATE(SimpleTMP,class,class,class,class) +BOOST_TTI_HAS_TEMPLATE(TemplateNotExist,int,class,template class ATemplate) +BOOST_TTI_TRAIT_HAS_TEMPLATE(WrongParametersForMP,ManyParameters,class,class,int,class,template class,class,long) +BOOST_TTI_TRAIT_HAS_TEMPLATE(WrongParameters2ForMP,ManyParameters,class,long,int,class,template class,class,long) + +#endif // BOOST_PP_VARIADICS + +#endif // TEST_VM_HAS_TEMPLATE_CHECK_PARAMS_HPP diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp_compile.cpp b/src/boost/libs/tti/test/test_vm_has_template_cp_compile.cpp new file mode 100644 index 00000000..4d1059a0 --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp_compile.cpp @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_vm_has_template_cp.hpp" +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + // You can always instantiate without compiler errors + + BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist) aVar1; + + // Compile time asserts + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate))); + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP))); + + BOOST_MPL_ASSERT((HaveCL)); + BOOST_MPL_ASSERT((HaveAnotherMT)); + BOOST_MPL_ASSERT((ATemplateWithParms)); + +#endif // BOOST_PP_VARIADICS + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp_fail.cpp b/src/boost/libs/tti/test/test_vm_has_template_cp_fail.cpp new file mode 100644 index 00000000..4a6caf6a --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp_fail.cpp @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_vm_has_template_cp.hpp" +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + // TemplateNotExist does not exist at all + + BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist))); + +#else + + BOOST_MPL_ASSERT((boost::mpl::false_)); + +#endif // BOOST_PP_VARIADICS + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp_fail2.cpp b/src/boost/libs/tti/test/test_vm_has_template_cp_fail2.cpp new file mode 100644 index 00000000..6d4da5a1 --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp_fail2.cpp @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_vm_has_template_cp.hpp" +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + // Wrong enclosing type + + BOOST_MPL_ASSERT((HaveCL)); + +#else + + BOOST_MPL_ASSERT((boost::mpl::false_)); + +#endif // BOOST_PP_VARIADICS + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp_fail3.cpp b/src/boost/libs/tti/test/test_vm_has_template_cp_fail3.cpp new file mode 100644 index 00000000..4bcba594 --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp_fail3.cpp @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_vm_has_template_cp.hpp" +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + // Wrong template parameters + + BOOST_MPL_ASSERT((WrongParametersForMP)); + +#else + + BOOST_MPL_ASSERT((boost::mpl::false_)); + +#endif // BOOST_PP_VARIADICS + + return 0; + + } diff --git a/src/boost/libs/tti/test/test_vm_has_template_cp_fail4.cpp b/src/boost/libs/tti/test/test_vm_has_template_cp_fail4.cpp new file mode 100644 index 00000000..46e3997c --- /dev/null +++ b/src/boost/libs/tti/test/test_vm_has_template_cp_fail4.cpp @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011 +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). + +#include "test_vm_has_template_cp.hpp" +#include + +int main() + { + +#if BOOST_PP_VARIADICS + + // Wrong template parameters + + BOOST_MPL_ASSERT((WrongParameters2ForMP)); + +#else + + BOOST_MPL_ASSERT((boost::mpl::false_)); + +#endif // BOOST_PP_VARIADICS + + return 0; + + } -- cgit v1.2.3