From b7fa994f3d7fbc3713c81e3361c75972950ba9e5 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 18 Jun 2005 22:42:04 +0000 Subject: [PATCH] Added iterator testing. [SVN r29682] --- test/map.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/test/map.cpp b/test/map.cpp index 2f1a59a..3d74c19 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -12,7 +12,7 @@ // $Date$ // $Revision$ -#include +#include #include #include #include @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -158,3 +159,38 @@ MPL_TEST_CASE() MPL_ASSERT_RELATION( size::type::value, ==, 0 ); MPL_ASSERT(( is_same< at::type,void_ > )); } + +// Use a template for testing so that GCC will show us the actual types involved +template +void test() +{ + MPL_ASSERT_RELATION( size::value, ==, 3 ); + + typedef typename end::type not_found; + BOOST_MPL_ASSERT_NOT(( is_same >::type,not_found> )); + BOOST_MPL_ASSERT_NOT(( is_same >::type,not_found> )); + BOOST_MPL_ASSERT_NOT(( is_same >::type,not_found> )); + BOOST_MPL_ASSERT(( is_same::type,not_found> )); +}; + +MPL_TEST_CASE() +{ + typedef map< mpl::pair > map_of_1_pair; + typedef begin::type iter_to_1_pair; + + BOOST_MPL_ASSERT(( + is_same< + deref::type + , mpl::pair + > + )); + + typedef map< + mpl::pair + , mpl::pair + , mpl::pair + > mymap; + + test(); + test(); +}