forked from boostorg/range
*** empty log message ***
[SVN r27148]
This commit is contained in:
@ -16,18 +16,13 @@
|
||||
# pragma warn -8057 // unused argument argc/argv in Boost.Test
|
||||
#endif
|
||||
|
||||
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <boost/range/functions.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
// This should be included before "using namespace boost",
|
||||
// otherwise gcc headers will be confused with boost::iterator
|
||||
// namespace.
|
||||
#include <boost/test/included/unit_test_framework.hpp>
|
||||
|
||||
using namespace boost;
|
||||
using namespace std;
|
||||
|
||||
@ -85,10 +80,21 @@ void check_iterator_range()
|
||||
BOOST_CHECK( rrr == rr );
|
||||
BOOST_CHECK( !( rrr != rr ) );
|
||||
BOOST_CHECK( !( rrr < rr ) );
|
||||
|
||||
const irange cr = make_iterator_range( str );
|
||||
BOOST_CHECK_EQUAL( cr.front(), 'h' );
|
||||
BOOST_CHECK_EQUAL( cr.back(), 'd' );
|
||||
BOOST_CHECK_EQUAL( cr[1], 'e' );
|
||||
|
||||
rrr = make_iterator_range( str, 1, -1 );
|
||||
BOOST_CHECK( rrr == "ello worl" );
|
||||
rrr = make_iterator_range( rrr, -1, 1 );
|
||||
BOOST_CHECK( rrr == str );
|
||||
}
|
||||
|
||||
|
||||
using boost::unit_test_framework::test_suite;
|
||||
#include <boost/test/unit_test.hpp>
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
|
Reference in New Issue
Block a user