Switch from deprecated test to Lightweight Test

This commit is contained in:
Glen Fernandes 2021-06-07 22:03:32 -04:00
parent 2c0145bff0
commit f4b47fd266

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/test/minimal.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/iterator/permutation_iterator.hpp> #include <boost/iterator/permutation_iterator.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
@ -59,14 +59,14 @@ void permutation_test()
permutation_type it = begin; permutation_type it = begin;
permutation_type end = boost::make_permutation_iterator( elements.begin(), indices.end() ); permutation_type end = boost::make_permutation_iterator( elements.begin(), indices.end() );
BOOST_CHECK( it == begin ); BOOST_TEST( it == begin );
BOOST_CHECK( it != end ); BOOST_TEST( it != end );
BOOST_CHECK( std::distance( begin, end ) == index_size ); BOOST_TEST( std::distance( begin, end ) == index_size );
for( index_type::iterator i_it1 = indices.begin(); it != end; ++i_it1, ++it ) for( index_type::iterator i_it1 = indices.begin(); it != end; ++i_it1, ++it )
{ {
BOOST_CHECK( *it == elements[ *i_it1 ] ); BOOST_TEST( *it == elements[ *i_it1 ] );
} }
it = begin; it = begin;
@ -74,14 +74,14 @@ void permutation_test()
{ {
index_type::iterator i_it2 = indices.begin(); index_type::iterator i_it2 = indices.begin();
std::advance( i_it2, i1 ); std::advance( i_it2, i1 );
BOOST_CHECK( *it == elements[ *i_it2 ] ); BOOST_TEST( *it == elements[ *i_it2 ] );
} }
it = begin; it = begin;
std::advance(it, index_size); std::advance(it, index_size);
for( index_type::iterator i_it3 = indices.end(); it != begin; ) for( index_type::iterator i_it3 = indices.end(); it != begin; )
{ {
BOOST_CHECK( *--it == elements[ *--i_it3 ] ); BOOST_TEST( *--it == elements[ *--i_it3 ] );
} }
it = begin; it = begin;
@ -90,14 +90,14 @@ void permutation_test()
{ {
index_type::iterator i_it4 = --indices.end(); index_type::iterator i_it4 = --indices.end();
std::advance( i_it4, -i2 ); std::advance( i_it4, -i2 );
BOOST_CHECK( *--it == elements[ *i_it4 ] ); BOOST_TEST( *--it == elements[ *i_it4 ] );
} }
} }
int test_main(int, char *[]) int main()
{ {
permutation_test(); permutation_test();
return 0; return boost::report_errors();
} }