From 456dfd0dea5fab70ce23609ccaf58f301574c1d2 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Fri, 9 Feb 2001 05:26:48 +0000 Subject: [PATCH] adjusted to changes in iterator_adaptors.hpp, added more tests of make_xxx [SVN r9051] --- iterator_adaptor_test.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/iterator_adaptor_test.cpp b/iterator_adaptor_test.cpp index 4d03018..6f27707 100644 --- a/iterator_adaptor_test.cpp +++ b/iterator_adaptor_test.cpp @@ -246,14 +246,10 @@ main() boost::random_access_iterator_test(i, N, array); typedef boost::iterator InnerTraits; -#if 0 - boost::random_access_iterator_test(boost::make_indirect_iterator(&*ptr), N, array); -#else - boost::random_access_iterator_test(boost::make_indirect_iterator(&*ptr), N, array); -#endif + boost::random_access_iterator_test(boost::make_indirect_iterator(ptr, InnerTraits()), N, array); #ifndef BOOST_NO_STD_ITERATOR_TRAITS - boost::random_access_iterator_test(boost::make_indirect_iterator(&*ptr), N, array); + boost::random_access_iterator_test(boost::make_indirect_iterator(ptr), N, array); #endif const_indirect_iterator j = ptr; @@ -261,11 +257,8 @@ main() dummyT*const* const_ptr = ptr; typedef boost::iterator ConstInnerTraits; -#if 0 - boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array); -#else - boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array); -#endif + + boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr, ConstInnerTraits()), N, array); #ifndef BOOST_NO_STD_ITERATOR_TRAITS boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array); @@ -380,12 +373,22 @@ main() FilterIter i(array, FilterPolicies(one_or_four(), array + N)); boost::forward_iterator_test(i, dummyT(1), dummyT(4)); + typedef boost::iterator FilterTraits; + boost::forward_iterator_test(boost::make_filter_iterator + (array, array + N, one_or_four() ), dummyT(1), dummyT(4)); + + boost::forward_iterator_test(boost::make_filter_iterator + (array, array + N), dummyT(1), dummyT(4)); + +#ifndef BOOST_NO_STD_ITERATOR_TRAITS boost::forward_iterator_test(boost::make_filter_iterator( - array, array + N, one_or_four() -#ifdef BOOST_NO_STD_ITERATOR_TRAITS - , boost::iterator() + array, array + N, one_or_four()), dummyT(1), dummyT(4)); + + boost::forward_iterator_test(boost::make_filter_iterator( + array, array + N), dummyT(1), dummyT(4)); #endif - ), dummyT(1), dummyT(4)); + + } std::cout << "test successful " << std::endl; return 0;