diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index 1640310..ae59309 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -20,12 +20,14 @@ // (David Abrahams) # include -# include -# include +# include # include # include // for detail::dummy_constructor # include # include +# include +# include +# include namespace boost { @@ -51,28 +53,28 @@ template void trivial_iterator_test(const Iterator i, const Iterator j, T val) { Iterator k; - assert(i == i); - assert(j == j); - assert(i != j); + BOOST_ASSERT(i == i); + BOOST_ASSERT(j == j); + BOOST_ASSERT(i != j); #ifdef BOOST_NO_STD_ITERATOR_TRAITS T v = *i; #else typename std::iterator_traits::value_type v = *i; #endif - assert(v == val); + BOOST_ASSERT(v == val); boost::ignore_unused(v); #if 0 // hmm, this will give a warning for transform_iterator... perhaps // this should be separated out into a stand-alone test since there // are several situations where it can't be used, like for // integer_range::iterator. - assert(v == i->foo()); + BOOST_ASSERT(v == i->foo()); #endif k = i; - assert(k == k); - assert(k == i); - assert(k != j); - assert(*k == val); + BOOST_ASSERT(k == k); + BOOST_ASSERT(k == i); + BOOST_ASSERT(k != j); + BOOST_ASSERT(*k == val); boost::ignore_unused(k); } @@ -92,8 +94,8 @@ void input_iterator_test(Iterator i, T v1, T v2) { Iterator i1(i); - assert(i == i1); - assert(!(i != i1)); + BOOST_ASSERT(i == i1); + BOOST_ASSERT(!(i != i1)); // I can see no generic way to create an input iterator // that is in the domain of== of i and != i. @@ -102,24 +104,24 @@ void input_iterator_test(Iterator i, T v1, T v2) // // Iterator i2; // - // assert(i != i2); - // assert(!(i == i2)); + // BOOST_ASSERT(i != i2); + // BOOST_ASSERT(!(i == i2)); - assert(*i1 == v1); - assert(*i == v1); + BOOST_ASSERT(*i1 == v1); + BOOST_ASSERT(*i == v1); // we cannot test for equivalence of (void)++i & (void)i++ // as i is only guaranteed to be single pass. - assert(*i++ == v1); + BOOST_ASSERT(*i++ == v1); boost::ignore_unused(i1); i1 = i; - assert(i == i1); - assert(!(i != i1)); + BOOST_ASSERT(i == i1); + BOOST_ASSERT(!(i != i1)); - assert(*i1 == v2); - assert(*i == v2); + BOOST_ASSERT(*i1 == v2); + BOOST_ASSERT(*i == v2); boost::ignore_unused(i1); // i is dereferencable, so it must be incrementable. @@ -162,15 +164,15 @@ void forward_iterator_test(Iterator i, T v1, T v2) Iterator i1 = i, i2 = i; - assert(i == i1++); - assert(i != ++i2); + BOOST_ASSERT(i == i1++); + BOOST_ASSERT(i != ++i2); trivial_iterator_test(i, i1, v1); trivial_iterator_test(i, i2, v1); ++i; - assert(i == i1); - assert(i == i2); + BOOST_ASSERT(i == i1); + BOOST_ASSERT(i == i2); ++i1; ++i2; @@ -192,15 +194,15 @@ void bidirectional_iterator_test(Iterator i, T v1, T v2) Iterator i1 = i, i2 = i; - assert(i == i1--); - assert(i != --i2); + BOOST_ASSERT(i == i1--); + BOOST_ASSERT(i != --i2); trivial_iterator_test(i, i1, v2); trivial_iterator_test(i, i2, v2); --i; - assert(i == i1); - assert(i == i2); + BOOST_ASSERT(i == i1); + BOOST_ASSERT(i == i2); ++i1; ++i2; @@ -224,30 +226,30 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) boost::ignore_unused(); for (c = 0; c < N-1; ++c) { - assert(i == j + c); - assert(*i == vals[c]); - assert(*i == boost::implicit_cast(j[c])); - assert(*i == *(j + c)); - assert(*i == *(c + j)); + BOOST_ASSERT(i == j + c); + BOOST_ASSERT(*i == vals[c]); + BOOST_ASSERT(*i == boost::implicit_cast(j[c])); + BOOST_ASSERT(*i == *(j + c)); + BOOST_ASSERT(*i == *(c + j)); ++i; - assert(i > j); - assert(i >= j); - assert(j <= i); - assert(j < i); + BOOST_ASSERT(i > j); + BOOST_ASSERT(i >= j); + BOOST_ASSERT(j <= i); + BOOST_ASSERT(j < i); } Iterator k = j + N - 1; for (c = 0; c < N-1; ++c) { - assert(i == k - c); - assert(*i == vals[N - 1 - c]); - assert(*i == boost::implicit_cast(j[N - 1 - c])); + BOOST_ASSERT(i == k - c); + BOOST_ASSERT(*i == vals[N - 1 - c]); + BOOST_ASSERT(*i == boost::implicit_cast(j[N - 1 - c])); Iterator q = k - c; boost::ignore_unused(q); - assert(*i == *q); - assert(i > j); - assert(i >= j); - assert(j <= i); - assert(j < i); + BOOST_ASSERT(*i == *q); + BOOST_ASSERT(i > j); + BOOST_ASSERT(i >= j); + BOOST_ASSERT(j <= i); + BOOST_ASSERT(j < i); --i; } } @@ -256,16 +258,16 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) template void const_nonconst_iterator_test(Iterator i, ConstIterator j) { - assert(i != j); - assert(j != i); + BOOST_ASSERT(i != j); + BOOST_ASSERT(j != i); ConstIterator k(i); - assert(k == i); - assert(i == k); + BOOST_ASSERT(k == i); + BOOST_ASSERT(i == k); k = i; - assert(k == i); - assert(i == k); + BOOST_ASSERT(k == i); + BOOST_ASSERT(i == k); boost::ignore_unused(k); }