diff options
Diffstat (limited to 'src/boost/libs/vmd/test')
334 files changed, 9300 insertions, 0 deletions
diff --git a/src/boost/libs/vmd/test/Jamfile.v2 b/src/boost/libs/vmd/test/Jamfile.v2 new file mode 100644 index 000000000..c0ad46c6a --- /dev/null +++ b/src/boost/libs/vmd/test/Jamfile.v2 @@ -0,0 +1,224 @@ +# (C) Copyright Edward Diener 2010-2015 +# 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). +# +# VariadicMacroData testing Jamfile +# + +import testing ; +import ../../predef/check/predef + : check require + : predef-check predef-require ; + +project variadic_macro_data_tests : requirements <warnings>on + <test-info>always_show_run_output + <toolset>msvc:<warnings>all + <toolset>msvc:<cxxflags>-wd4003 + <toolset>clang:<cxxflags>-pedantic-errors + <toolset>gcc:<warnings>all + <toolset>gcc:<cxxflags>-pedantic-errors + [ predef-check "BOOST_COMP_GNUC >= 4.7.4" : : <cxxflags>-ftrack-macro-expansion=0 ] + [ predef-check "BOOST_COMP_GNUC >= 4.3.0" : : <cxxflags>-Wno-variadic-macros ] + <toolset>gcc-4.3.0:<cxxflags>-U__STRICT_ANSI__ + <toolset>gcc-4.4.0:<cxxflags>-U__STRICT_ANSI__ + <toolset>gcc-4.5.0:<linkflags>"-Wl,--enable-auto-import" + ; + +alias variadic_macro_data + : + [ run test_after_array_elem.cpp ] + [ run test_after_identifier_elem.cpp ] + [ run test_after_list_elem.cpp ] + [ run test_after_number_elem.cpp ] + [ run test_after_seq_elem.cpp ] + [ run test_after_tuple_elem.cpp ] + [ run test_after_type_elem.cpp ] + [ run test_array_elem.cpp ] + [ run test_array_empty.cpp ] + [ run test_array_equal.cpp ] + [ run test_array_to_seq.cpp ] + [ run test_array_to_tuple.cpp ] + [ run test_ary.cpp ] + [ compile test_assert.cpp ] + [ compile-fail test_assert_fail.cpp ] + [ compile-fail test_assert_fail_array.cpp ] + [ compile-fail test_assert_fail_identifier.cpp ] + [ compile-fail test_assert_fail_is_empty.cpp ] + [ compile-fail test_assert_fail_is_identifier.cpp ] + [ compile-fail test_assert_fail_is_number.cpp ] + [ compile-fail test_assert_fail_list.cpp ] + [ compile-fail test_assert_fail_number.cpp ] + [ compile-fail test_assert_fail_seq.cpp ] + [ compile-fail test_assert_fail_tuple.cpp ] + [ compile-fail test_assert_fail_vcstring.cpp ] + [ compile test_assert_is_array.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_array_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_array_fail2.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_array_fail3.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_array_fail4.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_empty.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_empty_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_empty_fail2.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_empty_fail3.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_identifier.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_identifier_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_list.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_list_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_list_fail2.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_list_fail3.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_list_fail4.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_number.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_number_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_seq.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_seq_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_seq_fail2.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_seq_fail3.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_seq_fail4.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_tuple.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_tuple_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_tuple_fail2.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_tuple_fail3.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_tuple_fail4.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_assert_is_type.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_assert_is_type_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile test_doc_assert.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ compile-fail test_doc_assert_fail.cpp : + <define>BOOST_VMD_ASSERT_DATA=1 ] + [ run test_doc_empty.cpp ] + [ compile-fail test_doc_empty_fail.cpp ] +# [ compile-fail test_doc_empty_fail2.cpp ] + [ compile-fail test_doc_empty_fail3.cpp ] + [ compile-fail test_doc_empty_fail4.cpp ] + [ compile-fail test_doc_empty_fail6.cpp ] + [ compile-fail test_doc_empty_fail7.cpp ] + [ compile-fail test_doc_empty_fail8.cpp ] + [ run test_doc_equality.cpp ] + [ run test_doc_example_switch.cpp ] + [ run test_doc_get_type.cpp ] + [ run test_doc_identifier.cpp ] + [ run test_doc_identifier_subtyping.cpp ] + [ run test_doc_modifiers_filter.cpp ] + [ run test_doc_modifiers_identifier.cpp ] + [ run test_doc_modifiers_index.cpp ] + [ run test_doc_modifiers_return_type.cpp : : : [ predef-require "BOOST_COMP_CLANG == 0" or "BOOST_COMP_CLANG >= 10" ] ] + [ run test_doc_modifiers_splitting.cpp ] + [ run test_doc_number.cpp ] + [ run test_doc_type.cpp ] + [ run test_doc_pp_data_types.cpp ] + [ run test_doc_sequence.cpp ] + [ run test_doc_sequence_access.cpp ] + [ run test_doc_sequence_convert.cpp ] + [ run test_doc_whyhow.cpp ] + [ run test_equal.cpp ] + [ run test_equal_array.cpp ] + [ run test_equal_identifier.cpp ] + [ run test_equal_list.cpp ] + [ run test_equal_multi.cpp ] + [ run test_equal_number.cpp ] + [ run test_equal_seq.cpp ] + [ run test_equal_tuple.cpp ] + [ run test_equal_type.cpp ] + [ run test_identifier_elem.cpp ] + [ run test_identifier_equal.cpp ] + [ run test_is_array.cpp ] + [ run-fail test_is_array_fail.cpp ] + [ run-fail test_is_array_fail2.cpp ] + [ run-fail test_is_array_fail3.cpp ] + [ run-fail test_is_array_fail4.cpp ] + [ run test_is_empty.cpp ] + [ compile-fail test_is_empty_fail.cpp ] + [ run test_is_identifier.cpp ] + [ run test_is_list.cpp ] + [ run-fail test_is_list_fail.cpp ] + [ run-fail test_is_list_fail2.cpp ] + [ run-fail test_is_list_fail3.cpp ] + [ run-fail test_is_list_fail4.cpp ] + [ run test_is_number.cpp ] + [ run test_is_parens_empty.cpp ] + [ run test_is_seq.cpp ] + [ run-fail test_is_seq_fail.cpp ] + [ run-fail test_is_seq_fail2.cpp ] + [ run-fail test_is_seq_fail3.cpp ] + [ run-fail test_is_seq_fail4.cpp ] + [ run test_is_tuple.cpp ] + [ run-fail test_is_tuple_fail.cpp ] + [ run-fail test_is_tuple_fail2.cpp ] + [ run-fail test_is_tuple_fail3.cpp ] + [ run-fail test_is_tuple_fail4.cpp ] + [ run test_is_type.cpp ] + [ run test_is_vmd_seq.cpp ] + [ run test_is_vmd_tuple.cpp ] + [ run test_list_elem.cpp ] + [ run test_list_empty.cpp ] + [ run test_list_equal.cpp ] + [ run test_list_to_seq.cpp ] + [ run test_list_to_tuple.cpp ] + [ run test_number_elem.cpp ] + [ run test_number_equal.cpp ] + [ run test_seq_elem.cpp ] + [ run test_seq_equal.cpp ] + [ run test_seq_pop_back.cpp ] + [ run test_seq_pop_front.cpp ] + [ run test_seq_push_back.cpp ] + [ run test_seq_push_front.cpp ] + [ run test_seq_remove.cpp ] + [ run test_seq_size.cpp ] + [ run test_seq_to_array.cpp ] + [ run test_seq_to_list.cpp ] + [ run test_seq_to_tuple.cpp ] + [ run test_sequence_after_elem.cpp ] + [ run test_sequence_elem.cpp ] + [ run test_sequence_enum.cpp ] + [ run test_sequence_size.cpp ] + [ run test_sequence_to_array.cpp ] + [ run test_sequence_to_list.cpp ] + [ run test_sequence_to_seq.cpp ] + [ run test_sequence_to_tuple.cpp ] + [ run test_tuple_elem.cpp ] + [ run test_tuple_equal.cpp ] + [ run test_tuple_pop_back.cpp ] + [ run test_tuple_pop_front.cpp ] + [ run test_tuple_push_back.cpp ] + [ run test_tuple_push_front.cpp ] + [ run test_tuple_remove.cpp ] + [ run test_tuple_size.cpp ] + [ run test_tuple_to_array.cpp ] + [ run test_tuple_to_list.cpp ] + [ run test_tuple_to_seq.cpp ] + [ run test_type.cpp ] + [ run test_type_elem.cpp ] + [ run test_type_equal.cpp ] + [ run test_variadic_macro.cpp ] + ; diff --git a/src/boost/libs/vmd/test/test_after_array_elem.cpp b/src/boost/libs/vmd/test/test_after_array_elem.cpp new file mode 100644 index 000000000..f1beb56b3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_array_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_array_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_array_elem.cxx b/src/boost/libs/vmd/test/test_after_array_elem.cxx new file mode 100644 index 000000000..1b9d86152 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_array_elem.cxx @@ -0,0 +1,73 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 456 + #define PLUS_ANARRAY yyt (2,(j,ii%)) + #define JDATA ggh + #define KDATA (2,(a,b)) name + #define A_SEQ ((1,(25)) 7)((1,(26)) 8)((1,(27)) 9) + +#if !BOOST_VMD_MSVC_V8 + #define ANARRAY_EMPTY (0,()) + #define AN_EMPTY_ARRAY_PLUS (0,()) 46 + #define ASEQUENCE5 ASEQ ANUMBER ANARRAY_EMPTY ATUPLE +#endif + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY)),25); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,AN_ARRAY_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ANARRAY,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(1,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY),8); + +#if !BOOST_VMD_MSVC_V8 + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY)),1); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,AN_EMPTY_ARRAY_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_ARRAY),46); +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_after_identifier_elem.cpp b/src/boost/libs/vmd/test/test_after_identifier_elem.cpp new file mode 100644 index 000000000..8007633b0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_identifier_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_identifier_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_identifier_elem.cxx b/src/boost/libs/vmd/test/test_after_identifier_elem.cxx new file mode 100644 index 000000000..d8ac26ebb --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_identifier_elem.cxx @@ -0,0 +1,135 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_aname (aname) + + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_aname_aname + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + #define BOOST_VMD_REGISTER_num (num) + #define BOOST_VMD_DETECT_num_num + #define BOOST_VMD_REGISTER_eeb (eeb) + #define BOOST_VMD_DETECT_eeb_eeb + #define BOOST_VMD_REGISTER_grist (grist) + #define BOOST_VMD_DETECT_grist_grist + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANIDENTIFIER3 ccc + #define ANIDENTIFIER5 aname + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ANIDENTIFIER3 ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ANUMBER ATUPLE ANIDENTIFIER5 + + #define A_TUPLE (*,#,zzz ()) + #define JDATA somevalue + #define A_SEQ (num (split) clear)(%)(#) + #define A_LIST (eeb (5),(grist,(&,BOOST_PP_NIL))) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ATUPLE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,dvd,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER)),1); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST + ( + BOOST_PP_IS_BEGIN_PARENS + ( + BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),zzz,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,JDATA,somevalue,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_PP_IS_BEGIN_PARENS + ( + BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST_EQ + ( + BOOST_PP_TUPLE_ELEM + ( + 0, + BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,0),(eeb),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ), + 5 + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),grist,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,JDATA,babble,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_EMPTY + ( + BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),eeb,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_IDENTIFIER) + ) + ); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_after_list_elem.cpp b/src/boost/libs/vmd/test/test_after_list_elem.cpp new file mode 100644 index 000000000..09d498cc7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_list_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_list_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_list_elem.cxx b/src/boost/libs/vmd/test/test_after_list_elem.cxx new file mode 100644 index 000000000..7df3f1945 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_list_elem.cxx @@ -0,0 +1,64 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST2 (10,(11,(12,(13,BOOST_PP_NIL)))) + #define ALIST3 (100,(101,(102,(103,BOOST_PP_NIL)))) + #define ALIST5 (200,(201,(202,(203,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST2 ATUPLE + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATUPLE ALIST3 + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST5 ASEQ ATUPLE ANIDENTIFIER + + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 456 + #define PLUS_ALIST yyt (j,(ii%,BOOST_PP_NIL)) + #define JDATA ggh + #define KDATA (a,(b,BOOST_PP_NIL)) name + #define ELISTP BOOST_PP_NIL 231 + #define A_SEQ ((25,BOOST_PP_NIL) 3)((26,BOOST_PP_NIL) 4)((27,BOOST_PP_NIL) 5) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_LIST_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ALIST,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ELISTP,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_LIST),3); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_after_number_elem.cpp b/src/boost/libs/vmd/test/test_after_number_elem.cpp new file mode 100644 index 000000000..8f552416f --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_number_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_number_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_number_elem.cxx b/src/boost/libs/vmd/test/test_after_number_elem.cxx new file mode 100644 index 000000000..ddf282c11 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_number_elem.cxx @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ANUMBER2 25 + #define ANUMBER3 158 + #define ANUMBER5 73 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST ANUMBER2 ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER3 ANIDENTIFIER ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ANUMBER5 ATUPLE ANIDENTIFIER + + #define A_TUPLE (27,251,145 ()) + #define JDATA 43 + #define A_SEQ (73 (split) clear)(red)(green 44) + #define A_LIST (17 (5),(grist,(yellow,BOOST_PP_NIL))) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,0),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER)),5); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(2,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,253 num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,17 181 201 somevalue num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_NUMBER))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_after_seq_elem.cpp b/src/boost/libs/vmd/test/test_after_seq_elem.cpp new file mode 100644 index 000000000..505cd488d --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_seq_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_seq_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_seq_elem.cxx b/src/boost/libs/vmd/test/test_after_seq_elem.cxx new file mode 100644 index 000000000..4ccfc6437 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_seq_elem.cxx @@ -0,0 +1,64 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ASEQ2 (75)(76)(77) + #define ASEQ3 (147)(148)(149) + #define ASEQ5 (221)(222)(223) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ2 ATUPLE + #define ASEQUENCE3 ASEQ3 ANIDENTIFIER ATUPLE ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ5 ATUPLE ANIDENTIFIER + + #define A_SEQ_PLUS (mmf)(34)(^^)(!) 456 + #define PLUS_ASEQ yyt (j)(ii%) + #define JDATA ggh + #define KDATA (a)(b) name + #define A_SEQ (25)(26)(27) 33 + #define ATUPLE2 (0,1,2,3,((VMD_TEST_88_,VMD_TEST_1_))((VMD_TEST_99_,VMD_TEST_3_))((VMD_TEST_2_))((VMD_TEST_99_,VMD_TEST_100_,VMD_TEST_101_)) gene) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(5,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_SEQ_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ASEQ,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_SEQ,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ),33); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(4,ATUPLE2),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_after_tuple_elem.cpp b/src/boost/libs/vmd/test/test_after_tuple_elem.cpp new file mode 100644 index 000000000..e67decc5d --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_tuple_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_tuple_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_tuple_elem.cxx b/src/boost/libs/vmd/test/test_after_tuple_elem.cxx new file mode 100644 index 000000000..c2b02202d --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_tuple_elem.cxx @@ -0,0 +1,76 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ATUPLE2 (10,11,12,13) + #define ATUPLE3 (100,101,102,103) + #define ATUPLE5 (200,201,202,203) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ ATUPLE2 + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATUPLE3 ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ ATUPLE5 ANIDENTIFIER + + #define A_TUPLE_PLUS (mmf,34,^^,!) 456 + #define PLUS_ATUPLE yyt (j,ii%) + #define JDATA ggh + #define KDATA (a,b) name + #define A_SEQ (25)(26)(27) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_TUPLE_PLUS () 83 + +#endif + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE),3),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,anything,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,A_TUPLE_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE),456); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,PLUS_ATUPLE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,A_SEQ,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE))); + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,AN_EMPTY_TUPLE_PLUS,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TUPLE),83); + +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_after_type_elem.cpp b/src/boost/libs/vmd/test/test_after_type_elem.cpp new file mode 100644 index 000000000..4c8eafa0a --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_type_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_after_type_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_after_type_elem.cxx b/src/boost/libs/vmd/test/test_after_type_elem.cxx new file mode 100644 index 000000000..2b2ca2c28 --- /dev/null +++ b/src/boost/libs/vmd/test/test_after_type_elem.cxx @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/punctuation/is_begin_parens.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ATYPE BOOST_VMD_TYPE_UNKNOWN + #define ATYPE2 BOOST_VMD_TYPE_SEQUENCE + #define ATYPE3 BOOST_VMD_TYPE_SEQ + #define ATYPE5 BOOST_VMD_TYPE_NUMBER + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ATYPE ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST ATYPE2 ATUPLE + #define ASEQUENCE3 ASEQ ATYPE3 ANIDENTIFIER ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ATYPE5 ATUPLE ANIDENTIFIER + + #define A_TUPLE (27,251,BOOST_VMD_TYPE_TUPLE ()) + #define JDATA BOOST_VMD_TYPE_EMPTY + #define A_SEQ (BOOST_VMD_TYPE_LIST (split) clear)(red)(green 44) + #define A_LIST (BOOST_VMD_TYPE_ARRAY (5),(grist,(yellow,BOOST_PP_NIL))) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,JDATA,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_PP_IS_BEGIN_PARENS(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,0),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE)),5); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_LIST_AT(A_LIST,1),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(2,A_SEQ),BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_VMD_TYPE_TYPE num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,BOOST_VMD_TYPE_TUPLE 181 201 somevalue num,BOOST_VMD_RETURN_ONLY_AFTER,BOOST_VMD_TYPE_TYPE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_android.cpp b/src/boost/libs/vmd/test/test_android.cpp new file mode 100644 index 000000000..eaf61a04d --- /dev/null +++ b/src/boost/libs/vmd/test/test_android.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_android.cxx> diff --git a/src/boost/libs/vmd/test/test_android.cxx b/src/boost/libs/vmd/test/test_android.cxx new file mode 100644 index 000000000..d8c8dc503 --- /dev/null +++ b/src/boost/libs/vmd/test/test_android.cxx @@ -0,0 +1,56 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/detail/setup.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if !BOOST_PP_VARIADICS + +# if defined __GCCXML__ +BOOST_ERROR("No variadic macro support: __GCCXML__ defined."); +# elif defined __CUDACC__ +BOOST_ERROR("No variadic macro support: __CUDACC__ defined."); +# elif defined __PATHSCALE__ +BOOST_ERROR("No variadic macro support: __PATHSCALE__ defined."); +# elif defined __DMC__ +BOOST_ERROR("No variadic macro support: __DMC__ defined."); +# elif defined __CODEGEARC__ +BOOST_ERROR("No variadic macro support: __CODEGEARC__ defined."); +# elif defined __BORLANDC__ +BOOST_ERROR("No variadic macro support: __BORLANDC__ defined."); +# elif defined __MWERKS__ +BOOST_ERROR("No variadic macro support: __MWERKS__ defined."); +# elif (defined __SUNPRO_CC && __SUNPRO_CC < 0x5130) +BOOST_ERROR("No variadic macro support: __SUNPRO_CC defined below version 12.3."); +# elif defined __HP_aCC && !defined __EDG__ +BOOST_ERROR("No variadic macro support: __HP_aCC defined and __EDG__ not defined."); +# elif defined __MRC__ +BOOST_ERROR("No variadic macro support: __MRC__ defined."); +# elif defined __SC__ +BOOST_ERROR("No variadic macro support: __SC__ defined."); +# elif defined __IBMCPP__ +BOOST_ERROR("No variadic macro support: __IBMCPP__ defined."); +# elif defined __PGI +BOOST_ERROR("No variadic macro support: __PGI defined."); +# /* VC++ (C/C++) */ +# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__)) && !defined __clang__ +# /* Wave (C/C++), GCC (C++) */ +# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__ +# /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */ +# elif !defined __cplusplus && __STDC_VERSION__ < 199901L +BOOST_ERROR("No variadic macro support: __STDC_VERSION__ is less than 199901L."); +# elif defined __cplusplus && __cplusplus < 201103L +BOOST_ERROR("No variadic macro support: __cplusplus is less than 201103L."); +# endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_array_elem.cpp b/src/boost/libs/vmd/test/test_array_elem.cpp new file mode 100644 index 000000000..8e9454096 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_array_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_array_elem.cxx b/src/boost/libs/vmd/test/test_array_elem.cxx new file mode 100644 index 000000000..460542756 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_elem.cxx @@ -0,0 +1,74 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/array/elem.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) +#if !BOOST_VMD_MSVC_V8 + #define ANARRAY_EMPTY (0,()) +#endif + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 +#if !BOOST_VMD_MSVC_V8 + #define ASEQUENCE5 ASEQ ANUMBER ANARRAY_EMPTY ATUPLE +#endif + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ANIDENTIFIER,BOOST_VMD_TYPE_ARRAY))); + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY))),27); + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY))),38); + BOOST_TEST_EQ(BOOST_PP_ARRAY_SIZE(BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_TYPE_ARRAY)),3); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(3,BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_TYPE_ARRAY)),22); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_TYPE_ARRAY))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_ARRAY))); + +#if !BOOST_VMD_MSVC_V8 + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY))),2); + BOOST_TEST_EQ(BOOST_PP_ARRAY_SIZE(BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_TYPE_ARRAY)),0); +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_array_empty.cpp b/src/boost/libs/vmd/test/test_array_empty.cpp new file mode 100644 index 000000000..230ce39c0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_array_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_array_empty.cxx b/src/boost/libs/vmd/test/test_array_empty.cxx new file mode 100644 index 000000000..5f1f94d64 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_empty.cxx @@ -0,0 +1,42 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_empty_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 456 + #define PLUS_ANARRAY yyt (2,(j,ii%)) + #define JDATA ggh + #define KDATA (2,(a,b)) name + #define A_SEQ ((1,(25)))((1,(26)))((1,(27))) + #define AN_EMPTY_ARRAY_PLUS (0,()) 46 + #define EMPTY_ARRAY_INVALID ("string",() xx) + #define EMPTY_ARRAY (0,()) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(anything)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(AN_ARRAY_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(PLUS_ANARRAY)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(JDATA)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(KDATA)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(A_SEQ)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(AN_EMPTY_ARRAY_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(EMPTY_ARRAY_INVALID)); + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(EMPTY_ARRAY)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_array_equal.cpp b/src/boost/libs/vmd/test/test_array_equal.cpp new file mode 100644 index 000000000..0bdf04327 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_array_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_array_equal.cxx b/src/boost/libs/vmd/test/test_array_equal.cxx new file mode 100644 index 000000000..7f0c36a1d --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_equal.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + + #define ANARRAY (3,(aaa,bbb,38)) + #define ANARRAY2 (3,(bbb,aaa,38)) + #define ANARRAY3 (3,(bbb,aaa,38)) + #define ANARRAY4 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) + #define ANARRAY5 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) + #define ANARRAY6 (4,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2),37))) + #define ATUPLE (aaa) + #define ATUPLE2 (aaa) + + BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY4,ANARRAY5,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY2,ANARRAY3,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ANARRAY2,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY5,ANARRAY6,BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE,ATUPLE2,BOOST_VMD_TYPE_ARRAY)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_array_to_seq.cpp b/src/boost/libs/vmd/test/test_array_to_seq.cpp new file mode 100644 index 000000000..4d6d3bc41 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_to_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_array_to_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_array_to_seq.cxx b/src/boost/libs/vmd/test/test_array_to_seq.cxx new file mode 100644 index 000000000..ff9cac67c --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_to_seq.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/array/to_seq.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (4,(1,2,3,4)) + #define AN_EMPTY_ARRAY (0,()) + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_VMD_ARRAY_TO_SEQ(AN_ARRAY)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ARRAY_TO_SEQ(AN_EMPTY_ARRAY))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_array_to_tuple.cpp b/src/boost/libs/vmd/test/test_array_to_tuple.cpp new file mode 100644 index 000000000..b8804e014 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_to_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_array_to_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_array_to_tuple.cxx b/src/boost/libs/vmd/test/test_array_to_tuple.cxx new file mode 100644 index 000000000..494f6df65 --- /dev/null +++ b/src/boost/libs/vmd/test/test_array_to_tuple.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/array/to_tuple.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (4,(1,2,3,4)) + #define AN_EMPTY_ARRAY (0,()) + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ARRAY_TO_TUPLE(AN_ARRAY)),2); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ARRAY_TO_TUPLE(AN_EMPTY_ARRAY))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_ary.cpp b/src/boost/libs/vmd/test/test_ary.cpp new file mode 100644 index 000000000..19f762e2a --- /dev/null +++ b/src/boost/libs/vmd/test/test_ary.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_ary.cxx> diff --git a/src/boost/libs/vmd/test/test_ary.cxx b/src/boost/libs/vmd/test/test_ary.cxx new file mode 100644 index 000000000..af9692034 --- /dev/null +++ b/src/boost/libs/vmd/test/test_ary.cxx @@ -0,0 +1,61 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_unary.hpp> +#include <boost/vmd/is_multi.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ASEQ2 (1)(2)(3) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ATYPE BOOST_VMD_TYPE_TUPLE + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ATYPE ASEQ ALIST + + BOOST_TEST(BOOST_VMD_IS_UNARY((3))); + BOOST_TEST(BOOST_VMD_IS_UNARY((3)(4))); + BOOST_TEST(BOOST_VMD_IS_UNARY((4,(a,b,c,d)))); + BOOST_TEST(BOOST_VMD_IS_UNARY((4,(5,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_IS_UNARY(ANIDENTIFIER)); + BOOST_TEST(BOOST_VMD_IS_UNARY(ANUMBER)); + BOOST_TEST(!BOOST_VMD_IS_UNARY(ASEQUENCE)); + BOOST_TEST(!BOOST_VMD_IS_UNARY(ASEQUENCE4)); + BOOST_TEST(!BOOST_VMD_IS_UNARY(ASEQUENCE5)); + + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE)); + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE2)); + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE3)); + BOOST_TEST(!BOOST_VMD_IS_MULTI(ASEQUENCE4)); + BOOST_TEST(BOOST_VMD_IS_MULTI(ASEQUENCE5)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert.cpp b/src/boost/libs/vmd/test/test_assert.cpp new file mode 100644 index 000000000..351a5c405 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert.cxx> diff --git a/src/boost/libs/vmd/test/test_assert.cxx b/src/boost/libs/vmd/test/test_assert.cxx new file mode 100644 index 000000000..baf7952e9 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert.cxx @@ -0,0 +1,89 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/assert.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_number.hpp> +#include <boost/vmd/is_type.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/arithmetic/dec.hpp> +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/logical/compl.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_PTUPLE (*,#,44) + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 156 + #define A_TUPLE (*,#,zzz ()) + #define DATA + #define JDATA somevalue + #define KDATA (a,b) name + #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 56 + #define A_SEQ (73 (split) clear)(red)(green 44) + #define A_SEQ2 (73 (split) clear)(BOOST_VMD_TYPE_LIST)(green 44) + #define A_SEQ_PLUS (mmf)(34)(^^)(!) 456 + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + + BOOST_VMD_ASSERT(25) + BOOST_VMD_ASSERT(BOOST_PP_DEC(2)) + BOOST_VMD_ASSERT(BOOST_PP_INC(255)) + BOOST_VMD_ASSERT + ( + BOOST_PP_EQUAL + ( + BOOST_PP_TUPLE_ELEM(2,A_PTUPLE), + 44 + ) + ) + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,AN_ARRAY_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)),156)) + BOOST_VMD_ASSERT + ( + BOOST_PP_EQUAL + ( + BOOST_PP_TUPLE_ELEM + ( + 2, + BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),(dummy1,zzz),BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX,BOOST_VMD_TYPE_IDENTIFIER) + ), + 1 + ) + ) + + BOOST_VMD_ASSERT(BOOST_VMD_IS_EMPTY(DATA BOOST_PP_EMPTY())) + BOOST_VMD_ASSERT(BOOST_VMD_IS_IDENTIFIER(JDATA,somevalue)) + BOOST_VMD_ASSERT(BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,2))) + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,A_LIST_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)),56)) + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)),73)) + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_SEQ_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,A_SEQ_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),34)) + BOOST_VMD_ASSERT(BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE))))) + + BOOST_VMD_ASSERT(BOOST_VMD_IS_TYPE(BOOST_PP_SEQ_ELEM(1,A_SEQ2))) + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail.cpp b/src/boost/libs/vmd/test/test_assert_fail.cpp new file mode 100644 index 000000000..af7f1bf95 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail.cxx b/src/boost/libs/vmd/test/test_assert_fail.cxx new file mode 100644 index 000000000..40b7ec0fc --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail.cxx @@ -0,0 +1,23 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_VMD_ASSERT(0) + +#else + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_array.cpp b/src/boost/libs/vmd/test/test_assert_fail_array.cpp new file mode 100644 index 000000000..dc09c53c3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_array.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_array.cxx b/src/boost/libs/vmd/test/test_assert_fail_array.cxx new file mode 100644 index 000000000..1a8f17481 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_array.cxx @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/assert.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY_PLUS (4,(mmf,34,^^,!)) 156 + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,AN_ARRAY_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_ARRAY)),256),BOOST_VMD_TEST_FAIL_ARRAY) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_identifier.cpp b/src/boost/libs/vmd/test/test_assert_fail_identifier.cpp new file mode 100644 index 000000000..86487b464 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_identifier.cxx b/src/boost/libs/vmd/test/test_assert_fail_identifier.cxx new file mode 100644 index 000000000..1f20d8911 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_identifier.cxx @@ -0,0 +1,41 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zzz ()) + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + + BOOST_VMD_ASSERT + ( + BOOST_PP_EQUAL + ( + BOOST_PP_TUPLE_ELEM + ( + 2, + BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(2,A_TUPLE),(dummy1,zzz),BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX,BOOST_VMD_TYPE_IDENTIFIER) + ), + 0 + ), + BOOST_VMD_TEST_FAIL_IDENTIFIER + ) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_is_empty.cpp b/src/boost/libs/vmd/test/test_assert_fail_is_empty.cpp new file mode 100644 index 000000000..a04e35de0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_is_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_is_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_is_empty.cxx b/src/boost/libs/vmd/test/test_assert_fail_is_empty.cxx new file mode 100644 index 000000000..ad16eda30 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_is_empty.cxx @@ -0,0 +1,25 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/facilities/empty.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define DATA x + + BOOST_VMD_ASSERT(BOOST_VMD_IS_EMPTY(DATA BOOST_PP_EMPTY()),BOOST_VMD_TEST_FAIL_IS_EMPTY) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_is_identifier.cpp b/src/boost/libs/vmd/test/test_assert_fail_is_identifier.cpp new file mode 100644 index 000000000..49cb18192 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_is_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_is_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_is_identifier.cxx b/src/boost/libs/vmd/test/test_assert_fail_is_identifier.cxx new file mode 100644 index 000000000..b7ffe1c9f --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_is_identifier.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define JDATA somevalue + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + + BOOST_VMD_ASSERT(BOOST_VMD_IS_IDENTIFIER(JDATA,zzz),BOOST_VMD_TEST_FAIL_IS_IDENTIFIER) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_is_number.cpp b/src/boost/libs/vmd/test/test_assert_fail_is_number.cpp new file mode 100644 index 000000000..45641ac46 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_is_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_is_number.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_is_number.cxx b/src/boost/libs/vmd/test/test_assert_fail_is_number.cxx new file mode 100644 index 000000000..40c190fb0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_is_number.cxx @@ -0,0 +1,25 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/is_number.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT(BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,1)),BOOST_VMD_TEST_FAIL_IS_NUMBER) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_list.cpp b/src/boost/libs/vmd/test/test_assert_fail_list.cpp new file mode 100644 index 000000000..e5aa707db --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_list.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_list.cxx b/src/boost/libs/vmd/test/test_assert_fail_list.cxx new file mode 100644 index 000000000..8d4d92f31 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_list.cxx @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 56 + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,A_LIST_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)),36),BOOST_VMD_TEST_FAIL_LIST) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_number.cpp b/src/boost/libs/vmd/test/test_assert_fail_number.cpp new file mode 100644 index 000000000..d5b493816 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_number.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_number.cxx b/src/boost/libs/vmd/test/test_assert_fail_number.cxx new file mode 100644 index 000000000..c82f3d068 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_number.cxx @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (73 (split) clear)(red)(green 44) + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,BOOST_PP_SEQ_ELEM(0,A_SEQ),BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)),72),BOOST_VMD_TEST_FAIL_NUMBER) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_number2.cpp b/src/boost/libs/vmd/test/test_assert_fail_number2.cpp new file mode 100644 index 000000000..d5fa6e764 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_number2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_number2.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_number2.cxx b/src/boost/libs/vmd/test/test_assert_fail_number2.cxx new file mode 100644 index 000000000..66166d11e --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_number2.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/number2.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (73 (split) clear)(red)(green 44) + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_NUMBER(BOOST_PP_SEQ_ELEM(0,A_SEQ))),72),BOOST_VMD_TEST_FAIL_NUMBER) + +#else + + typedef char BOOST_VMD_TEST_FAIL_NUMBER[-1]; + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_seq.cpp b/src/boost/libs/vmd/test/test_assert_fail_seq.cpp new file mode 100644 index 000000000..f4b4c4119 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_seq.cxx b/src/boost/libs/vmd/test/test_assert_fail_seq.cxx new file mode 100644 index 000000000..c2ed1388f --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_seq.cxx @@ -0,0 +1,27 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ_PLUS (mmf)(34)(^^)(!) 456 + + BOOST_VMD_ASSERT(BOOST_PP_EQUAL(BOOST_PP_SEQ_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,A_SEQ_PLUS,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),456),BOOST_VMD_TEST_FAIL_SEQ) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_tuple.cpp b/src/boost/libs/vmd/test/test_assert_fail_tuple.cpp new file mode 100644 index 000000000..74234e0b2 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_tuple.cxx b/src/boost/libs/vmd/test/test_assert_fail_tuple.cxx new file mode 100644 index 000000000..0c9b4edd7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_tuple.cxx @@ -0,0 +1,26 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define KDATA (a,b) name + + BOOST_VMD_ASSERT(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,KDATA,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE))),BOOST_VMD_TEST_FAIL_TUPLE) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_fail_vcstring.cpp b/src/boost/libs/vmd/test/test_assert_fail_vcstring.cpp new file mode 100644 index 000000000..4244af6b2 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_vcstring.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_fail_vcstring.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_fail_vcstring.cxx b/src/boost/libs/vmd/test/test_assert_fail_vcstring.cxx new file mode 100644 index 000000000..500d4e7f1 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_fail_vcstring.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_VMD_ASSERT(0,BOOST_VMD_VC_FAILURE) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_array.cpp b/src/boost/libs/vmd/test/test_assert_is_array.cpp new file mode 100644 index 000000000..c8731ad6f --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_array.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_array.cxx b/src/boost/libs/vmd/test/test_assert_is_array.cxx new file mode 100644 index 000000000..3b4bb23ee --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array.cxx @@ -0,0 +1,35 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (7,(5,7,f,x,%,#,U)) +#if !BOOST_VMD_MSVC_V8 + #define AN_EMPTY_ARRAY (0,()) +#endif + + BOOST_VMD_ASSERT_IS_ARRAY((4,(x,3,e,2))) + BOOST_VMD_ASSERT_IS_ARRAY((6,(x,3,e,2,(4,(x,3,e,2)),%))) + BOOST_VMD_ASSERT_IS_ARRAY(AN_ARRAY) +#if !BOOST_VMD_MSVC_V8 + BOOST_VMD_ASSERT_IS_ARRAY(AN_EMPTY_ARRAY) +#endif + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_array_fail.cpp new file mode 100644 index 000000000..8301c3233 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_array_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_array_fail.cxx new file mode 100644 index 000000000..238135523 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail.cxx @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY((y,(x,3,e,2))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail2.cpp b/src/boost/libs/vmd/test/test_assert_is_array_fail2.cpp new file mode 100644 index 000000000..0652bfb31 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_array_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail2.cxx b/src/boost/libs/vmd/test/test_assert_is_array_fail2.cxx new file mode 100644 index 000000000..8b7354573 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY((3,(x,3,e,2))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail3.cpp b/src/boost/libs/vmd/test/test_assert_is_array_fail3.cpp new file mode 100644 index 000000000..a4b00bbae --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_array_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail3.cxx b/src/boost/libs/vmd/test/test_assert_is_array_fail3.cxx new file mode 100644 index 000000000..074fad2a7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY(tree) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail4.cpp b/src/boost/libs/vmd/test/test_assert_is_array_fail4.cpp new file mode 100644 index 000000000..b712e2dea --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_array_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_array_fail4.cxx b/src/boost/libs/vmd/test/test_assert_is_array_fail4.cxx new file mode 100644 index 000000000..b057d06dd --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_array_fail4.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_ARRAY((3,(3,5,6) xc)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_ARRAY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_empty.cpp b/src/boost/libs/vmd/test/test_assert_is_empty.cpp new file mode 100644 index 000000000..261b24842 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_empty.cxx b/src/boost/libs/vmd/test/test_assert_is_empty.cxx new file mode 100644 index 000000000..605c37d75 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty.cxx @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_empty.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define DATA + #define OBJECT OBJECT2 + #define OBJECT2 + #define FUNC(x) FUNC2(x) + #define FUNC2(x) + + BOOST_VMD_ASSERT_IS_EMPTY(BOOST_PP_EMPTY()) + BOOST_VMD_ASSERT_IS_EMPTY(DATA BOOST_PP_EMPTY()) + BOOST_VMD_ASSERT_IS_EMPTY(OBJECT BOOST_PP_EMPTY()) + BOOST_VMD_ASSERT_IS_EMPTY(FUNC(z) BOOST_PP_EMPTY()) + +#if BOOST_VMD_MSVC + + #define FUNC_GEN() () + #define FUNC_GEN2(x) () + #define FUNC_GEN3(x,y) () + + /* This shows that VC++ does not work correctly in these cases. */ + + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN) /* This incorrectly does not assert */ + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN2) /* This incorrectly does not assert */ + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN3) /* This should produce a compiler error but does not and does not assert */ + +#endif /* BOOST_VMD_MSVC */ + +#else + + BOOST_VMD_ASSERT(0) + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_empty_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_empty_fail.cpp new file mode 100644 index 000000000..f28ce18ca --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_empty_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_empty_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_empty_fail.cxx new file mode 100644 index 000000000..b4a63cb74 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty_fail.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA && !BOOST_VMD_MSVC + + #define FUNC_GEN(x,y) anything + + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN)) + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_empty_fail2.cpp b/src/boost/libs/vmd/test/test_assert_is_empty_fail2.cpp new file mode 100644 index 000000000..fa4973c9e --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_empty_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_empty_fail2.cxx b/src/boost/libs/vmd/test/test_assert_is_empty_fail2.cxx new file mode 100644 index 000000000..cae149922 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty_fail2.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + #define FUNC_GEN() anything + + BOOST_VMD_ASSERT_IS_EMPTY(FUNC_GEN)) + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_empty_fail3.cpp b/src/boost/libs/vmd/test/test_assert_is_empty_fail3.cpp new file mode 100644 index 000000000..1c6abaa19 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_empty_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_empty_fail3.cxx b/src/boost/libs/vmd/test/test_assert_is_empty_fail3.cxx new file mode 100644 index 000000000..97ae47368 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_empty_fail3.cxx @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_empty.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_EMPTY(x BOOST_PP_EMPTY()) + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_identifier.cpp b/src/boost/libs/vmd/test/test_assert_is_identifier.cpp new file mode 100644 index 000000000..aa765da52 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_identifier.cxx b/src/boost/libs/vmd/test/test_assert_is_identifier.cxx new file mode 100644 index 000000000..5ce5b77cb --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_identifier.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_identifier.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zzz) + #define JDATA somevalue + #define A_SEQ (num)(%)(#) + #define A_LIST (eeb,(grist,(&,BOOST_PP_NIL))) + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + #define BOOST_VMD_REGISTER_num (num) + #define BOOST_VMD_DETECT_num_num + #define BOOST_VMD_REGISTER_eeb (eeb) + #define BOOST_VMD_DETECT_eeb_eeb + #define BOOST_VMD_REGISTER_grist (grist) + #define BOOST_VMD_DETECT_grist_grist + + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_TUPLE_ELEM(2,A_TUPLE),zzz) + BOOST_VMD_ASSERT_IS_IDENTIFIER(JDATA,somevalue) + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_SEQ_ELEM(0,A_SEQ),num) + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,0),eeb) + BOOST_VMD_ASSERT_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,1),grist) + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_identifier_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_identifier_fail.cpp new file mode 100644 index 000000000..9a3c717c8 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_identifier_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_identifier_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_identifier_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_identifier_fail.cxx new file mode 100644 index 000000000..5eb5199ff --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_identifier_fail.cxx @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_identifier.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + + BOOST_VMD_ASSERT_IS_IDENTIFIER(zzz,somevalue) + +#else + + typedef char BOOST_VMD_IS_IDENTIFIER_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_list.cpp b/src/boost/libs/vmd/test/test_assert_is_list.cpp new file mode 100644 index 000000000..ede28f183 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_list.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_list.cxx b/src/boost/libs/vmd/test/test_assert_is_list.cxx new file mode 100644 index 000000000..5c3aa23c2 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list.cxx @@ -0,0 +1,30 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (e,(g,(&,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT_IS_LIST((4,(x,BOOST_PP_NIL))) + BOOST_VMD_ASSERT_IS_LIST(((3,6m,irj),(x,BOOST_PP_NIL))) + BOOST_VMD_ASSERT_IS_LIST(A_LIST) + BOOST_VMD_ASSERT_IS_LIST(BOOST_PP_NIL) + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_list_fail.cpp new file mode 100644 index 000000000..00684c8f3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_list_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_list_fail.cxx new file mode 100644 index 000000000..f1babad53 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST((4,(x))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail2.cpp b/src/boost/libs/vmd/test/test_assert_is_list_fail2.cpp new file mode 100644 index 000000000..4b1fbd676 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_list_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail2.cxx b/src/boost/libs/vmd/test/test_assert_is_list_fail2.cxx new file mode 100644 index 000000000..64c725ad1 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST((4,(5,BOOST_PP_NIL),6)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail3.cpp b/src/boost/libs/vmd/test/test_assert_is_list_fail3.cpp new file mode 100644 index 000000000..0d6c97974 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_list_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail3.cxx b/src/boost/libs/vmd/test/test_assert_is_list_fail3.cxx new file mode 100644 index 000000000..90857e6bc --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST(4,(5,BOOST_PP_NIL),6) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail4.cpp b/src/boost/libs/vmd/test/test_assert_is_list_fail4.cpp new file mode 100644 index 000000000..907744ae5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_list_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_list_fail4.cxx b/src/boost/libs/vmd/test/test_assert_is_list_fail4.cxx new file mode 100644 index 000000000..4866f6ae6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_list_fail4.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_LIST((tt,(5,(uu,BOOST_PP_NIL yy)))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_LIST_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_number.cpp b/src/boost/libs/vmd/test/test_assert_is_number.cpp new file mode 100644 index 000000000..3d1886599 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_number.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_number.cxx b/src/boost/libs/vmd/test/test_assert_is_number.cxx new file mode 100644 index 000000000..8657be88f --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_number.cxx @@ -0,0 +1,36 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_number.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + + #if BOOST_PP_VARIADICS + + #define A_TUPLE (4,241,zzz) + #define KDATA 213 + #define A_SEQ (num)(78)(42) + #define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT_IS_NUMBER(BOOST_PP_TUPLE_ELEM(1,A_TUPLE)) + BOOST_VMD_ASSERT_IS_NUMBER(KDATA) + BOOST_VMD_ASSERT_IS_NUMBER(BOOST_PP_SEQ_ELEM(2,A_SEQ)) + BOOST_VMD_ASSERT_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,2)) + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_number_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_number_fail.cpp new file mode 100644 index 000000000..cf112a195 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_number_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_number_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_number_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_number_fail.cxx new file mode 100644 index 000000000..ff4c3efa6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_number_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_number.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_NUMBER(data) + +#else + + typedef char BOOST_VMD_ASSERT_IS_NUMBER_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_seq.cpp b/src/boost/libs/vmd/test/test_assert_is_seq.cpp new file mode 100644 index 000000000..00c14c7c7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_seq.cxx b/src/boost/libs/vmd/test/test_assert_is_seq.cxx new file mode 100644 index 000000000..0a917bac8 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq.cxx @@ -0,0 +1,47 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_seq.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ATUPLE (0,1,2,3,((VMD_TEST_88_,VMD_TEST_1_))((VMD_TEST_99_,VMD_TEST_3_))((VMD_TEST_2_))((VMD_TEST_99_,VMD_TEST_100_,VMD_TEST_101_))) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_SEQ () + +#endif + + BOOST_VMD_ASSERT_IS_SEQ((x)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)(z)(2)(3)(4)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)(4)) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)((4,(x,BOOST_PP_NIL)))) + BOOST_VMD_ASSERT_IS_SEQ((x)(y)((x)(y)(z)(2)(3)(4))((1,2))(3)((4,(x,BOOST_PP_NIL)))) + BOOST_VMD_ASSERT_IS_SEQ(BOOST_PP_TUPLE_ELEM(4,ATUPLE)) + +#if !BOOST_VMD_MSVC_V8 + + BOOST_VMD_ASSERT_IS_SEQ(()) + BOOST_VMD_ASSERT_IS_SEQ(AN_EMPTY_SEQ) + +#endif + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_seq_fail.cpp new file mode 100644 index 000000000..964e3ccd1 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_seq_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_seq_fail.cxx new file mode 100644 index 000000000..a47dcc33b --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ((y,(x,3,e,2))) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail2.cpp b/src/boost/libs/vmd/test/test_assert_is_seq_fail2.cpp new file mode 100644 index 000000000..d76981a4d --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_seq_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail2.cxx b/src/boost/libs/vmd/test/test_assert_is_seq_fail2.cxx new file mode 100644 index 000000000..ff21c6c16 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ((y)2(x)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail3.cpp b/src/boost/libs/vmd/test/test_assert_is_seq_fail3.cpp new file mode 100644 index 000000000..ffc9851bc --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_seq_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail3.cxx b/src/boost/libs/vmd/test/test_assert_is_seq_fail3.cxx new file mode 100644 index 000000000..9f3117e77 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ(y(z)(x)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail4.cpp b/src/boost/libs/vmd/test/test_assert_is_seq_fail4.cpp new file mode 100644 index 000000000..541ae3b04 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_seq_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_seq_fail4.cxx b/src/boost/libs/vmd/test/test_assert_is_seq_fail4.cxx new file mode 100644 index 000000000..72e154c23 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_seq_fail4.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_SEQ((z)(x)(72)64) + +#else + + typedef char BOOST_VMD_ASSERT_IS_SEQ_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple.cpp b/src/boost/libs/vmd/test/test_assert_is_tuple.cpp new file mode 100644 index 000000000..7c5052c22 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple.cxx b/src/boost/libs/vmd/test/test_assert_is_tuple.cxx new file mode 100644 index 000000000..d8f7c6e14 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zz) + #define A_TUPLE2 (*,#,(zz,44,(e7))) + #define AN_ARRAY (4,(5,7,f,x)) + #define A_LIST (e,(g,(&,BOOST_PP_NIL))) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_TUPLE () + +#endif + + BOOST_VMD_ASSERT_IS_TUPLE((t,3,e,2)) + BOOST_VMD_ASSERT_IS_TUPLE(((y,s,w),3,e,2)) + BOOST_VMD_ASSERT_IS_TUPLE(A_TUPLE) + BOOST_VMD_ASSERT_IS_TUPLE(A_TUPLE2) + BOOST_VMD_ASSERT_IS_TUPLE(AN_ARRAY) + BOOST_VMD_ASSERT_IS_TUPLE(A_LIST) + +#if !BOOST_VMD_MSVC_V8 + + BOOST_VMD_ASSERT_IS_TUPLE(()) + BOOST_VMD_ASSERT_IS_TUPLE(AN_EMPTY_TUPLE) + +#endif + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_tuple_fail.cpp new file mode 100644 index 000000000..4e0b7ff77 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_tuple_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_tuple_fail.cxx new file mode 100644 index 000000000..8878c1638 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_TUPLE((x,3,e,2)ty) + +#else + + typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail2.cpp b/src/boost/libs/vmd/test/test_assert_is_tuple_fail2.cpp new file mode 100644 index 000000000..32b2c6256 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_tuple_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail2.cxx b/src/boost/libs/vmd/test/test_assert_is_tuple_fail2.cxx new file mode 100644 index 000000000..9085df467 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail2.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_TUPLE(op(x,3,e,2)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail3.cpp b/src/boost/libs/vmd/test/test_assert_is_tuple_fail3.cpp new file mode 100644 index 000000000..6d049c8e7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_tuple_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail3.cxx b/src/boost/libs/vmd/test/test_assert_is_tuple_fail3.cxx new file mode 100644 index 000000000..19735c647 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail3.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_TUPLE(x,3,e,2) + +#else + + typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail4.cpp b/src/boost/libs/vmd/test/test_assert_is_tuple_fail4.cpp new file mode 100644 index 000000000..434247682 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_tuple_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_tuple_fail4.cxx b/src/boost/libs/vmd/test/test_assert_is_tuple_fail4.cxx new file mode 100644 index 000000000..be4af2299 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_tuple_fail4.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_TUPLE((x,3,e,2)(y,rr)) + +#else + + typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_type.cpp b/src/boost/libs/vmd/test/test_assert_is_type.cpp new file mode 100644 index 000000000..cbb274315 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_type.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_type.cxx b/src/boost/libs/vmd/test/test_assert_is_type.cxx new file mode 100644 index 000000000..1ae7683f0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_type.cxx @@ -0,0 +1,36 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_type.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + + #if BOOST_PP_VARIADICS + + #define A_TUPLE (4,BOOST_VMD_TYPE_ARRAY,zzz) + #define KDATA BOOST_VMD_TYPE_TYPE + #define A_SEQ (num)(78)(BOOST_VMD_TYPE_UNKNOWN) + #define A_LIST (eeb,(grist,(BOOST_VMD_TYPE_EMPTY,BOOST_PP_NIL))) + + BOOST_VMD_ASSERT_IS_TYPE(BOOST_PP_TUPLE_ELEM(1,A_TUPLE)) + BOOST_VMD_ASSERT_IS_TYPE(KDATA) + BOOST_VMD_ASSERT_IS_TYPE(BOOST_PP_SEQ_ELEM(2,A_SEQ)) + BOOST_VMD_ASSERT_IS_TYPE(BOOST_PP_LIST_AT(A_LIST,2)) + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_assert_is_type_fail.cpp b/src/boost/libs/vmd/test/test_assert_is_type_fail.cpp new file mode 100644 index 000000000..771fe9fc0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_type_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_assert_is_type_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_assert_is_type_fail.cxx b/src/boost/libs/vmd/test/test_assert_is_type_fail.cxx new file mode 100644 index 000000000..ce79c2678 --- /dev/null +++ b/src/boost/libs/vmd/test/test_assert_is_type_fail.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_type.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + + BOOST_VMD_ASSERT_IS_TYPE(10) + +#else + + typedef char BOOST_VMD_ASSERT_IS_NUMBER_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_cmake/CMakeLists.txt b/src/boost/libs/vmd/test/test_cmake/CMakeLists.txt new file mode 100644 index 000000000..dc0d420b7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_cmake/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright 2018 Mike Dev +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt +# +# NOTE: This does NOT run the unit tests for Boost.Vmd. +# It only tests, if the CMakeLists.txt file in it's root works as expected + +cmake_minimum_required( VERSION 3.5 ) + +project( BoostVmdCMakeSelfTest ) + +add_subdirectory( ../../../preprocessor ${CMAKE_CURRENT_BINARY_DIR}/libs/preprocessor ) +add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_vmd ) + +add_executable( boost_vmd_cmake_self_test main.cpp ) +target_link_libraries( boost_vmd_cmake_self_test Boost::vmd ) + diff --git a/src/boost/libs/vmd/test/test_cmake/main.cpp b/src/boost/libs/vmd/test/test_cmake/main.cpp new file mode 100644 index 000000000..e662c03e5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_cmake/main.cpp @@ -0,0 +1,9 @@ +// 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 <boost/vmd/vmd.hpp> + +int main() { + +} diff --git a/src/boost/libs/vmd/test/test_doc_assert.cpp b/src/boost/libs/vmd/test/test_doc_assert.cpp new file mode 100644 index 000000000..57a83fe20 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_assert.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_assert.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_assert.cxx b/src/boost/libs/vmd/test/test_doc_assert.cxx new file mode 100644 index 000000000..09dd9aa33 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_assert.cxx @@ -0,0 +1,47 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/greater.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_MSVC + + #define AMACRO(atuple) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_ASSERT_IS_TUPLE(atuple), \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) \ + ) + +#else + + #define AMACRO(atuple) \ + BOOST_VMD_ASSERT_IS_TUPLE(atuple) \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) + +#endif + + BOOST_TEST(AMACRO((1,2,3))); + BOOST_TEST(!AMACRO((1,2))); + +#else + + BOOST_VMD_ASSERT(0) + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_assert_fail.cpp b/src/boost/libs/vmd/test/test_doc_assert_fail.cpp new file mode 100644 index 000000000..1d40d8791 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_assert_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_assert_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_assert_fail.cxx b/src/boost/libs/vmd/test/test_doc_assert_fail.cxx new file mode 100644 index 000000000..6dbe362ca --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_assert_fail.cxx @@ -0,0 +1,50 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/assert_is_tuple.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/greater.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if BOOST_VMD_ASSERT_DATA + +#if BOOST_VMD_MSVC + + #define AMACRO(atuple) \ + BOOST_PP_CAT \ + ( \ + BOOST_VMD_ASSERT_IS_TUPLE(atuple), \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) \ + ) + +#else + + #define AMACRO(atuple) \ + BOOST_VMD_ASSERT_IS_TUPLE(atuple) \ + BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(atuple), 2),1,0) + +#endif + + BOOST_TEST(AMACRO(73)); + +#else + + typedef char BOOST_VMD_DOC_ASSERT_FAIL_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty.cpp b/src/boost/libs/vmd/test/test_doc_empty.cpp new file mode 100644 index 000000000..59cea06a5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty.cxx b/src/boost/libs/vmd/test/test_doc_empty.cxx new file mode 100644 index 000000000..857c582b0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty.cxx @@ -0,0 +1,121 @@ + +// (C) Copyright Edward Diener 2011-2015,2019 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/preprocessor/variadic/has_opt.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define USE_VA_OPT BOOST_PP_VARIADIC_HAS_OPT() + + #define SMACRO() someoutput + #define EMACRO(x) otheroutput x + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(SMACRO())); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(EMACRO(somedata))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(EMACRO())); + + #define MMACRO(x,y,z) x y z + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(MMACRO(1,,2))); + + #define VMACRO(x,...) x __VA_ARGS__ + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(VMACRO(somedata,))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1,VMACRO(somedata,vdata1,,vdata3)))); + + #define TMACRO(x,atuple) x atuple + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(TMACRO(somedata,()))); + +#endif + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(TMACRO(somedata,(telem1,,telem2,teleem3)))); + + #define RMACRO(x,y,z) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(RMACRO(data1,data2,data3))); + +#if !BOOST_VMD_MSVC_V8 + + #define TRETMACRO(x,y,z) () + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,TRETMACRO(1,2,3)))); + +#endif + + #define TRETMACRO1(x,y,z) (x,,y,,z) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(3,TRETMACRO1(1,2,3)))); + + #define VRETMACRO(x,y,z) x,,y,,z + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(3,VRETMACRO(1,2,3)))); + + #define FMACRO(x,y) any_output + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO(arg1,arg2))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(someinput FMACRO(arg1,arg2))); + +#if BOOST_VMD_MSVC + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO(1))); + +#endif + +#if BOOST_VMD_MSVC + + #define FMACRO1(parameter) FMACRO3 parameter() + #define FMACRO2() () + #define FMACRO3() 1 + + int MSVC_number_one = FMACRO1(FMACRO2); + +#endif + + #define FMACRO4() ( any_number_of_tuple_elements ) + #define FMACRO5(param) ( any_number_of_tuple_elements ) + +#if USE_VA_OPT + + #define FMACRO6(param1,param2) ( any_number_of_tuple_elements ) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO4)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO5)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO6)); + +#elif BOOST_VMD_MSVC + + #define FMACRO6(param1,param2) ( any_number_of_tuple_elements ) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(FMACRO4)); + BOOST_TEST(BOOST_VMD_IS_EMPTY(FMACRO5)); + BOOST_TEST(BOOST_VMD_IS_EMPTY(FMACRO6)); + +#else + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO4)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO5)); + +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail.cpp new file mode 100644 index 000000000..e371c3372 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail.cxx new file mode 100644 index 000000000..ac17d00cd --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/detail/setup.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC + + #define SMACRO() 1 + + BOOST_TEST(SMACRO(1)); + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail2.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail2.cpp new file mode 100644 index 000000000..6466481c0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail2.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail2.cxx new file mode 100644 index 000000000..61d3feb61 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail2.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/detail/setup.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC && !(defined(__cplusplus) && __cplusplus > 201703L) + + #define VMACRO(x,...) x __VA_ARGS__ + + BOOST_TEST(VMACRO(1)); + +#else + + typedef char BOOST_VMD_GENERATE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail3.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail3.cpp new file mode 100644 index 000000000..9666d8000 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail3.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail3.cxx new file mode 100644 index 000000000..a610b621b --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail3.cxx @@ -0,0 +1,32 @@ + +// (C) Copyright Edward Diener 2011-2015,2019 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/variadic/has_opt.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC && !BOOST_PP_VARIADIC_HAS_OPT() + + #define FMACRO(x,y) any_output + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO)); + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail4.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail4.cpp new file mode 100644 index 000000000..6f5f5f155 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail4.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail4.cxx new file mode 100644 index 000000000..3624e401b --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail4.cxx @@ -0,0 +1,32 @@ + +// (C) Copyright Edward Diener 2011-2015,2019 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/variadic/has_opt.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC && !BOOST_PP_VARIADIC_HAS_OPT() + + #define FMACRO(x,y) any_output + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(some_input FMACRO)); + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail6.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail6.cpp new file mode 100644 index 000000000..836855f95 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail6.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail6.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail6.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail6.cxx new file mode 100644 index 000000000..f128774b6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail6.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/detail/setup.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC + + #define FMACRO(x,y) 1 + + BOOST_TEST(FMACRO(1)); + +#else + + typedef char BOOST_VMD_GENERATE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail7.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail7.cpp new file mode 100644 index 000000000..37a899b07 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail7.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail7.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail7.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail7.cxx new file mode 100644 index 000000000..8687a2b4a --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail7.cxx @@ -0,0 +1,32 @@ + +// (C) Copyright Edward Diener 2011-2015,2019 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/variadic/has_opt.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC && !BOOST_PP_VARIADIC_HAS_OPT() + + #define FMACRO6(param1,param2) ( any_number_of_tuple_elements ) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FMACRO6)); + +#else + + typedef char BOOST_VMD_GENERATE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail8.cpp b/src/boost/libs/vmd/test/test_doc_empty_fail8.cpp new file mode 100644 index 000000000..ec6ebedcb --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail8.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_empty_fail8.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_empty_fail8.cxx b/src/boost/libs/vmd/test/test_doc_empty_fail8.cxx new file mode 100644 index 000000000..fc1e3c455 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_empty_fail8.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/detail/setup.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC + + #define FMACRO1(parameter) FMACRO3 parameter() + #define FMACRO2() () + #define FMACRO3() 1 + + int x = FMACRO1(FMACRO2); + +#else + + typedef char BOOST_VMD_GENERATE_ERROR[-1]; + +#endif + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_equality.cpp b/src/boost/libs/vmd/test/test_doc_equality.cpp new file mode 100644 index 000000000..ffb441e75 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_equality.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_equality.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_equality.cxx b/src/boost/libs/vmd/test/test_doc_equality.cxx new file mode 100644 index 000000000..9c51fd3a9 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_equality.cxx @@ -0,0 +1,78 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_AN_ID1 (AN_ID1) + #define BOOST_VMD_REGISTER_AN_ID2 (AN_ID2) + + #define BOOST_VMD_DETECT_AN_ID1_AN_ID1 + #define BOOST_VMD_DETECT_AN_ID2_AN_ID2 + + #define AN_IDENTIFIER1 AN_ID1 + #define AN_IDENTIFIER2 AN_ID2 + #define AN_IDENTIFIER3 AN_ID1 // same as AN_IDENTIFIER1 = AN_ID1 + + #define A_NUMBER1 33 + #define A_NUMBER2 145 + #define A_NUMBER3 33 // same as A_NUMBER1 = 33 + + #define A_TUPLE1 (AN_IDENTIFIER1,A_NUMBER1) + #define A_TUPLE2 (AN_IDENTIFIER1,A_NUMBER2) + #define A_TUPLE3 (AN_IDENTIFIER3,A_NUMBER3) // same as A_TUPLE1 = (AN_ID1,33) + + #define A_SEQ1 (A_NUMBER1)(A_TUPLE1) + #define A_SEQ2 (A_NUMBER2)(A_TUPLE2) + #define A_SEQ3 (A_NUMBER3)(A_TUPLE3) // same as A_SEQ1 = (33)((AN_ID1,33)) + + BOOST_TEST(!BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER2)); + BOOST_TEST(BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3)); + BOOST_TEST(!BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER2)); + BOOST_TEST(BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3)); + BOOST_TEST(!BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE2)); + BOOST_TEST(BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3)); + BOOST_TEST(!BOOST_VMD_EQUAL(A_SEQ1,A_SEQ2)); + BOOST_TEST(BOOST_VMD_EQUAL(A_SEQ1,A_SEQ3)); + + #define TUPLE_IS_ARRAY1 (2,(3,4)) + #define TUPLE_IS_ARRAY2 (2,(4,5)) + #define TUPLE_IS_ARRAY3 (2,(3,4)) + + #define TUPLE_IS_LIST1 (55,BOOST_PP_NIL) + #define TUPLE_IS_LIST2 (135,BOOST_PP_NIL) + #define TUPLE_IS_LIST3 (55,BOOST_PP_NIL) + + #define TUPLE_IS_LIST_OR_ARRAY1 (2,(3,BOOST_PP_NIL)) + #define TUPLE_IS_LIST_OR_ARRAY2 (2,(4,BOOST_PP_NIL)) + #define TUPLE_IS_LIST_OR_ARRAY3 (2,(3,BOOST_PP_NIL)) + + BOOST_TEST(!BOOST_VMD_EQUAL(TUPLE_IS_ARRAY1,TUPLE_IS_ARRAY2)); + BOOST_TEST(BOOST_VMD_EQUAL(TUPLE_IS_ARRAY1,TUPLE_IS_ARRAY3)); + BOOST_TEST(!BOOST_VMD_EQUAL(TUPLE_IS_LIST1,TUPLE_IS_LIST2)); + BOOST_TEST(BOOST_VMD_EQUAL(TUPLE_IS_LIST1,TUPLE_IS_LIST3)); + BOOST_TEST(!BOOST_VMD_EQUAL(TUPLE_IS_LIST_OR_ARRAY1,TUPLE_IS_LIST_OR_ARRAY2)); + BOOST_TEST(BOOST_VMD_EQUAL(TUPLE_IS_LIST_OR_ARRAY1,TUPLE_IS_LIST_OR_ARRAY3)); + + #define A_TUPLE_1 (3,4,"astring") + #define A_TUPLE_2 (3,4) + + BOOST_TEST(!BOOST_VMD_EQUAL(A_TUPLE_1,A_TUPLE_2)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_example_switch.cpp b/src/boost/libs/vmd/test/test_doc_example_switch.cpp new file mode 100644 index 000000000..c1d733324 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_example_switch.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_example_switch.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_example_switch.cxx b/src/boost/libs/vmd/test/test_doc_example_switch.cxx new file mode 100644 index 000000000..42985d2d8 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_example_switch.cxx @@ -0,0 +1,157 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/identity.hpp> +#include <libs/vmd/test/test_doc_example_switch.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +//[ example_switch_defines + +#define BOOST_VMD_SWITCH_TEST_1(number) \ + test1_ ## number +/**/ + +#define BOOST_VMD_SWITCH_TEST_2(number) \ + test2_ ## number +/**/ + +#define BOOST_VMD_SWITCH_TEST_3(number) \ + test3_ ## number +/**/ + +#define BOOST_VMD_SWITCH_TEST_DEFAULT(number) \ + test_default_ ## number +/**/ + +//] + +#define BOOST_VMD_REGISTER_test1_7 (test1_7) +#define BOOST_VMD_REGISTER_test2_7 (test2_7) +#define BOOST_VMD_REGISTER_test3_7 (test3_7) +#define BOOST_VMD_REGISTER_test_default_7 (test_default_7) +#define BOOST_VMD_DETECT_test1_7_test1_7 +#define BOOST_VMD_DETECT_test2_7_test2_7 +#define BOOST_VMD_DETECT_test3_7_test3_7 +#define BOOST_VMD_DETECT_test_default_7_test_default_7 + +BOOST_TEST(BOOST_VMD_EQUAL + ( +//[ example_switch_defines_t1 + BOOST_VMD_SWITCH(1, + (7), + (BOOST_VMD_SWITCH_TEST_DEFAULT), + (3,BOOST_VMD_SWITCH_TEST_3), + (1,BOOST_VMD_SWITCH_TEST_1), + (2,BOOST_VMD_SWITCH_TEST_2) + ) +//] + ,test1_7 + ) + ); + +BOOST_TEST(BOOST_VMD_EQUAL + ( + BOOST_VMD_SWITCH(2, + (7), + (BOOST_VMD_SWITCH_TEST_DEFAULT), + (1,BOOST_VMD_SWITCH_TEST_1), + (3,BOOST_VMD_SWITCH_TEST_3), + (2,BOOST_VMD_SWITCH_TEST_2) + ) + ,test2_7 + ) + ); + +BOOST_TEST(BOOST_VMD_EQUAL + ( + BOOST_VMD_SWITCH(3, + (7), + (BOOST_VMD_SWITCH_TEST_DEFAULT), + (1,BOOST_VMD_SWITCH_TEST_1), + (2,BOOST_VMD_SWITCH_TEST_2), + (3,BOOST_VMD_SWITCH_TEST_3) + ) + ,test3_7 + ) + ); + +BOOST_TEST(BOOST_VMD_EQUAL + ( +//[ example_switch_defines_t4 + BOOST_VMD_SWITCH(4, + (7), + (BOOST_VMD_SWITCH_TEST_DEFAULT), + (2,BOOST_VMD_SWITCH_TEST_2), + (1,BOOST_VMD_SWITCH_TEST_1), + (3,BOOST_VMD_SWITCH_TEST_3) + ) +//] + ,test_default_7 + ) + ); + +BOOST_TEST(BOOST_VMD_EQUAL + ( +//[ example_switch_defines_t5 + BOOST_VMD_SWITCH(143, + (7), + (BOOST_VMD_SWITCH_TEST_DEFAULT), + (1,BOOST_VMD_SWITCH_TEST_1), + (2,BOOST_VMD_SWITCH_TEST_2), + (3,BOOST_VMD_SWITCH_TEST_3), + (143,BOOST_VMD_SWITCH_IDENTITY(55)) + ) +//] + ,55 + ) + ); + +BOOST_TEST(BOOST_VMD_EQUAL + ( +//[ example_switch_defines_t6 + BOOST_VMD_SWITCH(155, + (7), + (BOOST_VMD_SWITCH_IDENTITY(77)), + (1,BOOST_VMD_SWITCH_TEST_1), + (2,BOOST_VMD_SWITCH_TEST_2), + (3,BOOST_VMD_SWITCH_TEST_3), + (143,BOOST_VMD_SWITCH_IDENTITY(55)) + ) +//] + ,77 + ) + ); + +BOOST_TEST(BOOST_VMD_EQUAL + ( +//[ example_switch_defines_t7 + BOOST_VMD_SWITCH(BOOST_VMD_TYPE_TUPLE, + (7), + (BOOST_VMD_SWITCH_TEST_DEFAULT), + (BOOST_VMD_TYPE_TUPLE,BOOST_VMD_SWITCH_TEST_1), + ((1,2,3),BOOST_VMD_SWITCH_TEST_3), + (2,BOOST_VMD_SWITCH_TEST_2) + ) +//] + ,test1_7 + ) + ); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_example_switch.hpp b/src/boost/libs/vmd/test/test_doc_example_switch.hpp new file mode 100644 index 000000000..09d9ed0ce --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_example_switch.hpp @@ -0,0 +1,522 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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_VMD_TEST_DOC_EXAMPLE_SWITCH_HPP) +#define BOOST_VMD_TEST_DOC_EXAMPLE_SWITCH_HPP + +//[ example_switch + +#include <boost/vmd/detail/setup.hpp> + +#if BOOST_PP_VARIADICS + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/arithmetic/inc.hpp> +#include <boost/preprocessor/comparison/equal.hpp> +#include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/preprocessor/control/while.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/enum.hpp> +#include <boost/preprocessor/facilities/expand.hpp> +#include <boost/preprocessor/tuple/replace.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/preprocessor/variadic/to_tuple.hpp> +#include <boost/preprocessor/variadic/size.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/identity.hpp> +#include <boost/vmd/is_empty.hpp> + +/* + + State index into state values + +*/ + +#define BOOST_VMD_SWITCH_STATE_ELEM_INDEX 2 +#define BOOST_VMD_SWITCH_STATE_ELEM_DEFAULT 4 +#define BOOST_VMD_SWITCH_STATE_ELEM_RESULT 5 + +/* + + Retrieve the state value, never changes + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_VALUE(state) \ + BOOST_PP_TUPLE_ELEM(0,state) \ +/**/ + +/* + + Retrieve the state tuple of values, never changes + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_CHOICES(state) \ + BOOST_PP_TUPLE_ELEM(1,state) \ +/**/ + +/* + + Retrieve the state index + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_INDEX(state) \ + BOOST_PP_TUPLE_ELEM(2,state) \ +/**/ + +/* + + Retrieve the state tuple of values size, never changes + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_SIZE(state) \ + BOOST_PP_TUPLE_ELEM(3,state) \ +/**/ + +/* + + Retrieve the state default tuple + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_DEFAULT(state) \ + BOOST_PP_TUPLE_ELEM(4,state) \ +/**/ + +/* + + Retrieve the state result tuple + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(5,state) \ +/**/ + +/* + + Retrieve the current value tuple + +*/ + +#define BOOST_VMD_SWITCH_STATE_GET_CURRENT_CHOICE(state) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + BOOST_VMD_SWITCH_STATE_GET_INDEX(state), \ + BOOST_VMD_SWITCH_STATE_GET_CHOICES(state) \ + ) \ +/**/ + +/* + + Expands to the state + + value = value to compare against + tuple = choices as a tuple of values + size = size of tuple of values + + None of these ever change in the WHILE state + +*/ + +#define BOOST_VMD_SWITCH_STATE_EXPAND(value,tuple,size) \ + (value,tuple,0,size,(0,),(,)) \ +/**/ + +/* + + Expands to the WHILE state + + The state to our WHILE consists of a tuple of elements: + + 1: value to compare against + 2: tuple of values. Each value is a value/macro pair or if the default just a macro + 3: index into the values + 4: tuple for default macro. 0 means no default macro, 1 means default macro and then second value is the default macro. + 5: tuple of result matched. Emptiness means no result yet specified, 0 means no match, 1 means match and second value is the matching macro. + +*/ + +#define BOOST_VMD_SWITCH_STATE(value,...) \ + BOOST_VMD_SWITCH_STATE_EXPAND \ + ( \ + value, \ + BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__), \ + BOOST_PP_VARIADIC_SIZE(__VA_ARGS__) \ + ) \ +/**/ + +/* + + Sets the state upon a successful match. + + macro = is the matching macro found + +*/ + +#define BOOST_VMD_SWITCH_OP_SUCCESS(d,state,macro) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_ELEM_RESULT, \ + (1,macro) \ + ) \ +/**/ + +/* + + Sets the state upon final failure to find a match. + + def = default tuple macro, ignored + +*/ + +#define BOOST_VMD_SWITCH_OP_FAILURE(d,state,def) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_ELEM_RESULT, \ + (0,) \ + ) \ +/**/ + +/* + + Increments the state index into the tuple values + +*/ + +#define BOOST_VMD_SWITCH_OP_UPDATE_INDEX(d,state) \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_ELEM_INDEX, \ + BOOST_PP_INC(BOOST_VMD_SWITCH_STATE_GET_INDEX(state)) \ + ) \ +/**/ + +/* + + Choose our current value's macro as our successful match + + tuple = current tuple to test + +*/ + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_MATCH(d,state,tuple) \ + BOOST_VMD_SWITCH_OP_SUCCESS(d,state,BOOST_PP_TUPLE_ELEM(1,tuple)) \ +/**/ + +/* + + Update our state index + + tuple = current tuple to test, ignored + +*/ + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_UPDATE_INDEX(d,state,tuple) \ + BOOST_VMD_SWITCH_OP_UPDATE_INDEX(d,state) \ +/**/ + +/* + + Test our current value against our value to compare against + + tuple = current tuple to test + +*/ + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE(d,state,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_SWITCH_STATE_GET_VALUE(state), \ + BOOST_PP_TUPLE_ELEM(0,tuple) \ + ), \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_MATCH, \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE_UPDATE_INDEX \ + ) \ + (d,state,tuple) \ +/**/ + +/* + + Set our default macro and update the index in our WHILE state + + tuple = current tuple to test + +*/ + +#if BOOST_VMD_MSVC + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT_NN(number,name) \ + (number,name) \ +/**/ + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT(d,state,tuple) \ + BOOST_VMD_SWITCH_OP_UPDATE_INDEX \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_ELEM_DEFAULT, \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT_NN(1,BOOST_PP_TUPLE_ENUM(tuple)) \ + ) \ + ) \ +/**/ + +#else + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT(d,state,tuple) \ + BOOST_VMD_SWITCH_OP_UPDATE_INDEX \ + ( \ + d, \ + BOOST_PP_TUPLE_REPLACE_D \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_ELEM_DEFAULT, \ + (1,BOOST_PP_TUPLE_ENUM(tuple)) \ + ) \ + ) \ +/**/ + +#endif + +/* + + If our current value is a default macro, just set the default macro, + else test our current value. + + tuple = current tuple to test + +*/ + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT_TUPLE(d,state,tuple) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_PP_TUPLE_SIZE(tuple), \ + 1 \ + ), \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT_CREATE_DEFAULT, \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT_VALUE \ + ) \ + (d,state,tuple) \ +/**/ + +/* + + Test the current value in our tuple of values + +*/ + +#define BOOST_VMD_SWITCH_OP_TEST_CURRENT(d,state) \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT_TUPLE \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_GET_CURRENT_CHOICE(state) \ + ) \ +/**/ + +/* + + Choose the default macro as our successful match + + def = default tuple consisting of just the default macro name + +*/ + +#define BOOST_VMD_SWITCH_OP_DEFAULT_RET_CHOSEN(d,state,def) \ + BOOST_VMD_SWITCH_OP_SUCCESS \ + ( \ + d, \ + state, \ + BOOST_PP_TUPLE_ELEM(1,def) \ + ) \ +/**/ + +/* + + If the default macro exists, choose it else indicate no macro was found + + def = default tuple consisting of just the default macro name + +*/ + +#define BOOST_VMD_SWITCH_OP_DEFAULT_RET(d,state,def) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_TUPLE_ELEM(0,def), \ + BOOST_VMD_SWITCH_OP_DEFAULT_RET_CHOSEN, \ + BOOST_VMD_SWITCH_OP_FAILURE \ + ) \ + (d,state,def) \ +/**/ + +/* + + Try to choose the default macro if it exists + +*/ + +#define BOOST_VMD_SWITCH_OP_DEFAULT(d,state) \ + BOOST_VMD_SWITCH_OP_DEFAULT_RET \ + ( \ + d, \ + state, \ + BOOST_VMD_SWITCH_STATE_GET_DEFAULT(state) \ + ) \ +/**/ + +/* + + WHILE loop operation + + Check for the next value match or try to choose the default if all matches have been checked + +*/ + +#define BOOST_VMD_SWITCH_OP(d,state) \ + BOOST_PP_IIF \ + ( \ + BOOST_PP_EQUAL_D \ + ( \ + d, \ + BOOST_VMD_SWITCH_STATE_GET_INDEX(state), \ + BOOST_VMD_SWITCH_STATE_GET_SIZE(state) \ + ), \ + BOOST_VMD_SWITCH_OP_DEFAULT, \ + BOOST_VMD_SWITCH_OP_TEST_CURRENT \ + ) \ + (d,state) \ +/**/ + +/* + + WHILE loop predicate + + Continue the WHILE loop if a result has not yet been specified + +*/ + +#define BOOST_VMD_SWITCH_PRED(d,state) \ + BOOST_VMD_IS_EMPTY \ + ( \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 0, \ + BOOST_VMD_SWITCH_STATE_GET_RESULT(state) \ + ) \ + ) \ +/**/ + +/* + + Invokes the function-like macro + + macro = function-like macro name + tparams = tuple of macro parameters + +*/ + +#define BOOST_VMD_SWITCH_PROCESS_INVOKE_MACRO(macro,tparams) \ + BOOST_PP_EXPAND(macro tparams) \ +/**/ + +/* + + Processes our WHILE loop result + + callp = tuple of parameters for the called macro + result = tuple. The first tuple element is 0 + if no macro has been found or 1 if a macro + has been found. If 1 the second element is + the name of a function-like macro + +*/ + +#define BOOST_VMD_SWITCH_PROCESS(callp,result) \ + BOOST_PP_EXPR_IIF \ + ( \ + BOOST_PP_TUPLE_ELEM(0,result), \ + BOOST_VMD_SWITCH_PROCESS_INVOKE_MACRO \ + ( \ + BOOST_PP_TUPLE_ELEM(1,result), \ + callp \ + ) \ + ) \ +/**/ + +/* + + Use BOOST_VMD_SWITCH_IDENTITY to pass a fixed value instead + of a function-like macro as the second element of + any tuple of the variadic parameters, or as the default + value, to BOOST_VMD_SWITCH. + +*/ + +#if BOOST_VMD_MSVC +#define BOOST_VMD_SWITCH_IDENTITY(item) BOOST_PP_CAT(BOOST_VMD_IDENTITY(item),) +#else +#define BOOST_VMD_SWITCH_IDENTITY BOOST_VMD_IDENTITY +#endif + +/* + + Switch macro + + Parameters are: + + value = value to compare against. May be any VMD data value. + callp = tuple of parameters for the called macro + variadic parameters = each parameter must be a tuple. + Each tuple consists of a two-element tuple. The first element is + a value, which may be any VMD data value, and the second element + is the name of a function-like macro to be called if the value + is equal to the value to compare against. For a default value + the tuple is a single-element tuple which contains the name of + a function-like macro to be called if no other value matches. + +*/ + +#define BOOST_VMD_SWITCH(value,callp,...) \ + BOOST_VMD_SWITCH_PROCESS \ + ( \ + callp, \ + BOOST_VMD_SWITCH_STATE_GET_RESULT \ + ( \ + BOOST_PP_WHILE \ + ( \ + BOOST_VMD_SWITCH_PRED, \ + BOOST_VMD_SWITCH_OP, \ + BOOST_VMD_SWITCH_STATE(value,__VA_ARGS__) \ + ) \ + ) \ + ) \ +/**/ + +#endif /* BOOST_PP_VARIADICS */ + +//] + +#endif /* BOOST_VMD_TEST_DOC_EXAMPLE_SWITCH_HPP */ diff --git a/src/boost/libs/vmd/test/test_doc_get_type.cpp b/src/boost/libs/vmd/test/test_doc_get_type.cpp new file mode 100644 index 000000000..3ccb4b829 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_get_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_get_type.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_get_type.cxx b/src/boost/libs/vmd/test/test_doc_get_type.cxx new file mode 100644 index 000000000..74f218119 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_get_type.cxx @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ANID (ANID) + #define SEQUENCE_EMPTY + #define SEQUENCE_MULTI (1,2,3) 88 + #define SEQUENCE1 (3,(1,2,3)) + #define SEQUENCE2 ANID + #define SEQUENCE3 (1,(2,(3,BOOST_PP_NIL))) + #define SEQUENCE4 1 + #define SEQUENCE5 (1)(2)(3) + #define SEQUENCE6 (1,2,3) + #define SEQUENCE7 BOOST_VMD_TYPE_NUMBER + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE_EMPTY),BOOST_VMD_TYPE_EMPTY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE_MULTI),BOOST_VMD_TYPE_SEQUENCE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE1),BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE2),BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE3),BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE4),BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE5),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE6),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE7),BOOST_VMD_TYPE_TYPE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_identifier.cpp b/src/boost/libs/vmd/test/test_doc_identifier.cpp new file mode 100644 index 000000000..725b7870e --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_identifier.cxx b/src/boost/libs/vmd/test/test_doc_identifier.cxx new file mode 100644 index 000000000..58cf12b14 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_identifier.cxx @@ -0,0 +1,32 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_identifier.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_yellow (yellow) + #define BOOST_VMD_REGISTER_green (green) + #define BOOST_VMD_REGISTER_blue (blue) + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(yellow)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(green)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(blue)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(purple)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_identifier_subtyping.cpp b/src/boost/libs/vmd/test/test_doc_identifier_subtyping.cpp new file mode 100644 index 000000000..c58771107 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_identifier_subtyping.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_identifier_subtyping.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_identifier_subtyping.cxx b/src/boost/libs/vmd/test/test_doc_identifier_subtyping.cxx new file mode 100644 index 000000000..7a39e8d78 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_identifier_subtyping.cxx @@ -0,0 +1,70 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_UDEF_CIRCLE (UDEF_CIRCLE) + #define BOOST_VMD_REGISTER_UDEF_SQUARE (UDEF_SQUARE) + #define BOOST_VMD_REGISTER_UDEF_TRIANGLE (UDEF_TRIANGLE) + #define BOOST_VMD_REGISTER_UDEF_HEXAGON (UDEF_HEXAGON) + + #define BOOST_VMD_DETECT_UDEF_CIRCLE_UDEF_CIRCLE + #define BOOST_VMD_DETECT_UDEF_SQUARE_UDEF_SQUARE + #define BOOST_VMD_DETECT_UDEF_TRIANGLE_UDEF_TRIANGLE + #define BOOST_VMD_DETECT_UDEF_HEXAGON_UDEF_HEXAGON + + #define BOOST_VMD_REGISTER_BOOST_VMD_TYPE_UDEF_SHAPES (BOOST_VMD_TYPE_UDEF_SHAPES) + + #define BOOST_VMD_DETECT_BOOST_VMD_TYPE_UDEF_SHAPES_BOOST_VMD_TYPE_UDEF_SHAPES + + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_CIRCLE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_CIRCLE) + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_SQUARE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_SQUARE) + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_TRIANGLE (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_TRIANGLE) + #define BOOST_VMD_SUBTYPE_REGISTER_UDEF_HEXAGON (BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_HEXAGON) + + #define BOOST_VMD_SUBTYPE_REGISTER_BOOST_VMD_TYPE_UDEF_SHAPES (BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_UDEF_SHAPES) + + #define A_SEQUENCE UDEF_SQUARE + #define A_SEQUENCE2 217 + #define A_SEQUENCE3 BOOST_VMD_TYPE_UDEF_SHAPES + #define A_SEQUENCE4 BOOST_VMD_TYPE_NUMBER + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(A_SEQUENCE),BOOST_VMD_TYPE_UDEF_SHAPES)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(A_SEQUENCE2),BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(A_SEQUENCE3),BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(A_SEQUENCE4),BOOST_VMD_TYPE_TYPE)); + + #define A_SEQUENCE5 (1,2) UDEF_TRIANGLE + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE5,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_UDEF_SHAPES,UDEF_TRIANGLE))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,A_SEQUENCE5,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_TUPLE,(1,2)))); + + #define A_SEQUENCE6 UDEF_CIRCLE + #define A_SEQUENCE7 168 + + BOOST_TEST(BOOST_VMD_EQUAL(A_SEQUENCE6,UDEF_CIRCLE,BOOST_VMD_TYPE_UDEF_SHAPES)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_SEQUENCE6,UDEF_CIRCLE,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(A_SEQUENCE7,168,BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_SEQUENCE7,168,BOOST_VMD_TYPE_SEQ)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_filter.cpp b/src/boost/libs/vmd/test/test_doc_modifiers_filter.cpp new file mode 100644 index 000000000..babbb55c6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_filter.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_modifiers_filter.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_filter.cxx b/src/boost/libs/vmd/test/test_doc_modifiers_filter.cxx new file mode 100644 index 000000000..4b1cbd8d9 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_filter.cxx @@ -0,0 +1,107 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_AN_ID1 (AN_ID1) + #define BOOST_VMD_REGISTER_AN_ID2 (AN_ID2) + + #define BOOST_VMD_DETECT_AN_ID1_AN_ID1 + #define BOOST_VMD_DETECT_AN_ID2_AN_ID2 + + #define AN_IDENTIFIER1 AN_ID1 + #define AN_IDENTIFIER2 AN_ID2 + #define AN_IDENTIFIER3 AN_ID1 + + #define A_NUMBER1 33 + #define A_NUMBER2 145 + #define A_NUMBER3 33 + + #define A_TUPLE1 (AN_IDENTIFIER1,A_NUMBER1) + #define A_TUPLE2 (AN_IDENTIFIER1,A_NUMBER2) + #define A_TUPLE3 (AN_IDENTIFIER3,A_NUMBER3) + + #define A_LIST1 (A_NUMBER1,(A_NUMBER3,BOOST_PP_NIL)) + #define A_LIST2 (A_NUMBER1,(A_NUMBER2,BOOST_PP_NIL)) + #define A_LIST3 (A_NUMBER1,(A_NUMBER3,BOOST_PP_NIL)) + #define A_LIST4 BOOST_PP_NIL + #define A_LIST5 BOOST_PP_NIL + + BOOST_TEST(BOOST_VMD_NOT_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER2,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(AN_IDENTIFIER1,AN_IDENTIFIER3,BOOST_VMD_TYPE_TYPE)); + + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_NUMBER1,A_NUMBER2,BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_NUMBER1,A_NUMBER3,BOOST_VMD_TYPE_EMPTY)); + + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_TUPLE1,A_TUPLE2,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(A_TUPLE1,A_TUPLE3,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_TUPLE1,A_TUPLE3,BOOST_VMD_TYPE_ARRAY)); + + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_LIST1,A_LIST2,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_EQUAL(A_LIST1,A_LIST3,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(A_LIST4,A_LIST5,BOOST_VMD_TYPE_TUPLE)); + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define BOOST_VMD_REGISTER_list_data1 (list_data1) + #define BOOST_VMD_REGISTER_list_data2 (list_data2) + #define BOOST_VMD_DETECT_ANAME_ANAME + #define BOOST_VMD_DETECT_list_data1_list_data1 + #define BOOST_VMD_DETECT_list_data2_list_data2 + + #define A_SEQUENCE (1,2,3) 46 (list_data1,(list_data2,BOOST_PP_NIL)) BOOST_VMD_TYPE_SEQ ANAME + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,A_SEQUENCE),(1,2,3))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE),(1,2,3))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,A_SEQUENCE,BOOST_VMD_TYPE_SEQ),)); + + BOOST_TEST_EQ(BOOST_VMD_ELEM(1,A_SEQUENCE),46); + BOOST_TEST_EQ(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_NUMBER),46); + BOOST_TEST_EQ(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER),46); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_LIST),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE),(list_data1,(list_data2,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_LIST),(list_data1,(list_data2,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE),(list_data1,(list_data2,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_TYPE_TYPE),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_TYPE),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_TUPLE),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(4,A_SEQUENCE),ANAME)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER),ANAME)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_NUMBER),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,BOOST_PP_NIL),BOOST_PP_NIL)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_LIST),BOOST_PP_NIL)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_IDENTIFIER),BOOST_PP_NIL)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,BOOST_PP_NIL,BOOST_VMD_TYPE_TUPLE),)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_identifier.cpp b/src/boost/libs/vmd/test/test_doc_modifiers_identifier.cpp new file mode 100644 index 000000000..5af4f1603 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_modifiers_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_identifier.cxx b/src/boost/libs/vmd/test/test_doc_modifiers_identifier.cxx new file mode 100644 index 000000000..f90e925d7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_identifier.cxx @@ -0,0 +1,77 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_yellow (yellow) + #define BOOST_VMD_REGISTER_green (green) + #define BOOST_VMD_REGISTER_blue (blue) + #define BOOST_VMD_REGISTER_red (red) + + #define BOOST_VMD_DETECT_yellow_yellow + #define BOOST_VMD_DETECT_green_green + #define BOOST_VMD_DETECT_blue_blue + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(yellow,yellow)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(green,yellow)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(blue,yellow)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(red,yellow)); + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(yellow,yellow,blue)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(blue,yellow,blue)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(green,yellow,blue)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(red,yellow,blue)); + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(yellow,(yellow,green))); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(green,(yellow,green))); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(blue,(yellow,green))); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(red,(yellow,green))); + + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(red,red)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(red)); + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define BOOST_VMD_REGISTER_APLACE (APLACE) + #define BOOST_VMD_REGISTER_ACOUNTRY (ACOUNTRY) + + #define BOOST_VMD_DETECT_ANAME_ANAME + #define BOOST_VMD_DETECT_APLACE_APLACE + + #define A_SEQUENCE (1,2,3) ANAME 46 BOOST_VMD_TYPE_SEQ ACOUNTRY + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE),ANAME)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER),ANAME)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,APLACE,ACOUNTRY),)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,ANAME,APLACE,ACOUNTRY),ANAME)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,(APLACE,ACOUNTRY,ANAME)),ANAME)); + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_VMD_ELEM(4,A_SEQUENCE))); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(4,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,ACOUNTRY,ANAME),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TUPLE),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,(BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TUPLE)),BOOST_VMD_TYPE_SEQ)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_index.cpp b/src/boost/libs/vmd/test/test_doc_modifiers_index.cpp new file mode 100644 index 000000000..9737517d2 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_index.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_modifiers_index.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_index.cxx b/src/boost/libs/vmd/test/test_doc_modifiers_index.cxx new file mode 100644 index 000000000..84e0d7e97 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_index.cxx @@ -0,0 +1,46 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define BOOST_VMD_REGISTER_APLACE (APLACE) + #define BOOST_VMD_REGISTER_ACOUNTRY (ACOUNTRY) + + #define BOOST_VMD_DETECT_ANAME_ANAME + #define BOOST_VMD_DETECT_APLACE_APLACE + + #define A_SEQUENCE (1,2,3) ANAME (1)(2) 46 + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER),ANAME)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,APLACE,ACOUNTRY),)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,APLACE,ACOUNTRY),(,))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,ANAME,APLACE,ACOUNTRY),(ANAME,0))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME)),(ANAME,2))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,APLACE,ACOUNTRY,BOOST_VMD_RETURN_AFTER),(,,))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,ANAME,APLACE,ACOUNTRY,BOOST_VMD_RETURN_AFTER),(ANAME,(1)(2) 46,0))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME),BOOST_VMD_RETURN_AFTER),(ANAME,(1)(2) 46,2))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,(APLACE,ACOUNTRY,ANAME),BOOST_VMD_RETURN_ONLY_AFTER),(1)(2) 46)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(3,A_SEQUENCE,BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX,0,3,46,7),(46,2))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_return_type.cpp b/src/boost/libs/vmd/test/test_doc_modifiers_return_type.cpp new file mode 100644 index 000000000..f6bb6f2c5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_return_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_modifiers_return_type.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_return_type.cxx b/src/boost/libs/vmd/test/test_doc_modifiers_return_type.cxx new file mode 100644 index 000000000..ed31bbf05 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_return_type.cxx @@ -0,0 +1,191 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/enum.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/is_empty_array.hpp> +#include <boost/vmd/to_array.hpp> +#include <boost/vmd/to_list.hpp> +#include <boost/vmd/to_seq.hpp> +#include <boost/vmd/to_tuple.hpp> +#include <boost/preprocessor/array/elem.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define TUPLE_IS_ARRAY (2,(3,4)) + #define TUPLE_IS_LIST (anydata,BOOST_PP_NIL) + #define TUPLE_IS_LIST_OR_ARRAY (2,(3,BOOST_PP_NIL)) + #define TUPLE_BUT_INVALID_ARRAY (&2,(3,4)) + #define TUPLE_BUT_INVALID_LIST (anydata,^BOOST_PP_NIL) + #define SEQUENCE_EMPTY + #define SEQUENCE_MULTI TUPLE_BUT_INVALID_ARRAY TUPLE_BUT_INVALID_LIST + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY),BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY),BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_ARRAY,BOOST_VMD_RETURN_TYPE_LIST),BOOST_VMD_TYPE_TUPLE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST),BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_TUPLE),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_ARRAY),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST,BOOST_VMD_RETURN_TYPE_LIST),BOOST_VMD_TYPE_LIST)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY),BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_ARRAY),BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_IS_LIST_OR_ARRAY,BOOST_VMD_RETURN_TYPE_LIST),BOOST_VMD_TYPE_LIST)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_TUPLE),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_ARRAY,BOOST_VMD_RETURN_TYPE_LIST),BOOST_VMD_TYPE_TUPLE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_TUPLE),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(TUPLE_BUT_INVALID_LIST,BOOST_VMD_RETURN_TYPE_ARRAY),BOOST_VMD_TYPE_TUPLE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE_EMPTY,BOOST_VMD_RETURN_TYPE_TUPLE),BOOST_VMD_TYPE_EMPTY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(SEQUENCE_MULTI,BOOST_VMD_RETURN_TYPE_ARRAY),BOOST_VMD_TYPE_SEQUENCE)); + + #define BOOST_VMD_REGISTER_ANID (ANID) + #define BOOST_VMD_REGISTER_data (data) + #define BOOST_VMD_REGISTER_more_data (more_data) + #define BOOST_VMD_DETECT_ANID_ANID + #define BOOST_VMD_DETECT_data_data + #define BOOST_VMD_DETECT_more_data_more_data + #define SEQUENCE_EMPTY_1 + #define SEQUENCE_SINGLE 35 + #define SEQUENCE_SINGLE_ID ANID + #define SEQUENCE_SINGLE_ARRAY (3,(0,1,2)) + #define SEQUENCE_SINGLE_LIST (data,(more_data,BOOST_PP_NIL)) + #define SEQUENCE_MULTI_1 (0,1) (2)(3)(4) + #define SEQUENCE_MULTI_2 BOOST_VMD_TYPE_SEQ (2,(5,6)) + + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY_1))); + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY_1,BOOST_VMD_RETURN_TYPE))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_LIST(SEQUENCE_SINGLE),(35,BOOST_PP_NIL))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_LIST(SEQUENCE_SINGLE,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_NUMBER,35),BOOST_PP_NIL))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_ID),(ANID))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_ID,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_IDENTIFIER,ANID)))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_TUPLE(SEQUENCE_SINGLE_ARRAY),((3,(0,1,2))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_TUPLE(SEQUENCE_SINGLE_ARRAY,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_ARRAY,(3,(0,1,2)))))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ENUM(SEQUENCE_SINGLE_LIST),(data,(more_data,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ENUM(SEQUENCE_SINGLE_LIST,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_LIST,(data,(more_data,BOOST_PP_NIL))))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_1),((0,1),(2)(3)(4)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_1,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_TUPLE,(0,1)),(BOOST_VMD_TYPE_SEQ,(2)(3)(4))))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_VARIADIC_ELEM(0,BOOST_VMD_ENUM(SEQUENCE_MULTI_2)),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_VARIADIC_ELEM(1,BOOST_VMD_ENUM(SEQUENCE_MULTI_2)),(2,(5,6)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_VARIADIC_ELEM(0,BOOST_VMD_ENUM(SEQUENCE_MULTI_2,BOOST_VMD_RETURN_TYPE)),(BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_VARIADIC_ELEM(1,BOOST_VMD_ENUM(SEQUENCE_MULTI_2,BOOST_VMD_RETURN_TYPE)),(BOOST_VMD_TYPE_ARRAY,(2,(5,6))))); + + #define BOOST_VMD_REGISTER_anydata (anydata) + #define BOOST_VMD_DETECT_anydata_anydata + #define TUPLE_IS_VALID_ARRAY (2,(3,4)) + #define TUPLE_IS_VALID_LIST (anydata,BOOST_PP_NIL) + #define TUPLE_BUT_INVALID_ARRAY_2 (&2,(3,4)) + #define TUPLE_BUT_INVALID_LIST_2 (anydata,^BOOST_PP_NIL) + + #define SEQUENCE_MULTI_T1 TUPLE_IS_VALID_ARRAY TUPLE_IS_VALID_LIST + #define SEQUENCE_MULTI_T2 TUPLE_BUT_INVALID_ARRAY_2 TUPLE_IS_VALID_LIST + #define SEQUENCE_MULTI_T3 TUPLE_IS_VALID_ARRAY TUPLE_BUT_INVALID_LIST_2 + #define SEQUENCE_MULTI_T4 TUPLE_BUT_INVALID_ARRAY_2 TUPLE_BUT_INVALID_LIST_2 + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_ARRAY,(2,(3,4)))) ((BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_ARRAY),((BOOST_VMD_TYPE_ARRAY,(2,(3,4)))) ((BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_LIST),((BOOST_VMD_TYPE_TUPLE,(2,(3,4)))) ((BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_SEQ(SEQUENCE_MULTI_T1,BOOST_VMD_RETURN_TYPE_TUPLE),((BOOST_VMD_TYPE_TUPLE,(2,(3,4)))) ((BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL))))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_LIST))),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_LIST))),BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_TUPLE))),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI_T2,BOOST_VMD_RETURN_TYPE_TUPLE))),BOOST_VMD_TYPE_TUPLE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_ARRAY_ELEM(0,BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_ARRAY))),BOOST_VMD_TYPE_ARRAY)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_ARRAY_ELEM(1,BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_ARRAY))),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_ARRAY_ELEM(0,BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_TUPLE))),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_ARRAY_ELEM(1,BOOST_VMD_TO_ARRAY(SEQUENCE_MULTI_T3,BOOST_VMD_RETURN_TYPE_TUPLE))),BOOST_VMD_TYPE_TUPLE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_TUPLE),0)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(SEQUENCE_MULTI_T4,BOOST_VMD_RETURN_TYPE_TUPLE),1)),BOOST_VMD_TYPE_TUPLE)); + + #define BOOST_VMD_REGISTER_ANID_E (ANID_E) + #define BOOST_VMD_DETECT_ANID_E_ANID_E + #define SEQUENCE_SINGLE_E 35 + #define SEQUENCE_SINGLE_E2 ANID_E + #define SEQUENCE_MULTI_E (0,1) (2)(3)(4) + #define SEQUENCE_MULTI_E_2 BOOST_VMD_TYPE_SEQ (2,(5,6)) + + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E),35); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_NUMBER,35))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E2),ANID_E)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_SINGLE_E2,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_IDENTIFIER,ANID_E))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E),(2)(3)(4))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_SEQ,(2)(3)(4)))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E_2),BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E_2,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_SEQ))); + + #define TUPLE_IS_VALID_ARRAY_E (2,(3,4)) + #define TUPLE_IS_VALID_LIST_E (anydata,BOOST_PP_NIL) + #define TUPLE_BUT_INVALID_ARRAY_E (&2,(3,4)) + #define TUPLE_BUT_INVALID_LIST_E (anydata,^BOOST_PP_NIL) + + #define SEQUENCE_MULTI_E1 TUPLE_IS_VALID_ARRAY_E TUPLE_IS_VALID_LIST_E + #define SEQUENCE_MULTI_E2 TUPLE_BUT_INVALID_ARRAY_E TUPLE_IS_VALID_LIST_E + #define SEQUENCE_MULTI_E3 TUPLE_IS_VALID_ARRAY_E TUPLE_BUT_INVALID_LIST_E + #define SEQUENCE_MULTI_E4 TUPLE_BUT_INVALID_ARRAY_E TUPLE_BUT_INVALID_LIST_E + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_ARRAY,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_ARRAY),(BOOST_VMD_TYPE_ARRAY,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_LIST),(BOOST_VMD_TYPE_TUPLE,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_TUPLE),(BOOST_VMD_TYPE_TUPLE,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_ARRAY),(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_LIST),(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E1,BOOST_VMD_RETURN_TYPE_TUPLE),(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_LIST)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_TUPLE)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_ARRAY),(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_LIST),(BOOST_VMD_TYPE_LIST,(anydata,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E2,BOOST_VMD_RETURN_TYPE_TUPLE),(BOOST_VMD_TYPE_TUPLE,(anydata,BOOST_PP_NIL)))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE),(BOOST_VMD_TYPE_ARRAY,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_ARRAY),(BOOST_VMD_TYPE_ARRAY,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_LIST),(BOOST_VMD_TYPE_TUPLE,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_TUPLE),(BOOST_VMD_TYPE_TUPLE,(2,(3,4))))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_ARRAY)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E3,BOOST_VMD_RETURN_TYPE_TUPLE)),BOOST_VMD_TYPE_TUPLE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_LIST)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_TUPLE)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_ARRAY)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,SEQUENCE_MULTI_E4,BOOST_VMD_RETURN_TYPE_TUPLE)),BOOST_VMD_TYPE_TUPLE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_splitting.cpp b/src/boost/libs/vmd/test/test_doc_modifiers_splitting.cpp new file mode 100644 index 000000000..69dceafa6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_splitting.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_modifiers_splitting.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_modifiers_splitting.cxx b/src/boost/libs/vmd/test/test_doc_modifiers_splitting.cxx new file mode 100644 index 000000000..91697128d --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_modifiers_splitting.cxx @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define BOOST_VMD_REGISTER_list_data1 (list_data1) + #define BOOST_VMD_DETECT_ANAME_ANAME + #define BOOST_VMD_DETECT_list_data1_list_data1 + + #define A_SEQUENCE (1,2,3) 46 (list_data1,BOOST_PP_NIL) BOOST_VMD_TYPE_SEQ ANAME + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE),(list_data1,BOOST_PP_NIL))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER),(list_data1,BOOST_PP_NIL))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER),((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER),BOOST_VMD_TYPE_SEQ ANAME)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE),)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_NO_AFTER),)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_AFTER),(,))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(5,A_SEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER),)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_TYPE),((BOOST_VMD_TYPE_LIST,(list_data1,BOOST_PP_NIL)),BOOST_VMD_TYPE_SEQ ANAME))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,A_SEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST),((list_data1,BOOST_PP_NIL),BOOST_VMD_TYPE_SEQ ANAME))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_number.cpp b/src/boost/libs/vmd/test/test_doc_number.cpp new file mode 100644 index 000000000..78669b771 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_number.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_number.cxx b/src/boost/libs/vmd/test/test_doc_number.cxx new file mode 100644 index 000000000..56ac9fc87 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_number.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_number.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_NUMBER(0)); + BOOST_TEST(BOOST_VMD_IS_NUMBER(44)); + BOOST_TEST(!BOOST_VMD_IS_NUMBER(SQUARE)); + BOOST_TEST(!BOOST_VMD_IS_NUMBER(44 DATA)); + BOOST_TEST(!BOOST_VMD_IS_NUMBER(044)); + BOOST_TEST(BOOST_VMD_IS_NUMBER(256)); + BOOST_TEST(!BOOST_VMD_IS_NUMBER(257)); + BOOST_TEST(!BOOST_VMD_IS_NUMBER(245e2)); + BOOST_TEST(!BOOST_VMD_IS_NUMBER((44))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_pp_data_types.cpp b/src/boost/libs/vmd/test/test_doc_pp_data_types.cpp new file mode 100644 index 000000000..08ed429dd --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_pp_data_types.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_pp_data_types.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_pp_data_types.cxx b/src/boost/libs/vmd/test/test_doc_pp_data_types.cxx new file mode 100644 index 000000000..7bf2af3c9 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_pp_data_types.cxx @@ -0,0 +1,124 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_array.hpp> +#include <boost/vmd/is_list.hpp> +#include <boost/vmd/is_seq.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/is_empty_array.hpp> +#include <boost/vmd/is_empty_list.hpp> +#include <boost/vmd/is_parens_empty.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ANARRAY (3,(a,b,c)) + #define ALIST (a,(b,(c,BOOST_PP_NIL))) + #define ATUPLE (a,b,c) + #define ASEQ (a)(b)(c) + + BOOST_TEST(BOOST_VMD_IS_TUPLE(ANARRAY)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(ALIST)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(ATUPLE)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(ASEQ)); + + #define ALIST1 (2,(3,BOOST_PP_NIL)) + #define ALIST2 (2,(3,(4,BOOST_PP_NIL))) + #define ALIST3 (2,BOOST_PP_NIL) + + BOOST_TEST(BOOST_VMD_IS_LIST(ALIST1)); + BOOST_TEST(BOOST_VMD_IS_LIST(ALIST2)); + BOOST_TEST(BOOST_VMD_IS_LIST(ALIST3)); + BOOST_TEST(BOOST_VMD_IS_ARRAY(ALIST1)); + BOOST_TEST(BOOST_VMD_IS_ARRAY(ALIST2)); + BOOST_TEST(!BOOST_VMD_IS_ARRAY(ALIST3)); + + #define ASE_TUPLE (a) + + BOOST_TEST(BOOST_VMD_IS_TUPLE(ASE_TUPLE)); + BOOST_TEST(BOOST_VMD_IS_SEQ(ASE_TUPLE)); + + #define A_TUPLE2 (&anything,(1,2)) + + BOOST_TEST(BOOST_VMD_IS_TUPLE(A_TUPLE2)); +// BOOST_VMD_IS_ARRAY(A_TUPLE2) will give a preprocessing error due to the constraint + + #define A_TUPLE3 (element,&anything) + + BOOST_TEST(BOOST_VMD_IS_TUPLE(A_TUPLE3)); +// BOOST_VMD_IS_LIST(A_TUPLE3) will give a preprocessing error due to the constraint + +// #define A_BAD_EMPTY_LIST &BOOST_PP_NIL + +// BOOST_VMD_IS_LIST(A_BAD_EMPTY_LIST) will give a preprocessing error due to the constraint +// BOOST_VMD_IS_IDENTIFIER(A_BAD_EMPTY_LIST) will give a preprocessing error due to the constraint + + #define ST_DATA (somedata)(some_other_data) + + BOOST_TEST(BOOST_VMD_IS_SEQ(ST_DATA)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(ST_DATA)); + + #define ST_DATA2 (somedata)(element1,element2) + #define ST_DATA3 (element1,element2)(somedata) + #define ST_DATA4 (somedata)(some_other_data)(element1,element2) + + BOOST_TEST(BOOST_VMD_IS_TUPLE(BOOST_VMD_ELEM(0,ST_DATA2))); + BOOST_TEST(BOOST_VMD_IS_TUPLE(BOOST_VMD_ELEM(1,ST_DATA2))); + BOOST_TEST(BOOST_VMD_IS_TUPLE(BOOST_VMD_ELEM(0,ST_DATA3))); + BOOST_TEST(BOOST_VMD_IS_TUPLE(BOOST_VMD_ELEM(1,ST_DATA3))); + BOOST_TEST(BOOST_VMD_IS_SEQ(BOOST_VMD_ELEM(0,ST_DATA4))); + BOOST_TEST(BOOST_VMD_IS_TUPLE(BOOST_VMD_ELEM(1,ST_DATA4))); + + #define AN_ARRAY (1,(1)) + #define AN_EMPTY_ARRAY (0,()) + + BOOST_TEST(BOOST_VMD_IS_ARRAY(AN_ARRAY)); + BOOST_TEST(BOOST_VMD_IS_ARRAY(AN_EMPTY_ARRAY)); + + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(AN_EMPTY_ARRAY)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY()); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_ARRAY(AN_ARRAY)); + + #define A_LIST (1,BOOST_PP_NIL) + #define AN_EMPTY_LIST BOOST_PP_NIL + + BOOST_TEST(BOOST_VMD_IS_LIST(A_LIST)); + BOOST_TEST(BOOST_VMD_IS_LIST(AN_EMPTY_LIST)); + + BOOST_TEST(BOOST_VMD_IS_EMPTY_LIST(AN_EMPTY_LIST)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST()); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(A_LIST)); + +#if !BOOST_VMD_MSVC_V8 + + #define EMPTY_PARENS () + + BOOST_TEST(BOOST_VMD_IS_TUPLE(EMPTY_PARENS)); + BOOST_TEST(BOOST_VMD_IS_SEQ(EMPTY_PARENS)); + BOOST_TEST(BOOST_VMD_IS_PARENS_EMPTY(EMPTY_PARENS)); + +#endif + + #define TUPLE (0) + #define SEQ (0)(1) + + BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY()); + BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(TUPLE)); + BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(SEQ)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_sequence.cpp b/src/boost/libs/vmd/test/test_doc_sequence.cpp new file mode 100644 index 000000000..e0ef12e12 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_sequence.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_sequence.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_sequence.cxx b/src/boost/libs/vmd/test/test_doc_sequence.cxx new file mode 100644 index 000000000..ae4113701 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_sequence.cxx @@ -0,0 +1,47 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_multi.hpp> +#include <boost/vmd/is_unary.hpp> +#include <boost/vmd/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_EMPTY_SEQUENCE + + BOOST_TEST(BOOST_VMD_IS_EMPTY(AN_EMPTY_SEQUENCE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_EMPTY,BOOST_VMD_GET_TYPE(AN_EMPTY_SEQUENCE))); + + #define A_SINGLE_ELEMENT_SEQUENCE (1,2) + + BOOST_TEST(BOOST_VMD_IS_UNARY(A_SINGLE_ELEMENT_SEQUENCE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_TUPLE,BOOST_VMD_GET_TYPE(A_SINGLE_ELEMENT_SEQUENCE))); + + #define A_MULTI_ELEMENT_SEQUENCE (1,2) (1)(2) 45 + + BOOST_TEST(BOOST_VMD_IS_MULTI(A_MULTI_ELEMENT_SEQUENCE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_SEQUENCE,BOOST_VMD_GET_TYPE(A_MULTI_ELEMENT_SEQUENCE))); + + BOOST_TEST_EQ(BOOST_VMD_SIZE(AN_EMPTY_SEQUENCE),0); + BOOST_TEST_EQ(BOOST_VMD_SIZE(A_SINGLE_ELEMENT_SEQUENCE),1); + BOOST_TEST_EQ(BOOST_VMD_SIZE(A_MULTI_ELEMENT_SEQUENCE),3); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_sequence_access.cpp b/src/boost/libs/vmd/test/test_doc_sequence_access.cpp new file mode 100644 index 000000000..5031e0444 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_sequence_access.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_sequence_access.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_sequence_access.cxx b/src/boost/libs/vmd/test/test_doc_sequence_access.cxx new file mode 100644 index 000000000..983f8ebeb --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_sequence_access.cxx @@ -0,0 +1,40 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_list.hpp> +#include <boost/vmd/is_type.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ANAME (ANAME) + #define A_SEQUENCE (1,2,3) 46 (list_data1,(list_data2,BOOST_PP_NIL)) BOOST_VMD_TYPE_SEQ ANAME + #define AN_EMPTY_SEQUENCE + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_ELEM(0,A_SEQUENCE)),3); + BOOST_TEST_EQ(BOOST_VMD_ELEM(1,A_SEQUENCE),46); + BOOST_TEST(BOOST_VMD_IS_LIST(BOOST_VMD_ELEM(2,A_SEQUENCE))); + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_VMD_ELEM(3,A_SEQUENCE))); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_VMD_ELEM(4,A_SEQUENCE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(5,A_SEQUENCE))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,AN_EMPTY_SEQUENCE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_sequence_convert.cpp b/src/boost/libs/vmd/test/test_doc_sequence_convert.cpp new file mode 100644 index 000000000..72eb0d800 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_sequence_convert.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_sequence_convert.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_sequence_convert.cxx b/src/boost/libs/vmd/test/test_doc_sequence_convert.cxx new file mode 100644 index 000000000..e25fa565b --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_sequence_convert.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_empty_array.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_type.hpp> +#include <boost/vmd/to_array.hpp> +#include <boost/vmd/to_list.hpp> +#include <boost/vmd/to_seq.hpp> +#include <boost/vmd/to_tuple.hpp> +#include <boost/vmd/enum.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ANID (ANID) + + #define SEQUENCE_EMPTY + #define SEQUENCE_SINGLE 35 + #define SEQUENCE_SINGLE_2 ANID + #define SEQUENCE_MULTI (0,1) (2)(3)(4) + #define SEQUENCE_MULTI_2 BOOST_VMD_TYPE_SEQ (2,(5,6)) + + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(BOOST_VMD_TO_ARRAY(SEQUENCE_EMPTY))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(SEQUENCE_SINGLE),0),35); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_TO_SEQ(SEQUENCE_SINGLE_2)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_TO_TUPLE(SEQUENCE_MULTI))),1); + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_PP_VARIADIC_ELEM(0,BOOST_VMD_ENUM(SEQUENCE_MULTI_2)))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_type.cpp b/src/boost/libs/vmd/test/test_doc_type.cpp new file mode 100644 index 000000000..fb3b0a15f --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_type.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_type.cxx b/src/boost/libs/vmd/test/test_doc_type.cxx new file mode 100644 index 000000000..b5a71bb18 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_type.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_type.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(!BOOST_VMD_IS_TYPE(SQUARE)); + BOOST_TEST(!BOOST_VMD_IS_TYPE(BOOST_VMD_TYPE_IDENTIFIER DATA)); + BOOST_TEST(!BOOST_VMD_IS_TYPE(( BOOST_VMD_TYPE_EMPTY ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_doc_whyhow.cpp b/src/boost/libs/vmd/test/test_doc_whyhow.cpp new file mode 100644 index 000000000..e20c0b72e --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_whyhow.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_doc_whyhow.cxx> diff --git a/src/boost/libs/vmd/test/test_doc_whyhow.cxx b/src/boost/libs/vmd/test/test_doc_whyhow.cxx new file mode 100644 index 000000000..88b429b27 --- /dev/null +++ b/src/boost/libs/vmd/test/test_doc_whyhow.cxx @@ -0,0 +1,130 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/get_type.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_seq.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/to_tuple.hpp> +#include <boost/preprocessor/control/iif.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_Seq (Seq) + #define BOOST_VMD_REGISTER_Tuple (Tuple) + #define BOOST_VMD_REGISTER_Unknown (Unknown) + + #define BOOST_VMD_DETECT_Seq_Seq + #define BOOST_VMD_DETECT_Tuple_Tuple + #define BOOST_VMD_DETECT_Unknown_Unknown + + #define AMACRO(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_SEQ(param), \ + Seq, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_TUPLE(param), \ + Tuple, \ + Unknown \ + ) \ + ) + + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO((0)(1)),Seq)); + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO((0,1)),Tuple)); + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO(24),Unknown)); + + #define BOOST_VMD_REGISTER_NAME (NAME) + #define BOOST_VMD_REGISTER_ADDRESS (ADDRESS) + + #define AMACRO1(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_IDENTIFIER(param), \ + AMACRO1_IDENTIFIER, \ + AMACRO1_NO_IDENTIFIER \ + ) \ + (param) + + #define AMACRO1_IDENTIFIER(param) AMACRO1_ ## param + #define AMACRO1_NO_IDENTIFIER(param) Parameter is not an identifier + #define AMACRO1_NAME Identifier is a NAME + #define AMACRO1_ADDRESS Identifier is an ADDRESS + + #define BOOST_VMD_REGISTER_Parameter (Parameter) + #define BOOST_VMD_REGISTER_is (is) + #define BOOST_VMD_REGISTER_not (not) + #define BOOST_VMD_REGISTER_an (an) + #define BOOST_VMD_REGISTER_identifier (identifier) + #define BOOST_VMD_REGISTER_Identifier (Identifier) + #define BOOST_VMD_REGISTER_a (a) + + #define BOOST_VMD_DETECT_NAME_NAME + #define BOOST_VMD_DETECT_ADDRESS_ADDRESS + #define BOOST_VMD_DETECT_Parameter_Parameter + #define BOOST_VMD_DETECT_is_is + #define BOOST_VMD_DETECT_not_not + #define BOOST_VMD_DETECT_an_an + #define BOOST_VMD_DETECT_identifier_identifier + #define BOOST_VMD_DETECT_Identifier_Identifier + #define BOOST_VMD_DETECT_a_a + + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO1((44)),Parameter is not an identifier)); + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO1(NAME),Identifier is a NAME)); + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO1(ADDRESS),Identifier is an ADDRESS)); + + #define AMACRO2(param) \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_IDENTIFIER(param,NAME), \ + AMACRO2_NAME, \ + BOOST_PP_IIF \ + ( \ + BOOST_VMD_IS_IDENTIFIER(param,ADDRESS), \ + AMACRO2_ADDRESS, \ + AMACRO2_NO_IDENTIFIER \ + ) \ + ) \ + (param) + + #define BOOST_VMD_REGISTER_or (or) + #define BOOST_VMD_DETECT_or_or + + #define AMACRO2_NO_IDENTIFIER(param) Parameter is not a NAME or ADDRESS identifier + #define AMACRO2_NAME(param) Identifier is a NAME + #define AMACRO2_ADDRESS(param) Identifier is an ADDRESS + + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO2((44)),Parameter is not a NAME or ADDRESS identifier)); + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO2(NAME),Identifier is a NAME)); + BOOST_TEST(BOOST_VMD_EQUAL(AMACRO2(ADDRESS),Identifier is an ADDRESS)); + + #define ASEQUENCE (1,2) NAME 147 BOOST_VMD_TYPE_NUMBER (a)(b) + + #define BOOST_VMD_REGISTER_b (b) + #define BOOST_VMD_DETECT_b_b + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TO_TUPLE(ASEQUENCE),((1,2),NAME,147,BOOST_VMD_TYPE_NUMBER,(a)(b)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,ASEQUENCE),147)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE((1,2)),BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(235),BOOST_VMD_TYPE_NUMBER)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal.cpp b/src/boost/libs/vmd/test/test_equal.cpp new file mode 100644 index 000000000..941ca978d --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_equal.cxx b/src/boost/libs/vmd/test/test_equal.cxx new file mode 100644 index 000000000..927478387 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal.cxx @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ASEQ2 (1)(2)(3) + #define ATUPLE (0,(ggh,45,(2,(89,(dvd)(57)(99)))),170) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST2 (0,(1,(2,(4,BOOST_PP_NIL)))) + #define ANARRAY (3,(ggh,dvd,38)) + #define ANARRAY2 (3,(dvd,ggh,38)) + #define ASEQUENCE4 + + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ,249)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ALIST,17)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANIDENTIFIER,ANARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANUMBER2,dvd)); + BOOST_TEST(BOOST_VMD_EQUAL(ASEQUENCE4,)); + BOOST_TEST(BOOST_VMD_EQUAL(,)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY2,ASEQ2)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ,22)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE,ANARRAY)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ALIST2,ANUMBER2)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ASEQUENCE4)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_array.cpp b/src/boost/libs/vmd/test/test_equal_array.cpp new file mode 100644 index 000000000..7fb6b78d1 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_array.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_array.cxx b/src/boost/libs/vmd/test/test_equal_array.cxx new file mode 100644 index 000000000..fe3b5503e --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_array.cxx @@ -0,0 +1,45 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + + #define ANARRAY (3,(aaa,bbb,38)) + #define ANARRAY2 (3,(bbb,aaa,38)) + #define ANARRAY3 (3,(bbb,aaa,38)) + #define ANARRAY4 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) + #define ANARRAY5 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) + #define ANARRAY6 (4,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2),37))) + + BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY4,ANARRAY5)); + BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY2,ANARRAY3)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ANARRAY2)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY5,ANARRAY6)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_identifier.cpp b/src/boost/libs/vmd/test/test_equal_identifier.cpp new file mode 100644 index 000000000..1e8fae5a4 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_identifier.cxx b/src/boost/libs/vmd/test/test_equal_identifier.cxx new file mode 100644 index 000000000..b989ca13e --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_identifier.cxx @@ -0,0 +1,43 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_dvd_dvd + + BOOST_TEST(BOOST_VMD_EQUAL(aaa,aaa)); + BOOST_TEST(BOOST_VMD_EQUAL(ddd,ddd)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ggg,dvd)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(bbb,ccc)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(eee,eee)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_list.cpp b/src/boost/libs/vmd/test/test_equal_list.cpp new file mode 100644 index 000000000..cb367efc0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_list.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_list.cxx b/src/boost/libs/vmd/test/test_equal_list.cxx new file mode 100644 index 000000000..979a1126b --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_list.cxx @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_dvd_dvd + + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST2 (0,(1,(2,(4,BOOST_PP_NIL)))) + #define ALIST3 (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST4 (0,(aaa)(ccc),(2,(3,BOOST_PP_NIL))) + #define ALIST5 (0,(aaa)(ccc),(2,(3,BOOST_PP_NIL))) + #define ALIST6 (0,(bbb)(ccc),(2,(3,BOOST_PP_NIL))) + + BOOST_TEST(BOOST_VMD_EQUAL(ALIST,ALIST3)); + BOOST_TEST(BOOST_VMD_EQUAL(ALIST4,ALIST5)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ALIST,ALIST2)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ALIST4,ALIST6)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_multi.cpp b/src/boost/libs/vmd/test/test_equal_multi.cpp new file mode 100644 index 000000000..2f2ffeeb3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_multi.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_multi.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_multi.cxx b/src/boost/libs/vmd/test/test_equal_multi.cxx new file mode 100644 index 000000000..b16b9ce3f --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_multi.cxx @@ -0,0 +1,65 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_REGISTER_eee (eee) + #define BOOST_VMD_REGISTER_fff (fff) + #define BOOST_VMD_REGISTER_ggg (ggg) + #define BOOST_VMD_REGISTER_hhh (hhh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_dvd_dvd + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + #define BOOST_VMD_DETECT_eee_eee + #define BOOST_VMD_DETECT_fff_fff + #define BOOST_VMD_DETECT_ggg_ggg + #define BOOST_VMD_DETECT_hhh_hhh + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)((27)(28) ggh) + #define ATUPLE (0,1,2,3,((aaa,bbb))((ccc,ddd))((eee))((fff,ggg,hhh))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE6 ASEQ ANUMBER2 ATUPLE + + BOOST_TEST(BOOST_VMD_EQUAL(ASEQUENCE2,ASEQUENCE5)); + BOOST_TEST(BOOST_VMD_EQUAL(ASEQUENCE3,ASEQUENCE6)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQUENCE,ASEQUENCE2)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQUENCE3,ASEQUENCE4)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_number.cpp b/src/boost/libs/vmd/test/test_equal_number.cpp new file mode 100644 index 000000000..e313d2c53 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_number.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_number.cxx b/src/boost/libs/vmd/test/test_equal_number.cxx new file mode 100644 index 000000000..70a4050bc --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_number.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ANUMBER 249 + #define ANUMBER2 17 + #define ANUMBER3 249 + + BOOST_TEST(BOOST_VMD_EQUAL(ANUMBER,ANUMBER3)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANUMBER,ANUMBER2)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_seq.cpp b/src/boost/libs/vmd/test/test_equal_seq.cpp new file mode 100644 index 000000000..7cbe568cc --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_seq.cxx b/src/boost/libs/vmd/test/test_equal_seq.cxx new file mode 100644 index 000000000..51b3c7721 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_seq.cxx @@ -0,0 +1,46 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ASEQ (25)(26)(27) + #define ASEQ2 (1)(2)(3) + #define ASEQ3 (25)(26)(27) + #define ASEQ4 (25)((1)(2)(3)(4)(5))(27) + #define ASEQ5 (25)((1)(2)(4)(4)(5))(27) + #define ASEQ6 (25)((1)(2)(3)(4)(5))(27) + #define ASEQ7 (25)((1)(2)((11,12,13))(ggh)(5))(27) + #define ASEQ8 (25)((1)(2)((11,12,14))(dvd)(5))(27) + #define ASEQ9 (25)((1)(2)((11,12,13))(ggh)(5))(27) + + BOOST_TEST(BOOST_VMD_EQUAL(ASEQ,ASEQ3)); + BOOST_TEST(BOOST_VMD_EQUAL(ASEQ4,ASEQ6)); + BOOST_TEST(BOOST_VMD_EQUAL(ASEQ7,ASEQ9)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ,ASEQ2)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ4,ASEQ5)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ7,ASEQ8)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_tuple.cpp b/src/boost/libs/vmd/test/test_equal_tuple.cpp new file mode 100644 index 000000000..db069fede --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_tuple.cxx b/src/boost/libs/vmd/test/test_equal_tuple.cxx new file mode 100644 index 000000000..20877d3fb --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_tuple.cxx @@ -0,0 +1,41 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ATUPLE (0,(ggh,45,(2,(89,(dvd)(57)(99)))),170) + #define ATUPLE2 (0,(ggh,45,(2,(89,(dvd)(57)(99)))),170) + #define ATUPLE3 (0,(ggh,45,(2,(89,(ggh)(57)(99)))),170) + #define ATUPLE4 (0,1,(2,3,4,(5,6,7,8))) + #define ATUPLE5 (0,1,(2,3,4,(5,6,7,8))) + #define ATUPLE6 (0,1,(2,3,4,(5,6,7,9))) + + BOOST_TEST(BOOST_VMD_EQUAL(ATUPLE,ATUPLE2)); + BOOST_TEST(BOOST_VMD_EQUAL(ATUPLE4,ATUPLE5)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE2,ATUPLE3)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE4,ATUPLE6)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_equal_type.cpp b/src/boost/libs/vmd/test/test_equal_type.cpp new file mode 100644 index 000000000..da0a06f60 --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_equal_type.cxx> diff --git a/src/boost/libs/vmd/test/test_equal_type.cxx b/src/boost/libs/vmd/test/test_equal_type.cxx new file mode 100644 index 000000000..33efb01ba --- /dev/null +++ b/src/boost/libs/vmd/test/test_equal_type.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ATYPE BOOST_VMD_TYPE_TUPLE + #define ATYPE2 BOOST_VMD_TYPE_NUMBER + #define ATYPE3 BOOST_VMD_TYPE_TUPLE + + BOOST_TEST(BOOST_VMD_EQUAL(ATYPE,ATYPE3)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATYPE,ATYPE2)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_identifier_elem.cpp b/src/boost/libs/vmd/test/test_identifier_elem.cpp new file mode 100644 index 000000000..b5880b88d --- /dev/null +++ b/src/boost/libs/vmd/test/test_identifier_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_identifier_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_identifier_elem.cxx b/src/boost/libs/vmd/test/test_identifier_elem.cxx new file mode 100644 index 000000000..a7428a98e --- /dev/null +++ b/src/boost/libs/vmd/test/test_identifier_elem.cxx @@ -0,0 +1,80 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_aname (aname) + + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_aname_aname + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANIDENTIFIER3 ccc + #define ANIDENTIFIER5 aname + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ANARRAY3 (5,(ccc,dvd,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ANARRAY2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ANIDENTIFIER3 ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ANUMBER ATUPLE ANIDENTIFIER5 + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ANARRAY,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ALIST,BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQ,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ANIDENTIFIER3,(ggh,dvd,ccc),BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE,(dvd,ccc,ggh),BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(3,ASEQUENCE,ccc,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE,(ccc,ggh),BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER))),3); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(3,ASEQUENCE5,aname,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE5,(ccc,dvd),BOOST_VMD_TYPE_IDENTIFIER))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(4,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_IDENTIFIER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE5,BOOST_VMD_TYPE_IDENTIFIER))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_identifier_equal.cpp b/src/boost/libs/vmd/test/test_identifier_equal.cpp new file mode 100644 index 000000000..c0a9e41cd --- /dev/null +++ b/src/boost/libs/vmd/test/test_identifier_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_identifier_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_identifier_equal.cxx b/src/boost/libs/vmd/test/test_identifier_equal.cxx new file mode 100644 index 000000000..76c923f95 --- /dev/null +++ b/src/boost/libs/vmd/test/test_identifier_equal.cxx @@ -0,0 +1,44 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_dvd_dvd + + BOOST_TEST(BOOST_VMD_EQUAL(aaa,aaa,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_EQUAL(ddd,ddd,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ggg,dvd,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(bbb,ccc,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(eee,eee,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL((1,2),(1,2),BOOST_VMD_TYPE_IDENTIFIER)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_array.cpp b/src/boost/libs/vmd/test/test_is_array.cpp new file mode 100644 index 000000000..de0533900 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_array.cxx> diff --git a/src/boost/libs/vmd/test/test_is_array.cxx b/src/boost/libs/vmd/test/test_is_array.cxx new file mode 100644 index 000000000..e8106f3ab --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array.cxx @@ -0,0 +1,50 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define AN_ARRAY (7,(5,7,f,x,%,-,U)) +#if !BOOST_VMD_MSVC_V8 + #define AN_EMPTY_ARRAY (0,()) +#endif + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY((4,(x,3,e,2))) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY((6,(x,3,e,2,(4,(x,3,e,2)),#))) + ); + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY(AN_ARRAY) + ); + +#if !BOOST_VMD_MSVC_V8 + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY(AN_EMPTY_ARRAY) + ); +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_array_fail.cpp b/src/boost/libs/vmd/test/test_is_array_fail.cpp new file mode 100644 index 000000000..ea1364848 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_array_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_is_array_fail.cxx b/src/boost/libs/vmd/test/test_is_array_fail.cxx new file mode 100644 index 000000000..fe6e63f28 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail.cxx @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY((y,(x,3,e,2))) + ); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_array_fail2.cpp b/src/boost/libs/vmd/test/test_is_array_fail2.cpp new file mode 100644 index 000000000..40296b4d6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_array_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_is_array_fail2.cxx b/src/boost/libs/vmd/test/test_is_array_fail2.cxx new file mode 100644 index 000000000..5a0dc58a8 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail2.cxx @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY((3,(x,3,e,2))) + ); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_array_fail3.cpp b/src/boost/libs/vmd/test/test_is_array_fail3.cpp new file mode 100644 index 000000000..5a35e3588 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_array_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_is_array_fail3.cxx b/src/boost/libs/vmd/test/test_is_array_fail3.cxx new file mode 100644 index 000000000..4aa14c6e9 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail3.cxx @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY(tree) + ); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_array_fail4.cpp b/src/boost/libs/vmd/test/test_is_array_fail4.cpp new file mode 100644 index 000000000..6324ab0bf --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_array_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_is_array_fail4.cxx b/src/boost/libs/vmd/test/test_is_array_fail4.cxx new file mode 100644 index 000000000..7007e75f3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_array_fail4.cxx @@ -0,0 +1,24 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_array.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST + ( + BOOST_VMD_IS_ARRAY((3,(3,5,6) xc)) + ); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_empty.cpp b/src/boost/libs/vmd/test/test_is_empty.cpp new file mode 100644 index 000000000..ed992287d --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_is_empty.cxx b/src/boost/libs/vmd/test/test_is_empty.cxx new file mode 100644 index 000000000..af815a15e --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_empty.cxx @@ -0,0 +1,93 @@ + +// (C) Copyright Edward Diener 2011-2015,2019 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/facilities/empty.hpp> +#include <boost/preprocessor/variadic/has_opt.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define DATA + #define OBJECT OBJECT2 + #define OBJECT2 + #define FUNC(x) FUNC2(x) + #define FUNC2(x) + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_EMPTY())); + BOOST_TEST(BOOST_VMD_IS_EMPTY(DATA BOOST_PP_EMPTY())); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(x BOOST_PP_EMPTY())); + BOOST_TEST(BOOST_VMD_IS_EMPTY(OBJECT BOOST_PP_EMPTY())); + BOOST_TEST(BOOST_VMD_IS_EMPTY(FUNC(z) BOOST_PP_EMPTY())); + + #define FUNC_GEN() () + #define FUNC_GEN2(x) () + #define FUNC_GEN3() anything + #define FUNC_GEN4(x) anything + +#if BOOST_PP_VARIADIC_HAS_OPT() + + #define FUNC_GEN5(x,y) () + #define FUNC_GEN6(x,y) anything + #define FUNC_GEN7() (y,z) + #define FUNC_GEN5A() (&) + #define FUNC_GEN6A(x) (y) + #define FUNC_GEN7A() (y,z) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN2)); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN5)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN6)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN7)); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN5A)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN6A)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN7A)); + +#elif BOOST_VMD_MSVC + + #define FUNC_GEN5(x,y) () + #define FUNC_GEN6(x,y) anything + + /* This shows that VC++ does not work correctly in these cases. */ + + BOOST_TEST(BOOST_VMD_IS_EMPTY(FUNC_GEN)); /* This produces the wrong result */ + BOOST_TEST(BOOST_VMD_IS_EMPTY(FUNC_GEN2)); /* This produces the wrong result */ + + BOOST_TEST(BOOST_VMD_IS_EMPTY(FUNC_GEN5)); /* This should produce a compiler error but does not and produces the incorrect result */ + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN6)); /* This should produce a compiler error but does not */ + +#else + + #define FUNC_GEN5() (&) + #define FUNC_GEN6(x) (y) + #define FUNC_GEN7() (y,z) + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN2)); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN5)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN6)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN7)); + +#endif /* BOOST_VMD_MSVC */ + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN3)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN4)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_empty_fail.cpp b/src/boost/libs/vmd/test/test_is_empty_fail.cpp new file mode 100644 index 000000000..5981ef76e --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_empty_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_empty_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_is_empty_fail.cxx b/src/boost/libs/vmd/test/test_is_empty_fail.cxx new file mode 100644 index 000000000..05713f165 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_empty_fail.cxx @@ -0,0 +1,32 @@ + +// (C) Copyright Edward Diener 2011-2015,2019 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/variadic/has_opt.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#if !BOOST_VMD_MSVC && !BOOST_PP_VARIADIC_HAS_OPT() + + #define FUNC_GEN(x,y) anything + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN)); + +#else + + typedef char BOOST_VMD_IS_EMPTY_ERROR[-1]; + +#endif + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_empty_tuple_succeed.cpp b/src/boost/libs/vmd/test/test_is_empty_tuple_succeed.cpp new file mode 100644 index 000000000..fb93f7868 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_empty_tuple_succeed.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_empty_tuple_succeed.cxx> diff --git a/src/boost/libs/vmd/test/test_is_empty_tuple_succeed.cxx b/src/boost/libs/vmd/test/test_is_empty_tuple_succeed.cxx new file mode 100644 index 000000000..e48e423ec --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_empty_tuple_succeed.cxx @@ -0,0 +1,50 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/control/if.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#define TN_GEN_ONE(p) (1) +#define TN_GEN_ZERO(p) (0) + +#define TN_TEST_ONE_MORE(parameter,ens) \ + BOOST_PP_IF \ + ( \ + BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(1,0,ens),0), \ + TN_GEN_ONE, \ + TN_GEN_ZERO \ + ) \ + (parameter) \ +/**/ + +#define TN_TEST_ONE(parameter,ens) \ + BOOST_PP_TUPLE_ELEM \ + ( \ + 1, \ + 0, \ + TN_TEST_ONE_MORE(parameter,ens) \ + ) \ +/**/ + + BOOST_TEST_EQ(TN_TEST_ONE(A,(1)),1); + BOOST_TEST_EQ(TN_TEST_ONE(A,()),0); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif /* BOOST_PP_VARIADICS */ + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_identifier.cpp b/src/boost/libs/vmd/test/test_is_identifier.cpp new file mode 100644 index 000000000..d2a3be43b --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_identifier.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_identifier.cxx> diff --git a/src/boost/libs/vmd/test/test_is_identifier.cxx b/src/boost/libs/vmd/test/test_is_identifier.cxx new file mode 100644 index 000000000..9b33b047b --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_identifier.cxx @@ -0,0 +1,51 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_identifier.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zzz) + #define JDATA somevalue + #define A_SEQ (num)(%)(#) + #define A_LIST (eeb,(grist,(&,BOOST_PP_NIL))) + + #define BOOST_VMD_REGISTER_zzz (zzz) + #define BOOST_VMD_DETECT_zzz_zzz + #define BOOST_VMD_REGISTER_somevalue (somevalue) + #define BOOST_VMD_DETECT_somevalue_somevalue + #define BOOST_VMD_REGISTER_num (num) + #define BOOST_VMD_DETECT_num_num + #define BOOST_VMD_REGISTER_eeb (eeb) + #define BOOST_VMD_DETECT_eeb_eeb + #define BOOST_VMD_REGISTER_grist (grist) + #define BOOST_VMD_DETECT_grist_grist + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_TUPLE_ELEM(2,A_TUPLE),zzz)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(JDATA,somevalue)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_SEQ_ELEM(0,A_SEQ),num)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,0),eeb)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,1),grist)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(JDATA,babble)); + BOOST_TEST(!BOOST_VMD_IS_IDENTIFIER(BOOST_PP_LIST_AT(A_LIST,1),eeb)); + BOOST_TEST_EQ(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_SEQ_ELEM(0,A_SEQ),(babble,num,whatever)),1); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_list.cpp b/src/boost/libs/vmd/test/test_is_list.cpp new file mode 100644 index 000000000..e9933e167 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_list.cxx> diff --git a/src/boost/libs/vmd/test/test_is_list.cxx b/src/boost/libs/vmd/test/test_is_list.cxx new file mode 100644 index 000000000..fdfddb861 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (e,(g,(&,BOOST_PP_NIL))) + #define AN_EMPTY_LIST BOOST_PP_NIL + #define AN_EMPTY_LIST_PLUS BOOST_PP_NIL ( here ) + + BOOST_TEST(BOOST_VMD_IS_LIST((4,(x,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_IS_LIST(((3,6m,irj),(x,BOOST_PP_NIL)))); + BOOST_TEST(BOOST_VMD_IS_LIST(A_LIST)); + BOOST_TEST(BOOST_VMD_IS_LIST(AN_EMPTY_LIST)); + BOOST_TEST(!BOOST_VMD_IS_LIST(AN_EMPTY_LIST_PLUS)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_list_fail.cpp b/src/boost/libs/vmd/test/test_is_list_fail.cpp new file mode 100644 index 000000000..c9b563fdd --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_list_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_is_list_fail.cxx b/src/boost/libs/vmd/test/test_is_list_fail.cxx new file mode 100644 index 000000000..e6249a298 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_LIST((4,(x)))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_list_fail2.cpp b/src/boost/libs/vmd/test/test_is_list_fail2.cpp new file mode 100644 index 000000000..07a858bd5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_list_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_is_list_fail2.cxx b/src/boost/libs/vmd/test/test_is_list_fail2.cxx new file mode 100644 index 000000000..a339ec8b7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail2.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_LIST((4,(5,BOOST_PP_NIL),6))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_list_fail3.cpp b/src/boost/libs/vmd/test/test_is_list_fail3.cpp new file mode 100644 index 000000000..5ba52b35b --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_list_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_is_list_fail3.cxx b/src/boost/libs/vmd/test/test_is_list_fail3.cxx new file mode 100644 index 000000000..856069de7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail3.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_LIST((4,5,BOOST_PP_NIL,6))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_list_fail4.cpp b/src/boost/libs/vmd/test/test_is_list_fail4.cpp new file mode 100644 index 000000000..1d3d69e7e --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_list_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_is_list_fail4.cxx b/src/boost/libs/vmd/test/test_is_list_fail4.cxx new file mode 100644 index 000000000..295578c30 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_list_fail4.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_LIST((tt,(5,(uu,BOOST_PP_NIL yy))))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_number.cpp b/src/boost/libs/vmd/test/test_is_number.cpp new file mode 100644 index 000000000..e9a6accad --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_number.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_number.cxx> diff --git a/src/boost/libs/vmd/test/test_is_number.cxx b/src/boost/libs/vmd/test/test_is_number.cxx new file mode 100644 index 000000000..e304469ce --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_number.cxx @@ -0,0 +1,44 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_number.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + +#define A_TUPLE (4,241,zzz) +#define JDATA somevalue +#define KDATA 213 +#define A_SEQ (num)(78)(42) +#define A_LIST (eeb,(grist,(152,BOOST_PP_NIL))) + +BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(2,A_TUPLE))); +BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(1,A_TUPLE))); +BOOST_TEST(!BOOST_VMD_IS_NUMBER(JDATA)); +BOOST_TEST(BOOST_VMD_IS_NUMBER(KDATA)); +BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_SEQ_ELEM(0,A_SEQ))); +BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_PP_SEQ_ELEM(2,A_SEQ))); +BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,0))); +BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,2))); +BOOST_TEST(!BOOST_VMD_IS_NUMBER(BOOST_PP_LIST_AT(A_LIST,1))); +BOOST_TEST(!BOOST_VMD_IS_NUMBER((XXX))); +BOOST_TEST(!BOOST_VMD_IS_NUMBER()); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_parens_empty.cpp b/src/boost/libs/vmd/test/test_is_parens_empty.cpp new file mode 100644 index 000000000..3542a2efe --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_parens_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_parens_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_is_parens_empty.cxx b/src/boost/libs/vmd/test/test_is_parens_empty.cxx new file mode 100644 index 000000000..394916451 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_parens_empty.cxx @@ -0,0 +1,35 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_parens_empty.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define DATA () * 4 + #define DATA2 4 * () + #define DATA3 (X) + #define DATA4 () + #define DATA5 ( ) + + BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(DATA)); + BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(DATA2)); + BOOST_TEST(!BOOST_VMD_IS_PARENS_EMPTY(DATA3)); + BOOST_TEST(BOOST_VMD_IS_PARENS_EMPTY(DATA4)); + BOOST_TEST(BOOST_VMD_IS_PARENS_EMPTY(DATA5)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_seq.cpp b/src/boost/libs/vmd/test/test_is_seq.cpp new file mode 100644 index 000000000..20d43306c --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_is_seq.cxx b/src/boost/libs/vmd/test/test_is_seq.cxx new file mode 100644 index 000000000..a0db58de5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq.cxx @@ -0,0 +1,46 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_seq.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ATUPLE (0,1,2,3,((VMD_TEST_88_,VMD_TEST_1_))((VMD_TEST_99_,VMD_TEST_3_))((VMD_TEST_2_))((VMD_TEST_99_,VMD_TEST_100_,VMD_TEST_101_))) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_SEQ () + +#endif + + BOOST_TEST(BOOST_VMD_IS_SEQ((x))); + BOOST_TEST(BOOST_VMD_IS_SEQ((x)(y))); + BOOST_TEST(BOOST_VMD_IS_SEQ((x)(y)(z)(2)(3)(4))); + BOOST_TEST(BOOST_VMD_IS_SEQ((x)(y)(z)((1,2))(3)(4))); + BOOST_TEST(BOOST_VMD_IS_SEQ((x)(y)(z)((1,2))(3)((4,(x,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_IS_SEQ((x)(y)((x)(y)(z)(2)(3)(4))((1,2))(3)((4,(x,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_IS_SEQ(BOOST_PP_TUPLE_ELEM(4,ATUPLE))); + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST(BOOST_VMD_IS_SEQ(AN_EMPTY_SEQ)); + +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_seq_fail.cpp b/src/boost/libs/vmd/test/test_is_seq_fail.cpp new file mode 100644 index 000000000..a4643a998 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_seq_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_is_seq_fail.cxx b/src/boost/libs/vmd/test/test_is_seq_fail.cxx new file mode 100644 index 000000000..ed39d0c97 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail.cxx @@ -0,0 +1,22 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_SEQ((y,(x,3,e,2)))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_seq_fail2.cpp b/src/boost/libs/vmd/test/test_is_seq_fail2.cpp new file mode 100644 index 000000000..fdfab6b42 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_seq_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_is_seq_fail2.cxx b/src/boost/libs/vmd/test/test_is_seq_fail2.cxx new file mode 100644 index 000000000..94071bce3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail2.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_SEQ((y)2(x))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_seq_fail3.cpp b/src/boost/libs/vmd/test/test_is_seq_fail3.cpp new file mode 100644 index 000000000..e0a3c5d45 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_seq_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_is_seq_fail3.cxx b/src/boost/libs/vmd/test/test_is_seq_fail3.cxx new file mode 100644 index 000000000..6a54b6569 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail3.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_SEQ(y(z)(x))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_seq_fail4.cpp b/src/boost/libs/vmd/test/test_is_seq_fail4.cpp new file mode 100644 index 000000000..e6d7c40ee --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_seq_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_is_seq_fail4.cxx b/src/boost/libs/vmd/test/test_is_seq_fail4.cxx new file mode 100644 index 000000000..558926adc --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_seq_fail4.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_seq.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_SEQ((z)(x)(72)64)); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_tuple.cpp b/src/boost/libs/vmd/test/test_is_tuple.cpp new file mode 100644 index 000000000..46484d506 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_is_tuple.cxx b/src/boost/libs/vmd/test/test_is_tuple.cxx new file mode 100644 index 000000000..d4b3bede5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple.cxx @@ -0,0 +1,65 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zz) + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_TUPLE () + #define AN_EMPTY_TUPLE_PLUS () 83 + +#endif + + #define A_TUPLE2 (*,#,(zz,44,(e7))) + #define A_TUPLE_PLUS (mmf,34,^^,!) 456 + #define PLUS_ATUPLE yyt (j,ii%) + #define JDATA ggh + #define KDATA (ggh) + #define NOT_TUPLE y6() + #define NOT_TUPLE2 &(kkkgg,(e)) + #define A_SEQ (r)(%)(#) + #define AN_ARRAY (4,(5,7,f,x)) + #define A_LIST (e,(g,(&,BOOST_PP_NIL))) + + BOOST_TEST(!BOOST_VMD_IS_TUPLE()); + BOOST_TEST(BOOST_VMD_IS_TUPLE(A_TUPLE)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(A_TUPLE2)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(A_TUPLE_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(PLUS_ATUPLE)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(JDATA)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(KDATA)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(NOT_TUPLE)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(NOT_TUPLE2)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(A_SEQ)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(AN_ARRAY)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(A_LIST)); + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST(BOOST_VMD_IS_TUPLE(AN_EMPTY_TUPLE)); + BOOST_TEST(!BOOST_VMD_IS_TUPLE(AN_EMPTY_TUPLE_PLUS)); + +#endif + + BOOST_TEST(!BOOST_VMD_IS_TUPLE((y)2(x))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail.cpp b/src/boost/libs/vmd/test/test_is_tuple_fail.cpp new file mode 100644 index 000000000..0ae5968b5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_tuple_fail.cxx> diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail.cxx b/src/boost/libs/vmd/test/test_is_tuple_fail.cxx new file mode 100644 index 000000000..d1dc1d21b --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_TUPLE((x,3,e,2)ty)); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail2.cpp b/src/boost/libs/vmd/test/test_is_tuple_fail2.cpp new file mode 100644 index 000000000..001591e6e --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail2.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_tuple_fail2.cxx> diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail2.cxx b/src/boost/libs/vmd/test/test_is_tuple_fail2.cxx new file mode 100644 index 000000000..0776264e9 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail2.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_TUPLE(op(x,3,e,2))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail3.cpp b/src/boost/libs/vmd/test/test_is_tuple_fail3.cpp new file mode 100644 index 000000000..38cf2b8a5 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail3.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_tuple_fail3.cxx> diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail3.cxx b/src/boost/libs/vmd/test/test_is_tuple_fail3.cxx new file mode 100644 index 000000000..67864f41c --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail3.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_TUPLE((x,3,e,2)%)); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail4.cpp b/src/boost/libs/vmd/test/test_is_tuple_fail4.cpp new file mode 100644 index 000000000..d52fb5379 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail4.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_tuple_fail4.cxx> diff --git a/src/boost/libs/vmd/test/test_is_tuple_fail4.cxx b/src/boost/libs/vmd/test/test_is_tuple_fail4.cxx new file mode 100644 index 000000000..6d4c79ddb --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_tuple_fail4.cxx @@ -0,0 +1,21 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_IS_TUPLE((x,3,e,2)(y,rr))); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_type.cpp b/src/boost/libs/vmd/test/test_is_type.cpp new file mode 100644 index 000000000..22aaea327 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_type.cxx> diff --git a/src/boost/libs/vmd/test/test_is_type.cxx b/src/boost/libs/vmd/test/test_is_type.cxx new file mode 100644 index 000000000..58e44f026 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_type.cxx @@ -0,0 +1,39 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_type.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,BOOST_VMD_TYPE_ARRAY) + #define JDATA BOOST_VMD_TYPE_LIST + #define KDATA 222 + #define A_SEQ (BOOST_VMD_TYPE_TUPLE)(-)(#) + #define A_LIST (BOOST_VMD_TYPE_SEQ,(BOOST_VMD_TYPE_EMPTY,(&,BOOST_PP_NIL))) + + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_PP_TUPLE_ELEM(2,A_TUPLE))); + BOOST_TEST(BOOST_VMD_IS_TYPE(JDATA)); + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_PP_SEQ_ELEM(0,A_SEQ))); + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_PP_LIST_AT(A_LIST,0))); + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_PP_LIST_AT(A_LIST,1))); + BOOST_TEST(!BOOST_VMD_IS_TYPE(KDATA)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_vmd_seq.cpp b/src/boost/libs/vmd/test/test_is_vmd_seq.cpp new file mode 100644 index 000000000..8c9e93916 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_vmd_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_vmd_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_is_vmd_seq.cxx b/src/boost/libs/vmd/test/test_is_vmd_seq.cxx new file mode 100644 index 000000000..0bb7204fc --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_vmd_seq.cxx @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/seq/is_vmd_seq.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ATUPLE (0,1,2,3,((VMD_TEST_88_,VMD_TEST_1_))((VMD_TEST_99_,VMD_TEST_3_))((VMD_TEST_2_))((VMD_TEST_99_,VMD_TEST_100_,VMD_TEST_101_))) + #define AN_EMPTY_VMD_SEQ + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_SEQ () + +#endif + + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ()); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ(AN_EMPTY_VMD_SEQ)); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ((x))); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ((x)(y))); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ((x)(y)(z)(2)(3)(4))); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ((x)(y)(z)((1,2))(3)(4))); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ((x)(y)(z)((1,2))(3)((4,(x,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ((x)(y)((x)(y)(z)(2)(3)(4))((1,2))(3)((4,(x,BOOST_PP_NIL))))); + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ(BOOST_PP_TUPLE_ELEM(4,ATUPLE))); + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST(BOOST_VMD_IS_VMD_SEQ(AN_EMPTY_SEQ)); + +#endif + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_is_vmd_tuple.cpp b/src/boost/libs/vmd/test/test_is_vmd_tuple.cpp new file mode 100644 index 000000000..04e5f3c85 --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_vmd_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_is_vmd_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_is_vmd_tuple.cxx b/src/boost/libs/vmd/test/test_is_vmd_tuple.cxx new file mode 100644 index 000000000..66f1b920c --- /dev/null +++ b/src/boost/libs/vmd/test/test_is_vmd_tuple.cxx @@ -0,0 +1,67 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/tuple/is_vmd_tuple.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (*,#,zz) + #define AN_EMPTY_VMD_TUPLE + +#if !BOOST_VMD_MSVC_V8 + + #define AN_EMPTY_TUPLE () + #define AN_EMPTY_TUPLE_PLUS () 83 + +#endif + + #define A_TUPLE2 (*,#,(zz,44,(e7))) + #define A_TUPLE_PLUS (mmf,34,^^,!) 456 + #define PLUS_ATUPLE yyt (j,ii%) + #define JDATA ggh + #define KDATA (ggh) + #define NOT_TUPLE y6() + #define NOT_TUPLE2 &(kkkgg,(e)) + #define A_SEQ (r)(%)(#) + #define AN_ARRAY (4,(5,7,f,x)) + #define A_LIST (e,(g,(&,BOOST_PP_NIL))) + + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE()); + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(AN_EMPTY_VMD_TUPLE)); + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(A_TUPLE)); + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(A_TUPLE2)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(A_TUPLE_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(PLUS_ATUPLE)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(JDATA)); + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(KDATA)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(NOT_TUPLE)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(NOT_TUPLE2)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(A_SEQ)); + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(AN_ARRAY)); + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(A_LIST)); + +#if !BOOST_VMD_MSVC_V8 + + BOOST_TEST(BOOST_VMD_IS_VMD_TUPLE(AN_EMPTY_TUPLE)); + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE(AN_EMPTY_TUPLE_PLUS)); + +#endif + + BOOST_TEST(!BOOST_VMD_IS_VMD_TUPLE((y)2(x))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_list_elem.cpp b/src/boost/libs/vmd/test/test_list_elem.cpp new file mode 100644 index 000000000..624f99060 --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_list_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_list_elem.cxx b/src/boost/libs/vmd/test/test_list_elem.cxx new file mode 100644 index 000000000..1273e150f --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_elem.cxx @@ -0,0 +1,66 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/list/at.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST2 (10,(11,(12,(13,BOOST_PP_NIL)))) + #define ALIST3 (100,(101,(102,(103,BOOST_PP_NIL)))) + #define ALIST5 (200,(201,(202,(203,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST2 ATUPLE + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATUPLE ALIST3 + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST5 ASEQ ATUPLE ANIDENTIFIER + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)),3),3); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_ELEM(1,ASEQUENCE,BOOST_VMD_TYPE_LIST),2),2); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST))),3); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_TYPE_LIST),1),11); + + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(3,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)),2),102); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_ELEM(3,ASEQUENCE3,BOOST_VMD_TYPE_LIST),0),100); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_LIST))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_LIST)))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_ELEM(0,ASEQUENCE5,BOOST_VMD_TYPE_LIST),2),202); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_list_empty.cpp b/src/boost/libs/vmd/test/test_list_empty.cpp new file mode 100644 index 000000000..5556b5da0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_empty.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_list_empty.cxx> diff --git a/src/boost/libs/vmd/test/test_list_empty.cxx b/src/boost/libs/vmd/test/test_list_empty.cxx new file mode 100644 index 000000000..f928ea08d --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_empty.cxx @@ -0,0 +1,38 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_empty_list.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST_PLUS (mmf,(34,(^^,(!,BOOST_PP_NIL)))) 456 + #define PLUS_ALIST yyt (j,(ii%,BOOST_PP_NIL)) + #define JDATA ggh + #define KDATA (a,(b,BOOST_PP_NIL)) name + #define A_SEQ ((25,BOOST_PP_NIL))((26,BOOST_PP_NIL))((27,BOOST_PP_NIL)) + #define EMPTY_LIST BOOST_PP_NIL + + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(anything)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(A_LIST_PLUS)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(PLUS_ALIST)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(JDATA)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(KDATA)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY_LIST(A_SEQ)); + BOOST_TEST(BOOST_VMD_IS_EMPTY_LIST(EMPTY_LIST)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_list_equal.cpp b/src/boost/libs/vmd/test/test_list_equal.cpp new file mode 100644 index 000000000..3321290cb --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_list_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_list_equal.cxx b/src/boost/libs/vmd/test/test_list_equal.cxx new file mode 100644 index 000000000..41cc76b76 --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_equal.cxx @@ -0,0 +1,52 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_aaa (aaa) + #define BOOST_VMD_REGISTER_bbb (bbb) + #define BOOST_VMD_REGISTER_ccc (ccc) + #define BOOST_VMD_REGISTER_ddd (ddd) + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_aaa_aaa + #define BOOST_VMD_DETECT_bbb_bbb + #define BOOST_VMD_DETECT_ccc_ccc + #define BOOST_VMD_DETECT_ddd_ddd + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_DETECT_dvd_dvd + + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST2 (0,(1,(2,(4,BOOST_PP_NIL)))) + #define ALIST3 (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ALIST4 (0,((aaa)(ccc),(2,(3,BOOST_PP_NIL)))) + #define ALIST5 (0,((aaa)(ccc),(2,(3,BOOST_PP_NIL)))) + #define ALIST6 (0,((bbb)(ccc),(2,(3,BOOST_PP_NIL)))) + #define ATUPLE (1) + #define ATUPLE2 (1) + + BOOST_TEST(BOOST_VMD_EQUAL(ALIST,ALIST3,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_EQUAL(ALIST4,ALIST5,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ALIST,ALIST2,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ALIST4,ALIST6,BOOST_VMD_TYPE_LIST)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE,ATUPLE2,BOOST_VMD_TYPE_LIST)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_list_to_seq.cpp b/src/boost/libs/vmd/test/test_list_to_seq.cpp new file mode 100644 index 000000000..f9438dc78 --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_to_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_list_to_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_list_to_seq.cxx b/src/boost/libs/vmd/test/test_list_to_seq.cxx new file mode 100644 index 000000000..d26ce43bc --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_to_seq.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/list/to_seq.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (1,(2,(3,(4,BOOST_PP_NIL)))) + #define AN_EMPTY_LIST BOOST_PP_NIL + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(3,BOOST_VMD_LIST_TO_SEQ(A_LIST)),4); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_LIST_TO_SEQ(AN_EMPTY_LIST))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_list_to_tuple.cpp b/src/boost/libs/vmd/test/test_list_to_tuple.cpp new file mode 100644 index 000000000..2c10b2966 --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_to_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_list_to_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_list_to_tuple.cxx b/src/boost/libs/vmd/test/test_list_to_tuple.cxx new file mode 100644 index 000000000..ed3f32534 --- /dev/null +++ b/src/boost/libs/vmd/test/test_list_to_tuple.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/list/to_tuple.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_LIST (1,(2,(3,(4,BOOST_PP_NIL)))) + #define AN_EMPTY_LIST BOOST_PP_NIL + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_LIST_TO_TUPLE(A_LIST)),1); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_LIST_TO_TUPLE(AN_EMPTY_LIST))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_number_elem.cpp b/src/boost/libs/vmd/test/test_number_elem.cpp new file mode 100644 index 000000000..407e05aff --- /dev/null +++ b/src/boost/libs/vmd/test/test_number_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_number_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_number_elem.cxx b/src/boost/libs/vmd/test/test_number_elem.cxx new file mode 100644 index 000000000..a8fa0265e --- /dev/null +++ b/src/boost/libs/vmd/test/test_number_elem.cxx @@ -0,0 +1,65 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ANUMBER2 25 + #define ANUMBER3 158 + #define ANUMBER5 73 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ASEQ ALIST ANUMBER2 ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER3 ANIDENTIFIER ATUPLE + #define ASEQUENCE4 + #define ASEQUENCE5 ASEQ ANUMBER5 ATUPLE ANIDENTIFIER + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE5,BOOST_VMD_TYPE_NUMBER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)),249); + BOOST_TEST_EQ(BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_TYPE_NUMBER),249); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER))),2); + BOOST_TEST_EQ(BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_TYPE_NUMBER),25); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)),158); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_TYPE_NUMBER),158); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_NUMBER))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_NUMBER)))); + BOOST_TEST_EQ(BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_TYPE_NUMBER),73); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_number_equal.cpp b/src/boost/libs/vmd/test/test_number_equal.cpp new file mode 100644 index 000000000..a233b69dd --- /dev/null +++ b/src/boost/libs/vmd/test/test_number_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_number_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_number_equal.cxx b/src/boost/libs/vmd/test/test_number_equal.cxx new file mode 100644 index 000000000..aee5e5483 --- /dev/null +++ b/src/boost/libs/vmd/test/test_number_equal.cxx @@ -0,0 +1,35 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define ANUMBER 249 + #define ANUMBER2 17 + #define ANUMBER3 249 + #define ASEQ (22)(33) + #define ASEQ2 (22)(33) + + BOOST_TEST(BOOST_VMD_EQUAL(ANUMBER,ANUMBER3,BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_EQUAL(ANUMBER,ANUMBER3,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANUMBER,NUMBER2,BOOST_VMD_TYPE_NUMBER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ,ASEQ2,BOOST_VMD_TYPE_NUMBER)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_elem.cpp b/src/boost/libs/vmd/test/test_seq_elem.cpp new file mode 100644 index 000000000..1e412d754 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_seq_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_elem.cxx b/src/boost/libs/vmd/test/test_seq_elem.cxx new file mode 100644 index 000000000..5e9d2db2b --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_elem.cxx @@ -0,0 +1,66 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ASEQ2 (75)(76)(77) + #define ASEQ3 (147)(148)(149) + #define ASEQ5 (221)(222)(223) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ2 ATUPLE + #define ASEQUENCE3 ASEQ3 ANIDENTIFIER ATUPLE ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ5 ATUPLE ANIDENTIFIER + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(5,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(5,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),27); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_ELEM(5,ASEQUENCE,BOOST_VMD_TYPE_SEQ)),25); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),3); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_TYPE_SEQ)),76); + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ))),149); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_TYPE_SEQ)),147); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_SEQ))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_SEQ)))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_VMD_ELEM(1,ASEQUENCE5,BOOST_VMD_TYPE_SEQ)),223); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_equal.cpp b/src/boost/libs/vmd/test/test_seq_equal.cpp new file mode 100644 index 000000000..f217d679f --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_seq_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_equal.cxx b/src/boost/libs/vmd/test/test_seq_equal.cxx new file mode 100644 index 000000000..9d190f951 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_equal.cxx @@ -0,0 +1,49 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ASEQ (25)(26)(27) + #define ASEQ2 (1)(2)(3) + #define ASEQ3 (25)(26)(27) + #define ASEQ4 (25)((1)(2)(3)(4)(5))(27) + #define ASEQ5 (25)((1)(2)(4)(4)(5))(27) + #define ASEQ6 (25)((1)(2)(3)(4)(5))(27) + #define ASEQ7 (25)((1)(2)((11,12,13))(ggh)(5))(27) + #define ASEQ8 (25)((1)(2)((11,12,14))(dvd)(5))(27) + #define ASEQ9 (25)((1)(2)((11,12,13))(ggh)(5))(27) + #define ANUMBER 25 + #define ANUMBER2 25 + + BOOST_TEST(BOOST_VMD_EQUAL(ASEQ,ASEQ3,BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(ASEQ4,ASEQ6,BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_EQUAL(ASEQ7,ASEQ9,BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ,ASEQ2,BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ4,ASEQ5,BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ7,ASEQ8,BOOST_VMD_TYPE_SEQ)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANUMBER,ANUMBER2,BOOST_VMD_TYPE_SEQ)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_pop_back.cpp b/src/boost/libs/vmd/test/test_seq_pop_back.cpp new file mode 100644 index 000000000..c5031ffac --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_pop_back.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_pop_back.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_pop_back.cxx b/src/boost/libs/vmd/test/test_seq_pop_back.cxx new file mode 100644 index 000000000..e2a45e244 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_pop_back.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/pop_back.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_OE_SEQ (1) + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_VMD_SEQ_POP_BACK(A_SEQ)),3); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_POP_BACK(A_SEQ)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_SEQ_POP_BACK(AN_OE_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_pop_front.cpp b/src/boost/libs/vmd/test/test_seq_pop_front.cpp new file mode 100644 index 000000000..a64773306 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_pop_front.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_pop_front.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_pop_front.cxx b/src/boost/libs/vmd/test/test_seq_pop_front.cxx new file mode 100644 index 000000000..ddd40ed60 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_pop_front.cxx @@ -0,0 +1,34 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/pop_front.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + + #define A_SEQ (1)(2)(3)(4) + #define AN_OE_SEQ (1) + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_VMD_SEQ_POP_FRONT(A_SEQ)),4); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_POP_FRONT(A_SEQ)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_SEQ_POP_FRONT(AN_OE_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_push_back.cpp b/src/boost/libs/vmd/test/test_seq_push_back.cpp new file mode 100644 index 000000000..03a53184b --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_push_back.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_push_back.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_push_back.cxx b/src/boost/libs/vmd/test/test_seq_push_back.cxx new file mode 100644 index 000000000..2b0139f34 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_push_back.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/push_back.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_EMPTY_SEQ + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(4,BOOST_VMD_SEQ_PUSH_BACK(A_SEQ,10)),10); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_PUSH_BACK(A_SEQ,10)),5); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_SEQ_PUSH_BACK(AN_EMPTY_SEQ,20)),20); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_PUSH_BACK(AN_EMPTY_SEQ,20)),1); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_push_front.cpp b/src/boost/libs/vmd/test/test_seq_push_front.cpp new file mode 100644 index 000000000..f4dd83432 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_push_front.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_push_front.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_push_front.cxx b/src/boost/libs/vmd/test/test_seq_push_front.cxx new file mode 100644 index 000000000..a75f36c51 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_push_front.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/push_front.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_EMPTY_SEQ + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_SEQ_PUSH_FRONT(A_SEQ,10)),10); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_PUSH_FRONT(A_SEQ,10)),5); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_SEQ_PUSH_FRONT(AN_EMPTY_SEQ,20)),20); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_PUSH_FRONT(AN_EMPTY_SEQ,20)),1); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_remove.cpp b/src/boost/libs/vmd/test/test_seq_remove.cpp new file mode 100644 index 000000000..05bd270ce --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_remove.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_remove.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_remove.cxx b/src/boost/libs/vmd/test/test_seq_remove.cxx new file mode 100644 index 000000000..4c76c6576 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_remove.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/remove.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_OE_SEQ (1) + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_VMD_SEQ_REMOVE(A_SEQ,2)),4); + BOOST_TEST_EQ(BOOST_PP_SEQ_SIZE(BOOST_VMD_SEQ_REMOVE(A_SEQ,1)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_SEQ_REMOVE(AN_OE_SEQ,0))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_size.cpp b/src/boost/libs/vmd/test/test_seq_size.cpp new file mode 100644 index 000000000..05c67faca --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_size.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_size.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_size.cxx b/src/boost/libs/vmd/test/test_seq_size.cxx new file mode 100644 index 000000000..09b01ebff --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_size.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_EMPTY_SEQ + + BOOST_TEST_EQ(BOOST_VMD_SEQ_SIZE(A_SEQ),4); + BOOST_TEST_EQ(BOOST_VMD_SEQ_SIZE(AN_EMPTY_SEQ),0); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_to_array.cpp b/src/boost/libs/vmd/test/test_seq_to_array.cpp new file mode 100644 index 000000000..b3ca81740 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_to_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_to_array.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_to_array.cxx b/src/boost/libs/vmd/test/test_seq_to_array.cxx new file mode 100644 index 000000000..6afc058f0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_to_array.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/to_array.hpp> +#include <boost/vmd/is_empty_array.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/array/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_EMPTY_SEQ + + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(2,BOOST_VMD_SEQ_TO_ARRAY(A_SEQ)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(BOOST_VMD_SEQ_TO_ARRAY(AN_EMPTY_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_to_list.cpp b/src/boost/libs/vmd/test/test_seq_to_list.cpp new file mode 100644 index 000000000..5e154a212 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_to_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_to_list.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_to_list.cxx b/src/boost/libs/vmd/test/test_seq_to_list.cxx new file mode 100644 index 000000000..e73d126e7 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_to_list.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/to_list.hpp> +#include <boost/vmd/is_empty_list.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_EMPTY_SEQ + + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_SEQ_TO_LIST(A_SEQ),0),1); + BOOST_TEST(BOOST_VMD_IS_EMPTY_LIST(BOOST_VMD_SEQ_TO_LIST(AN_EMPTY_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_seq_to_tuple.cpp b/src/boost/libs/vmd/test/test_seq_to_tuple.cpp new file mode 100644 index 000000000..c4d674f27 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_to_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_seq_to_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_seq_to_tuple.cxx b/src/boost/libs/vmd/test/test_seq_to_tuple.cxx new file mode 100644 index 000000000..92f947ab1 --- /dev/null +++ b/src/boost/libs/vmd/test/test_seq_to_tuple.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/seq/to_tuple.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_SEQ (1)(2)(3)(4) + #define AN_EMPTY_SEQ + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_VMD_SEQ_TO_TUPLE(A_SEQ)),4); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_SEQ_TO_TUPLE(AN_EMPTY_SEQ))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_after_elem.cpp b/src/boost/libs/vmd/test/test_sequence_after_elem.cpp new file mode 100644 index 000000000..1f0d75d84 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_after_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_after_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_after_elem.cxx b/src/boost/libs/vmd/test/test_sequence_after_elem.cxx new file mode 100644 index 000000000..c0359d4ce --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_after_elem.cxx @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/vmd/size.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ATYPE BOOST_VMD_TYPE_EMPTY + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ATYPE ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* AFTER ELEM */ + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_ONLY_AFTER)),3); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_VMD_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_ONLY_AFTER),BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(3,ASEQUENCE4,BOOST_VMD_RETURN_ONLY_AFTER))); + BOOST_TEST_EQ(BOOST_VMD_SIZE(BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_ONLY_AFTER)),3); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_elem.cpp b/src/boost/libs/vmd/test/test_sequence_elem.cpp new file mode 100644 index 000000000..f07ce920c --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_elem.cxx b/src/boost/libs/vmd/test/test_sequence_elem.cxx new file mode 100644 index 000000000..c381f406e --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_elem.cxx @@ -0,0 +1,72 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_number.hpp> +#include <boost/vmd/elem.hpp> +#include <boost/vmd/is_type.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ATYPE BOOST_VMD_TYPE_LIST + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ATYPE ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_TYPE,BOOST_VMD_RETURN_AFTER))),2); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_PP_TUPLE_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_TYPE,BOOST_VMD_RETURN_AFTER)))),25); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_TYPE,BOOST_VMD_RETURN_AFTER)),BOOST_VMD_TYPE_IDENTIFIER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE4,BOOST_VMD_RETURN_TYPE,BOOST_VMD_RETURN_AFTER)))); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_AFTER))),2); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE2,BOOST_VMD_RETURN_AFTER))),25); + BOOST_TEST(BOOST_VMD_IS_NUMBER(BOOST_VMD_ELEM(0,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_AFTER)),BOOST_VMD_TYPE_NUMBER))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER)))); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(4,ASEQUENCE,BOOST_VMD_RETURN_TYPE)),BOOST_VMD_TYPE_ARRAY,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(3,ASEQUENCE2,BOOST_VMD_RETURN_TYPE)),249); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(1,ASEQUENCE3,BOOST_VMD_RETURN_TYPE))),27); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(4,ASEQUENCE3,BOOST_VMD_RETURN_TYPE))); + + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_VMD_ELEM(3,ASEQUENCE),(tvt,aaa,ggh))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_VMD_ELEM(4,ASEQUENCE2)),3); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_VMD_ELEM(1,ASEQUENCE3)),25); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4))); + + BOOST_TEST(BOOST_VMD_IS_TYPE(BOOST_VMD_ELEM(0,ASEQUENCE3))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_TYPE)),BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_TYPE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_enum.cpp b/src/boost/libs/vmd/test/test_sequence_enum.cpp new file mode 100644 index 000000000..bc171ecb6 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_enum.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_enum.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_enum.cxx b/src/boost/libs/vmd/test/test_sequence_enum.cxx new file mode 100644 index 000000000..a1212f1e3 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_enum.cxx @@ -0,0 +1,62 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_identifier.hpp> +#include <boost/vmd/enum.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/array/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/variadic/elem.hpp> +#include <boost/preprocessor/variadic/size.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* ENUM */ + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ENUM(ASEQUENCE4,BOOST_VMD_RETURN_TYPE))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_VARIADIC_ELEM(3,BOOST_VMD_ENUM(ASEQUENCE2,BOOST_VMD_RETURN_TYPE))),249); + BOOST_TEST_EQ(BOOST_PP_VARIADIC_SIZE(BOOST_VMD_ENUM(ASEQUENCE,BOOST_VMD_RETURN_TYPE)),6); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_VARIADIC_ELEM(0,BOOST_VMD_ENUM(ASEQUENCE3,BOOST_VMD_RETURN_TYPE))),BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TYPE)); + + /* ENUM DATA */ + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ENUM(ASEQUENCE4))); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_VARIADIC_ELEM(0,BOOST_VMD_ENUM(ASEQUENCE2)),(aaa,bbb,dvd))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_VARIADIC_ELEM(2,BOOST_VMD_ENUM(ASEQUENCE3))),2); + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(2,BOOST_PP_VARIADIC_ELEM(4,BOOST_VMD_ENUM(ASEQUENCE))),38); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_size.cpp b/src/boost/libs/vmd/test/test_sequence_size.cpp new file mode 100644 index 000000000..b666db4d8 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_size.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_size.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_size.cxx b/src/boost/libs/vmd/test/test_sequence_size.cxx new file mode 100644 index 000000000..e31e21871 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_size.cxx @@ -0,0 +1,48 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* SIZE */ + + BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE),6); + BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE2),5); + BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE3),3); + BOOST_TEST_EQ(BOOST_VMD_SIZE(ASEQUENCE4),0); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_to_array.cpp b/src/boost/libs/vmd/test/test_sequence_to_array.cpp new file mode 100644 index 000000000..9b3ef9d54 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_to_array.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_to_array.cxx b/src/boost/libs/vmd/test/test_sequence_to_array.cxx new file mode 100644 index 000000000..1e8485516 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_array.cxx @@ -0,0 +1,62 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_identifier.hpp> +#include <boost/vmd/is_seq.hpp> +#include <boost/vmd/to_array.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/array/elem.hpp> +#include <boost/preprocessor/array/size.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* TO_ARRAY */ + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_ARRAY_ELEM(3,BOOST_VMD_TO_ARRAY(ASEQUENCE,BOOST_VMD_RETURN_TYPE))),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_ARRAY_ELEM(0,BOOST_VMD_TO_ARRAY(ASEQUENCE2,BOOST_VMD_RETURN_TYPE))),dvd)); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_ARRAY_ELEM(1,BOOST_VMD_TO_ARRAY(ASEQUENCE3,BOOST_VMD_RETURN_TYPE))),17); + BOOST_TEST_EQ(BOOST_PP_ARRAY_SIZE(BOOST_VMD_TO_ARRAY(ASEQUENCE4,BOOST_VMD_RETURN_TYPE)),0); + + /* TO_ARRAY_DATA */ + + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_PP_ARRAY_ELEM(2,BOOST_VMD_TO_ARRAY(ASEQUENCE2)),1),1); + BOOST_TEST(BOOST_VMD_IS_SEQ(BOOST_PP_ARRAY_ELEM(0,BOOST_VMD_TO_ARRAY(ASEQUENCE3)))); + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(2,BOOST_PP_ARRAY_ELEM(4,BOOST_VMD_TO_ARRAY(ASEQUENCE))),38); + BOOST_TEST_EQ(BOOST_PP_ARRAY_SIZE(BOOST_VMD_TO_ARRAY(ASEQUENCE4)),0); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_to_list.cpp b/src/boost/libs/vmd/test/test_sequence_to_list.cpp new file mode 100644 index 000000000..6b749e06c --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_to_list.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_to_list.cxx b/src/boost/libs/vmd/test/test_sequence_to_list.cxx new file mode 100644 index 000000000..491e2a19b --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_list.cxx @@ -0,0 +1,61 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_identifier.hpp> +#include <boost/vmd/to_list.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/list/size.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* TO_LIST */ + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(0,BOOST_PP_TUPLE_ELEM(1,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(ASEQUENCE,BOOST_VMD_RETURN_TYPE),5))),25); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(ASEQUENCE2,BOOST_VMD_RETURN_TYPE),3)),249); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(ASEQUENCE3,BOOST_VMD_RETURN_TYPE),2)),BOOST_VMD_TYPE_TUPLE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST_EQ(BOOST_PP_LIST_SIZE(BOOST_VMD_TO_LIST(ASEQUENCE4,BOOST_VMD_RETURN_TYPE)),0); + + /* TO_LIST_DATA */ + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(ASEQUENCE),2)),3); + BOOST_TEST(BOOST_VMD_IS_IDENTIFIER(BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(ASEQUENCE2),0),(aaa,bbb,dvd))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_LIST_AT(BOOST_VMD_TO_LIST(ASEQUENCE3),2)),0); + BOOST_TEST_EQ(BOOST_PP_LIST_SIZE(BOOST_VMD_TO_LIST(ASEQUENCE4)),0); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_to_seq.cpp b/src/boost/libs/vmd/test/test_sequence_to_seq.cpp new file mode 100644 index 000000000..287488f02 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_to_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_to_seq.cxx b/src/boost/libs/vmd/test/test_sequence_to_seq.cxx new file mode 100644 index 000000000..7e4186267 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_seq.cxx @@ -0,0 +1,61 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/vmd/to_seq.hpp> +#include <boost/vmd/is_tuple.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* TO_SEQ */ + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_SEQ_ELEM(1,BOOST_VMD_TO_SEQ(ASEQUENCE3,BOOST_VMD_RETURN_TYPE))),BOOST_VMD_TYPE_NUMBER,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_IS_TUPLE(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_SEQ_ELEM(4,BOOST_VMD_TO_SEQ(ASEQUENCE2,BOOST_VMD_RETURN_TYPE))))); + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_SEQ_ELEM(1,BOOST_VMD_TO_SEQ(ASEQUENCE,BOOST_VMD_RETURN_TYPE))),3),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TO_SEQ(ASEQUENCE4,BOOST_VMD_RETURN_TYPE))); + + /* TO_SEQ_DATA */ + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(1,BOOST_PP_SEQ_ELEM(1,BOOST_VMD_TO_SEQ(ASEQUENCE2))),26); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TO_SEQ(ASEQUENCE4))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_SEQ_ELEM(2,BOOST_VMD_TO_SEQ(ASEQUENCE))),1); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(1,BOOST_VMD_TO_SEQ(ASEQUENCE3)),17); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_sequence_to_tuple.cpp b/src/boost/libs/vmd/test/test_sequence_to_tuple.cpp new file mode 100644 index 000000000..3c5bf3554 --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_tuple.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_sequence_to_tuple.cxx> diff --git a/src/boost/libs/vmd/test/test_sequence_to_tuple.cxx b/src/boost/libs/vmd/test/test_sequence_to_tuple.cxx new file mode 100644 index 000000000..613dd38ed --- /dev/null +++ b/src/boost/libs/vmd/test/test_sequence_to_tuple.cxx @@ -0,0 +1,60 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/is_empty.hpp> +#include <boost/vmd/is_list.hpp> +#include <boost/vmd/to_tuple.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + /* TO_TUPLE */ + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_TO_TUPLE(ASEQUENCE3,BOOST_VMD_RETURN_TYPE))),BOOST_VMD_TYPE_TUPLE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TO_TUPLE(ASEQUENCE4,BOOST_VMD_RETURN_TYPE))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_TO_TUPLE(ASEQUENCE2,BOOST_VMD_RETURN_TYPE)))),27); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_TO_TUPLE(ASEQUENCE,BOOST_VMD_RETURN_TYPE))),249); + + /* TO_TUPLE_DATA */ + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_TO_TUPLE(ASEQUENCE3)),17); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TO_TUPLE(ASEQUENCE4))); + BOOST_TEST(BOOST_VMD_IS_LIST(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_TO_TUPLE(ASEQUENCE)))); + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(2,BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_TO_TUPLE(ASEQUENCE2))),27); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_elem.cpp b/src/boost/libs/vmd/test/test_tuple_elem.cpp new file mode 100644 index 000000000..0239d3403 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_tuple_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_elem.cxx b/src/boost/libs/vmd/test/test_tuple_elem.cxx new file mode 100644 index 000000000..019021927 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_elem.cxx @@ -0,0 +1,68 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ATUPLE2 (10,11,12,13) + #define ATUPLE3 (100,101,102,103) + #define ATUPLE5 (200,201,202,203) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ ATUPLE2 + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATUPLE3 ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ ATUPLE5 ANIDENTIFIER + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE))),2); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_TYPE_TUPLE)),3); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_TYPE_TUPLE)),11); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE))),102); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_TYPE_TUPLE)),100); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_TUPLE))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TUPLE)))); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_TYPE_TUPLE)),202); + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(3,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_TYPE_TUPLE)),3); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_equal.cpp b/src/boost/libs/vmd/test/test_tuple_equal.cpp new file mode 100644 index 000000000..5fba99092 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_tuple_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_equal.cxx b/src/boost/libs/vmd/test/test_tuple_equal.cxx new file mode 100644 index 000000000..0a34c0f59 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_equal.cxx @@ -0,0 +1,50 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ATUPLE (0,(ggh,45,(2,(89,(dvd)(57)(99)))),170) + #define ATUPLE2 (0,(ggh,45,(2,(89,(dvd)(57)(99)))),170) + #define ATUPLE3 (0,(ggh,45,(2,(89,(ggh)(57)(99)))),170) + #define ATUPLE4 (0,1,(2,3,4,(5,6,7,8))) + #define ATUPLE5 (0,1,(2,3,4,(5,6,7,8))) + #define ATUPLE6 (0,1,(2,3,4,(5,6,7,9))) + #define ATUPLE7 (2,(3,4)) + #define ATUPLE8 (2,(3,4)) + #define ATUPLE9 (ggh,(3,BOOST_PP_NIL)) + #define ATUPLE10 (ggh,(3,BOOST_PP_NIL)) + #define ASEQ (ggh)(1) + #define ASEQ2 (ggh)(1) + + BOOST_TEST(BOOST_VMD_EQUAL(ATUPLE,ATUPLE2,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(ATUPLE4,ATUPLE5,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(ATUPLE7,ATUPLE8,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_EQUAL(ATUPLE9,ATUPLE10,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE2,ATUPLE3,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE4,ATUPLE6,BOOST_VMD_TYPE_TUPLE)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(ASEQ,ASEQ2,BOOST_VMD_TYPE_TUPLE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_pop_back.cpp b/src/boost/libs/vmd/test/test_tuple_pop_back.cpp new file mode 100644 index 000000000..081915b1e --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_pop_back.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_pop_back.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_pop_back.cxx b/src/boost/libs/vmd/test/test_tuple_pop_back.cxx new file mode 100644 index 000000000..f30ef6d6b --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_pop_back.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/pop_back.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_SE_TUPLE (1) + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_TUPLE_POP_BACK(A_TUPLE)),3); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_POP_BACK(A_TUPLE)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TUPLE_POP_BACK(AN_SE_TUPLE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_pop_front.cpp b/src/boost/libs/vmd/test/test_tuple_pop_front.cpp new file mode 100644 index 000000000..7f60bed6e --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_pop_front.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_pop_front.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_pop_front.cxx b/src/boost/libs/vmd/test/test_tuple_pop_front.cxx new file mode 100644 index 000000000..23aa77004 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_pop_front.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/pop_front.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_SE_TUPLE (1) + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_TUPLE_POP_FRONT(A_TUPLE)),4); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_POP_FRONT(A_TUPLE)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TUPLE_POP_FRONT(AN_SE_TUPLE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_push_back.cpp b/src/boost/libs/vmd/test/test_tuple_push_back.cpp new file mode 100644 index 000000000..a0beceb9d --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_push_back.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_push_back.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_push_back.cxx b/src/boost/libs/vmd/test/test_tuple_push_back.cxx new file mode 100644 index 000000000..895b91df0 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_push_back.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/push_back.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_EMPTY_TUPLE + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(4,BOOST_VMD_TUPLE_PUSH_BACK(A_TUPLE,10)),10); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_PUSH_BACK(A_TUPLE,10)),5); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_TUPLE_PUSH_BACK(AN_EMPTY_TUPLE,20)),20); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_PUSH_BACK(AN_EMPTY_TUPLE,20)),1); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_push_front.cpp b/src/boost/libs/vmd/test/test_tuple_push_front.cpp new file mode 100644 index 000000000..27061adbd --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_push_front.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_push_front.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_push_front.cxx b/src/boost/libs/vmd/test/test_tuple_push_front.cxx new file mode 100644 index 000000000..04c80c183 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_push_front.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/push_front.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_EMPTY_TUPLE + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(4,BOOST_VMD_TUPLE_PUSH_FRONT(A_TUPLE,10)),4); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_PUSH_FRONT(A_TUPLE,10)),5); + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_TUPLE_PUSH_FRONT(AN_EMPTY_TUPLE,20)),20); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_PUSH_FRONT(AN_EMPTY_TUPLE,20)),1); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_remove.cpp b/src/boost/libs/vmd/test/test_tuple_remove.cpp new file mode 100644 index 000000000..fa6ff2c07 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_remove.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_remove.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_remove.cxx b/src/boost/libs/vmd/test/test_tuple_remove.cxx new file mode 100644 index 000000000..bf25c512d --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_remove.cxx @@ -0,0 +1,33 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/remove.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/preprocessor/tuple/elem.hpp> +#include <boost/preprocessor/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_OE_TUPLE (1) + + BOOST_TEST_EQ(BOOST_PP_TUPLE_ELEM(2,BOOST_VMD_TUPLE_REMOVE(A_TUPLE,2)),4); + BOOST_TEST_EQ(BOOST_PP_TUPLE_SIZE(BOOST_VMD_TUPLE_REMOVE(A_TUPLE,1)),3); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TUPLE_REMOVE(AN_OE_TUPLE,0))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_size.cpp b/src/boost/libs/vmd/test/test_tuple_size.cpp new file mode 100644 index 000000000..c72e87e19 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_size.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_size.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_size.cxx b/src/boost/libs/vmd/test/test_tuple_size.cxx new file mode 100644 index 000000000..2ac1775aa --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_size.cxx @@ -0,0 +1,29 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/size.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_EMPTY_TUPLE + + BOOST_TEST_EQ(BOOST_VMD_TUPLE_SIZE(A_TUPLE),4); + BOOST_TEST_EQ(BOOST_VMD_TUPLE_SIZE(AN_EMPTY_TUPLE),0); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_to_array.cpp b/src/boost/libs/vmd/test/test_tuple_to_array.cpp new file mode 100644 index 000000000..456e0e65f --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_to_array.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_to_array.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_to_array.cxx b/src/boost/libs/vmd/test/test_tuple_to_array.cxx new file mode 100644 index 000000000..7fcea9b55 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_to_array.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/to_array.hpp> +#include <boost/vmd/is_empty_array.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/array/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_EMPTY_TUPLE + + BOOST_TEST_EQ(BOOST_PP_ARRAY_ELEM(3,BOOST_VMD_TUPLE_TO_ARRAY(A_TUPLE)),4); + BOOST_TEST(BOOST_VMD_IS_EMPTY_ARRAY(BOOST_VMD_TUPLE_TO_ARRAY(AN_EMPTY_TUPLE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_to_list.cpp b/src/boost/libs/vmd/test/test_tuple_to_list.cpp new file mode 100644 index 000000000..04aff1e82 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_to_list.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_to_list.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_to_list.cxx b/src/boost/libs/vmd/test/test_tuple_to_list.cxx new file mode 100644 index 000000000..30de76c8d --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_to_list.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/to_list.hpp> +#include <boost/vmd/is_empty_list.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/list/at.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_EMPTY_TUPLE + + BOOST_TEST_EQ(BOOST_PP_LIST_AT(BOOST_VMD_TUPLE_TO_LIST(A_TUPLE),1),2); + BOOST_TEST(BOOST_VMD_IS_EMPTY_LIST(BOOST_VMD_TUPLE_TO_LIST(AN_EMPTY_TUPLE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_tuple_to_seq.cpp b/src/boost/libs/vmd/test/test_tuple_to_seq.cpp new file mode 100644 index 000000000..42bb582bf --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_to_seq.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <libs/vmd/test/test_tuple_to_seq.cxx> diff --git a/src/boost/libs/vmd/test/test_tuple_to_seq.cxx b/src/boost/libs/vmd/test/test_tuple_to_seq.cxx new file mode 100644 index 000000000..68c34c167 --- /dev/null +++ b/src/boost/libs/vmd/test/test_tuple_to_seq.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2015 +// 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 <boost/vmd/tuple/to_seq.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/seq/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define A_TUPLE (1,2,3,4) + #define AN_EMPTY_TUPLE + + BOOST_TEST_EQ(BOOST_PP_SEQ_ELEM(1,BOOST_VMD_TUPLE_TO_SEQ(A_TUPLE)),2); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_TUPLE_TO_SEQ(AN_EMPTY_TUPLE))); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_type.cpp b/src/boost/libs/vmd/test/test_type.cpp new file mode 100644 index 000000000..5c4475809 --- /dev/null +++ b/src/boost/libs/vmd/test/test_type.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_type.cxx> diff --git a/src/boost/libs/vmd/test/test_type.cxx b/src/boost/libs/vmd/test/test_type.cxx new file mode 100644 index 000000000..1b5de2c11 --- /dev/null +++ b/src/boost/libs/vmd/test/test_type.cxx @@ -0,0 +1,53 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/get_type.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + #define BOOST_VMD_DETECT_ggh_ggh + #define BOOST_VMD_REGISTER_dvd (dvd) + #define BOOST_VMD_DETECT_dvd_dvd + + #define ANIDENTIFIER ggh + #define ANIDENTIFIER2 dvd + #define ANUMBER 249 + #define ANUMBER2 17 + #define ASEQ (25)(26)(27) + #define ATUPLE (0,1,2,3,((a,b))((c,d))((e))((f,g,h))) + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ATYPE BOOST_VMD_TYPE_IDENTIFIER + #define ASEQUENCE ANUMBER ALIST ATUPLE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER2 ASEQ ALIST ANUMBER ATUPLE + #define ASEQUENCE3 ASEQ ANUMBER2 ATUPLE + #define ASEQUENCE4 + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ANIDENTIFIER),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ANUMBER),BOOST_VMD_TYPE_NUMBER,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ASEQ),BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ATUPLE),BOOST_VMD_TYPE_TUPLE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ALIST),BOOST_VMD_TYPE_LIST,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ANARRAY),BOOST_VMD_TYPE_ARRAY,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ATYPE),BOOST_VMD_TYPE_TYPE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ASEQUENCE),BOOST_VMD_TYPE_SEQUENCE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_GET_TYPE(ASEQUENCE4),BOOST_VMD_TYPE_EMPTY,BOOST_VMD_TYPE_TYPE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_type_elem.cpp b/src/boost/libs/vmd/test/test_type_elem.cpp new file mode 100644 index 000000000..e44b7d05f --- /dev/null +++ b/src/boost/libs/vmd/test/test_type_elem.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_type_elem.cxx> diff --git a/src/boost/libs/vmd/test/test_type_elem.cxx b/src/boost/libs/vmd/test/test_type_elem.cxx new file mode 100644 index 000000000..7543a4297 --- /dev/null +++ b/src/boost/libs/vmd/test/test_type_elem.cxx @@ -0,0 +1,66 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/elem.hpp> +#include <boost/vmd/equal.hpp> +#include <boost/vmd/is_empty.hpp> +#include <boost/detail/lightweight_test.hpp> +#include <boost/preprocessor/tuple/elem.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + #define BOOST_VMD_REGISTER_ggh (ggh) + + #define ANIDENTIFIER ggh + #define ANUMBER 249 + #define ASEQ (25)(26)(27) + #define ATYPE BOOST_VMD_TYPE_SEQ + #define ATYPE2 BOOST_VMD_TYPE_ARRAY + #define ATYPE3 BOOST_VMD_TYPE_TYPE + #define ATYPE5 BOOST_VMD_TYPE_EMPTY + #define ALIST (0,(1,(2,(3,BOOST_PP_NIL)))) + #define ANARRAY (3,(a,b,38)) + #define ANARRAY2 (5,(c,d,133,22,15)) + #define ASEQUENCE ANUMBER ALIST ATYPE ANIDENTIFIER ANARRAY ASEQ + #define ASEQUENCE2 ANIDENTIFIER ANARRAY2 ALIST ASEQ ATYPE2 + #define ASEQUENCE3 ASEQ ANIDENTIFIER ATYPE3 ALIST + #define ASEQUENCE4 + #define ASEQUENCE5 ALIST ASEQ ATYPE5 ANIDENTIFIER + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)),BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_ELEM(2,ASEQUENCE,BOOST_VMD_TYPE_TYPE),BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TYPE)); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_ARRAY,BOOST_VMD_ELEM(4,ASEQUENCE2,BOOST_VMD_TYPE_TYPE),BOOST_VMD_TYPE_TYPE)); + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_TYPE,BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)),BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_TYPE,BOOST_VMD_ELEM(2,ASEQUENCE3,BOOST_VMD_TYPE_TYPE),BOOST_VMD_TYPE_TYPE)); + + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,ASEQUENCE4,BOOST_VMD_TYPE_TYPE))); + + BOOST_TEST(!BOOST_VMD_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_RETURN_AFTER,BOOST_VMD_TYPE_TYPE)))); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_EMPTY,BOOST_VMD_ELEM(2,ASEQUENCE5,BOOST_VMD_TYPE_TYPE),BOOST_VMD_TYPE_TYPE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_type_equal.cpp b/src/boost/libs/vmd/test/test_type_equal.cpp new file mode 100644 index 000000000..f10dd7664 --- /dev/null +++ b/src/boost/libs/vmd/test/test_type_equal.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_type_equal.cxx> diff --git a/src/boost/libs/vmd/test/test_type_equal.cxx b/src/boost/libs/vmd/test/test_type_equal.cxx new file mode 100644 index 000000000..1ebd10243 --- /dev/null +++ b/src/boost/libs/vmd/test/test_type_equal.cxx @@ -0,0 +1,31 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/equal.hpp> +#include <boost/vmd/not_equal.hpp> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if BOOST_PP_VARIADICS + + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_LIST,BOOST_VMD_TYPE_LIST,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_EQUAL(BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_SEQ,BOOST_VMD_TYPE_IDENTIFIER)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(BOOST_VMD_TYPE_EMPTY,BOOST_VMD_TYPE_SEQUENCE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(BOOST_VMD_TYPE_TUPLE,NOT_TYPE,BOOST_VMD_TYPE_TYPE)); + BOOST_TEST(BOOST_VMD_NOT_EQUAL(BOOST_VMD_TYPE_TYPE,(3),BOOST_VMD_TYPE_TYPE)); + +#else + +BOOST_ERROR("No variadic macro support"); + +#endif + + return boost::report_errors(); + + } diff --git a/src/boost/libs/vmd/test/test_variadic_macro.cpp b/src/boost/libs/vmd/test/test_variadic_macro.cpp new file mode 100644 index 000000000..afacbeb73 --- /dev/null +++ b/src/boost/libs/vmd/test/test_variadic_macro.cpp @@ -0,0 +1,7 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <libs/vmd/test/test_variadic_macro.cxx> diff --git a/src/boost/libs/vmd/test/test_variadic_macro.cxx b/src/boost/libs/vmd/test/test_variadic_macro.cxx new file mode 100644 index 000000000..4da094a59 --- /dev/null +++ b/src/boost/libs/vmd/test/test_variadic_macro.cxx @@ -0,0 +1,65 @@ + +// (C) Copyright Edward Diener 2011-2015 +// 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 <boost/vmd/detail/setup.hpp> +#include <boost/predef.h> +#include <boost/detail/lightweight_test.hpp> + +int main() + { + +#if !BOOST_PP_VARIADICS + +# if defined __GCCXML__ +BOOST_ERROR("No variadic macro support: __GCCXML__ defined."); +# elif defined __CUDACC__ +BOOST_ERROR("No variadic macro support: __CUDACC__ defined."); +# elif defined __PATHSCALE__ +BOOST_ERROR("No variadic macro support: __PATHSCALE__ defined."); +# elif defined __DMC__ +BOOST_ERROR("No variadic macro support: __DMC__ defined."); +# elif defined __CODEGEARC__ +BOOST_ERROR("No variadic macro support: __CODEGEARC__ defined."); +# elif defined __BORLANDC__ +BOOST_ERROR("No variadic macro support: __BORLANDC__ defined."); +# elif defined __MWERKS__ +BOOST_ERROR("No variadic macro support: __MWERKS__ defined."); +# elif (defined __SUNPRO_CC && __SUNPRO_CC < 0x5130) +BOOST_ERROR("No variadic macro support: __SUNPRO_CC defined below version 12.3."); +# elif defined __HP_aCC && !defined __EDG__ +BOOST_ERROR("No variadic macro support: __HP_aCC defined and __EDG__ not defined."); +# elif defined __MRC__ +BOOST_ERROR("No variadic macro support: __MRC__ defined."); +# elif defined __SC__ +BOOST_ERROR("No variadic macro support: __SC__ defined."); +# elif defined __IBMCPP__ +BOOST_ERROR("No variadic macro support: __IBMCPP__ defined."); +# elif defined __PGI +BOOST_ERROR("No variadic macro support: __PGI defined."); +# /* VC++ (C/C++) */ +# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__)) && !defined __clang__ +# /* Wave (C/C++), GCC (C++) */ +# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__ +# /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */ +# elif !defined __cplusplus && __STDC_VERSION__ < 199901L +# if BOOST_COMP_GNUC >= BOOST_VERSION_NUMBER(4,3,0) +BOOST_ERROR("No variadic macro support for gcc >= 4.3: __STDC_VERSION__ is less than 199901L."); +# else +BOOST_ERROR("No variadic macro support: __STDC_VERSION__ is less than 199901L."); +# endif +# elif defined __cplusplus && __cplusplus < 201103L +# if BOOST_COMP_GNUC >= BOOST_VERSION_NUMBER(4,3,0) +BOOST_ERROR("No variadic macro support for g++ >= 4.3: __cplusplus is less than 201103L."); +# else +BOOST_ERROR("No variadic macro support: __cplusplus is less than 201103L."); +# endif +# endif + +#endif + + return boost::report_errors(); + + } |