From 95d2a111aba04bae9be3460ee08c13760d4fcea9 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 9 Nov 2014 02:55:59 +0900 Subject: [PATCH] Add tests for #3225 --- test/sequence/map_misc.cpp | 12 ++++++++++++ test/sequence/misc.hpp | 12 ++++++++++++ test/sequence/set.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/test/sequence/map_misc.cpp b/test/sequence/map_misc.cpp index 256a16f4..81da9753 100644 --- a/test/sequence/map_misc.cpp +++ b/test/sequence/map_misc.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -148,6 +149,17 @@ test() BOOST_STATIC_ASSERT(!traits::is_sequence::value); } + { // testing mpl::is_sequence + + typedef map, pair, pair > t1; + typedef map<> t2; + typedef map > t3; + + BOOST_STATIC_ASSERT(boost::mpl::is_sequence::value); + BOOST_STATIC_ASSERT(boost::mpl::is_sequence::value); + BOOST_STATIC_ASSERT(boost::mpl::is_sequence::value); + } + { // testing mpl compatibility // test an algorithm diff --git a/test/sequence/misc.hpp b/test/sequence/misc.hpp index ecbe1549..c426bba8 100644 --- a/test/sequence/misc.hpp +++ b/test/sequence/misc.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -175,6 +176,17 @@ test() BOOST_STATIC_ASSERT(!traits::is_sequence::value); } + { // testing mpl::is_sequence + + typedef FUSION_SEQUENCE t1; + typedef FUSION_SEQUENCE<> t2; + typedef FUSION_SEQUENCE t3; + + BOOST_STATIC_ASSERT(boost::mpl::is_sequence::value); + BOOST_STATIC_ASSERT(boost::mpl::is_sequence::value); + BOOST_STATIC_ASSERT(boost::mpl::is_sequence::value); + } + { // testing mpl compatibility // test begin, end, next, prior, advance, size, deref, etc. diff --git a/test/sequence/set.cpp b/test/sequence/set.cpp index 1ea6ba24..cf97c100 100644 --- a/test/sequence/set.cpp +++ b/test/sequence/set.cpp @@ -18,8 +18,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -78,6 +80,28 @@ main() BOOST_TEST(at_key(make_set('X', 123)) == 123); } + { // testing is_sequence + + typedef set t1; + typedef set<> t2; + typedef set t3; + + BOOST_MPL_ASSERT((traits::is_sequence)); + BOOST_MPL_ASSERT((traits::is_sequence)); + BOOST_MPL_ASSERT((traits::is_sequence)); + } + + { // testing mpl::is_sequence + + typedef set t1; + typedef set<> t2; + typedef set t3; + + BOOST_MPL_ASSERT((boost::mpl::is_sequence)); + BOOST_MPL_ASSERT((boost::mpl::is_sequence)); + BOOST_MPL_ASSERT((boost::mpl::is_sequence)); + } + return boost::report_errors(); }