// library (Daryle Walker)
// 12 Dec 99 Initial version with iterator operators (Jeremy Siek)
-#define BOOST_INCLUDE_MAIN
-#include <boost/test/test_tools.hpp> // for main
+#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT
-#include <boost/cstdlib.hpp> // for boost::exit_success
#include <boost/operators.hpp> // for boost::random_access_iterator_helper
#include <cstddef> // for std::ptrdiff_t, std::size_t
// Main testing function
int
-test_main( int , char * [] )
+main()
{
using std::string;
test1_type::master_test( "non-const string" );
test2_type::master_test( "const string" );
- return boost::exit_success;
+ return boost::report_errors();
}
// Tests for all of the operators added by random_access_iterator_helper
oss << *i++ << ' ';
}
- BOOST_CHECK( oss.str() == "apple orange pear peach grape plum ");
+ BOOST_TEST( oss.str() == "apple orange pear peach grape plum ");
}
// Test post-decrement
oss << *i << ' ';
}
- BOOST_CHECK( oss.str() == "plum grape peach pear orange apple ");
+ BOOST_TEST( oss.str() == "plum grape peach pear orange apple ");
}
// Test indirect structure referral
oss << i->size() << ' ';
}
- BOOST_CHECK( oss.str() == "5 6 4 5 5 4 ");
+ BOOST_TEST( oss.str() == "5 6 4 5 5 4 ");
}
// Test offset addition
oss << *i << ' ';
}
- BOOST_CHECK( oss.str() == "apple pear grape ");
+ BOOST_TEST( oss.str() == "apple pear grape ");
}
// Test offset addition, in reverse order
oss << *i << ' ';
}
- BOOST_CHECK( oss.str() == "apple pear grape ");
+ BOOST_TEST( oss.str() == "apple pear grape ");
}
// Test offset subtraction
}
}
- BOOST_CHECK( oss.str() == "grape pear apple ");
+ BOOST_TEST( oss.str() == "grape pear apple ");
}
// Test comparisons
{
ptrdiff_t const j_offset = j - fruit_begin;
- BOOST_CHECK( (i != j) == (i_offset != j_offset) );
- BOOST_CHECK( (i > j) == (i_offset > j_offset) );
- BOOST_CHECK( (i <= j) == (i_offset <= j_offset) );
- BOOST_CHECK( (i >= j) == (i_offset >= j_offset) );
+ BOOST_TEST( (i != j) == (i_offset != j_offset) );
+ BOOST_TEST( (i > j) == (i_offset > j_offset) );
+ BOOST_TEST( (i <= j) == (i_offset <= j_offset) );
+ BOOST_TEST( (i >= j) == (i_offset >= j_offset) );
}
}
cout << std::endl;
oss << fruit_begin[ k ] << ' ';
}
- BOOST_CHECK( oss.str() == "apple orange pear peach grape plum ");
+ BOOST_TEST( oss.str() == "apple orange pear peach grape plum ");
}