Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64001 - trunk/libs/range/test/algorithm_test
From: neil_at_[hidden]
Date: 2010-07-13 18:28:38


Author: neilgroves
Date: 2010-07-13 18:28:37 EDT (Tue, 13 Jul 2010)
New Revision: 64001
URL: http://svn.boost.org/trac/boost/changeset/64001

Log:
[range] - corrected defected test for the partition algorithm.
Text files modified:
   trunk/libs/range/test/algorithm_test/partition.cpp | 25 ++++++++++++-------------
   1 files changed, 12 insertions(+), 13 deletions(-)

Modified: trunk/libs/range/test/algorithm_test/partition.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/partition.cpp (original)
+++ trunk/libs/range/test/algorithm_test/partition.cpp 2010-07-13 18:28:37 EDT (Tue, 13 Jul 2010)
@@ -42,19 +42,19 @@
             test_iter(Container& cont)
             {
                 typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
-
+
                 const Container old_cont(cont);
                 Container cont2(old_cont);
                 iter_t result = boost::partition(cont, UnaryPredicate());
-
+
                 iter_t temp_result = boost::partition(cont2, UnaryPredicate());
                 cont2 = old_cont;
                 BOOST_CHECK( temp_result == boost::partition(
                     boost::make_iterator_range(cont2), UnaryPredicate()) );
-
+
                 BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
                                                cont2.begin(), cont2.end() );
-
+
                 return result;
             }
 
@@ -68,20 +68,19 @@
                 operator()(Policy& policy, Container& cont)
                 {
                     typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
-
+
                     const Container old_cont(cont);
                     Container cont2(old_cont);
                     result_t result = boost::partition<return_type>(cont, policy.pred());
-
- result_t temp_result = boost::partition<return_type>(
- cont2, policy.pred());
- cont2 = old_cont;
- BOOST_CHECK( temp_result == boost::partition<return_type>(
- boost::make_iterator_range(cont2), policy.pred()) );
-
+
+ // Test that operation a temporary created by using
+ // make_iterator_range.
+ boost::partition<return_type>(
+ boost::make_iterator_range(cont2), policy.pred());
+
                     BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
                                                    cont2.begin(), cont2.end() );
-
+
                     return result;
                 }
             };


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk