adding tests to attest other views don't suffer of it either

This commit is contained in:
Bruno Dutra
2015-03-21 22:19:56 -03:00
parent eaa3f26c9c
commit 0f5451623c
4 changed files with 20 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include <boost/mpl/list.hpp>
#include <boost/mpl/sizeof.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/aux_/test.hpp>
#include <boost/type_traits/is_float.hpp>
@@ -26,6 +27,10 @@
MPL_TEST_CASE()
{
typedef mpl::list<int,float,long,float,char[50],long double,char> types;
typedef mpl::list<float,float,long double> floats;
MPL_ASSERT(( equal< mpl::filter_view< types,boost::is_float<_> >::type,floats > ));
typedef mpl::max_element<
mpl::transform_view<
mpl::filter_view< types,boost::is_float<_> >

View File

@@ -30,6 +30,7 @@ MPL_TEST_CASE()
typedef range_c<int,0,15> answer;
MPL_ASSERT(( equal<numbers,answer> ));
MPL_ASSERT(( equal<numbers::type,answer> ));
MPL_ASSERT_RELATION( size<numbers>::value, ==, 15 );
}

View File

@@ -15,6 +15,7 @@
#include <boost/mpl/advance.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/aux_/test.hpp>
MPL_TEST_CASE()
@@ -37,4 +38,6 @@ MPL_TEST_CASE()
MPL_ASSERT_RELATION( (mpl::distance<last,last>::value), ==, 0 );
MPL_ASSERT_RELATION( size<view>::value, ==, 1 );
MPL_ASSERT(( equal< view, view::type > ));
}

View File

@@ -16,12 +16,22 @@
#include <boost/mpl/max_element.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/sizeof.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/aux_/test.hpp>
MPL_TEST_CASE()
{
typedef list<int,long,char,char[50],double> types;
typedef list<
sizeof_<int>::type,
sizeof_<long>::type,
sizeof_<char>::type,
sizeof_<char[50]>::type,
sizeof_<double>::type
> sizes;
MPL_ASSERT(( equal< transform_view< types, sizeof_<_> >::type,sizes > ));
typedef max_element<
transform_view< types, sizeof_<_> >
>::type iter;