Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67602 - trunk/libs/range/test/algorithm_test
From: neil_at_[hidden]
Date: 2011-01-02 20:33:07


Author: neilgroves
Date: 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
New Revision: 67602
URL: http://svn.boost.org/trac/boost/changeset/67602

Log:
[boost][range] - Improved the tests by implementing outside of the boost namespace to better simulate real world usage.
Text files modified:
   trunk/libs/range/test/algorithm_test/find.cpp | 123 ++++++++---------
   trunk/libs/range/test/algorithm_test/find_end.cpp | 277 +++++++++++++++++++--------------------
   trunk/libs/range/test/algorithm_test/find_first_of.cpp | 273 +++++++++++++++++++-------------------
   trunk/libs/range/test/algorithm_test/find_if.cpp | 147 ++++++++++----------
   trunk/libs/range/test/algorithm_test/lower_bound.cpp | 244 +++++++++++++++++-----------------
   trunk/libs/range/test/algorithm_test/max_element.cpp | 203 ++++++++++++++--------------
   trunk/libs/range/test/algorithm_test/min_element.cpp | 201 ++++++++++++++--------------
   trunk/libs/range/test/algorithm_test/partition.cpp | 153 ++++++++++-----------
   trunk/libs/range/test/algorithm_test/stable_partition.cpp | 158 +++++++++++-----------
   trunk/libs/range/test/algorithm_test/unique.cpp | 247 +++++++++++++++++------------------
   trunk/libs/range/test/algorithm_test/upper_bound.cpp | 225 ++++++++++++++++----------------
   11 files changed, 1108 insertions(+), 1143 deletions(-)

Modified: trunk/libs/range/test/algorithm_test/find.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/find.cpp (original)
+++ trunk/libs/range/test/algorithm_test/find.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -22,85 +22,82 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_find
 {
- namespace
+ class find_test_policy
     {
- class find_test_policy
+ public:
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::find(cont, 3);
+ iter_t result2 = boost::find(boost::make_iterator_range(cont), 3);
+ BOOST_CHECK( result == result2 );
+ return result;
+ }
+
+ template<boost::range_return_value return_type>
+ struct test_range
         {
- public:
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy&, Container& cont)
             {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::find(cont, 3);
- iter_t result2 = boost::find(boost::make_iterator_range(cont), 3);
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::find<return_type>(cont, 3);
+ result_t result2 = boost::find<return_type>(boost::make_iterator_range(cont), 3);
                 BOOST_CHECK( result == result2 );
                 return result;
             }
-
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy&, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::find<return_type>(cont, 3);
- result_t result2 = boost::find<return_type>(boost::make_iterator_range(cont), 3);
- BOOST_CHECK( result == result2 );
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::find(cont.begin(), cont.end(), 3);
- }
         };
 
         template<class Container>
- void test_find_container()
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::find(cont.begin(), cont.end(), 3);
+ }
+ };
 
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container>::type container_t;
+ template<class Container>
+ void test_find_container()
+ {
+ using namespace boost::assign;
 
- range_test::range_return_test_driver test_driver;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
 
- container_t mcont;
- Container& cont = mcont;
- test_driver(cont, find_test_policy());
+ boost::range_test::range_return_test_driver test_driver;
 
- mcont.clear();
- mcont += 1;
- test_driver(cont, find_test_policy());
+ container_t mcont;
+ Container& cont = mcont;
+ test_driver(cont, find_test_policy());
 
- mcont.clear();
- mcont += 1,2,3,4,5,6,7,8,9;
- test_driver(cont, find_test_policy());
- }
+ mcont.clear();
+ mcont += 1;
+ test_driver(cont, find_test_policy());
 
- void test_find()
- {
- test_find_container< std::vector<int> >();
- test_find_container< std::list<int> >();
- test_find_container< std::deque<int> >();
-
- test_find_container< const std::vector<int> >();
- test_find_container< const std::list<int> >();
- test_find_container< const std::deque<int> >();
-
- std::vector<int> vi;
- const std::vector<int>& cvi = vi;
- std::vector<int>::const_iterator it = boost::find(vi, 0);
- std::vector<int>::const_iterator it2 = boost::find(cvi, 0);
- BOOST_CHECK( it == it2 );
- }
+ mcont.clear();
+ mcont += 1,2,3,4,5,6,7,8,9;
+ test_driver(cont, find_test_policy());
+ }
+
+ void test_find()
+ {
+ test_find_container< std::vector<int> >();
+ test_find_container< std::list<int> >();
+ test_find_container< std::deque<int> >();
+
+ test_find_container< const std::vector<int> >();
+ test_find_container< const std::list<int> >();
+ test_find_container< const std::deque<int> >();
+
+ std::vector<int> vi;
+ const std::vector<int>& cvi = vi;
+ std::vector<int>::const_iterator it = boost::find(vi, 0);
+ std::vector<int>::const_iterator it2 = boost::find(cvi, 0);
+ BOOST_CHECK( it == it2 );
     }
 }
 
@@ -110,7 +107,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.find" );
 
- test->add( BOOST_TEST_CASE( &boost::test_find ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_find::test_find ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/find_end.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/find_end.cpp (original)
+++ trunk/libs/range/test/algorithm_test/find_end.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -21,173 +21,170 @@
 #include <set>
 #include <list>
 
-namespace boost
+namespace boost_range_test_algorithm_find_end
 {
- namespace
+ template<class Container2>
+ class find_end_test_policy
     {
- template<class Container2>
- class find_end_test_policy
+ typedef Container2 container2_t;
+ public:
+ explicit find_end_test_policy(const Container2& cont)
+ : m_cont(cont)
         {
- typedef Container2 container2_t;
- public:
- explicit find_end_test_policy(const Container2& cont)
- : m_cont(cont)
- {
- }
+ }
 
- container2_t cont() { return m_cont; }
+ container2_t cont() { return m_cont; }
 
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::find_end(cont, m_cont);
- BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), m_cont) );
- BOOST_CHECK( result == boost::find_end(cont, boost::make_iterator_range(m_cont)) );
- BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont)) );
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::find_end(cont, m_cont);
+ BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), m_cont) );
+ BOOST_CHECK( result == boost::find_end(cont, boost::make_iterator_range(m_cont)) );
+ BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont)) );
+ return result;
+ }
+
+ template<boost::range_return_value return_type>
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::find_end<return_type>(cont, policy.cont());
+ BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont), policy.cont()) );
+ BOOST_CHECK( result == boost::find_end<return_type>(cont, boost::make_iterator_range(policy.cont())) );
+ BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont),
+ boost::make_iterator_range(policy.cont())) );
                 return result;
             }
+ };
 
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::find_end<return_type>(cont, policy.cont());
- BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont), policy.cont()) );
- BOOST_CHECK( result == boost::find_end<return_type>(cont, boost::make_iterator_range(policy.cont())) );
- BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont),
- boost::make_iterator_range(policy.cont())) );
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::find_end(cont.begin(), cont.end(),
- m_cont.begin(), m_cont.end());
- }
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
+ {
+ return std::find_end(cont.begin(), cont.end(),
+ m_cont.begin(), m_cont.end());
+ }
 
- private:
- Container2 m_cont;
- };
+ private:
+ Container2 m_cont;
+ };
 
- template<class Container2, class BinaryPredicate>
- class find_end_pred_test_policy
+ template<class Container2, class BinaryPredicate>
+ class find_end_pred_test_policy
+ {
+ typedef Container2 container2_t;
+ public:
+ explicit find_end_pred_test_policy(const Container2& cont)
+ : m_cont(cont)
         {
- typedef Container2 container2_t;
- public:
- explicit find_end_pred_test_policy(const Container2& cont)
- : m_cont(cont)
- {
- }
+ }
 
- container2_t& cont() { return m_cont; }
- BinaryPredicate& pred() { return m_pred; }
+ container2_t& cont() { return m_cont; }
+ BinaryPredicate& pred() { return m_pred; }
 
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t it = boost::find_end(cont, m_cont, m_pred);
- BOOST_CHECK( it == boost::find_end(boost::make_iterator_range(cont), m_cont, m_pred) );
- BOOST_CHECK( it == boost::find_end(cont, boost::make_iterator_range(m_cont), m_pred) );
- BOOST_CHECK( it == boost::find_end(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont), m_pred) );
- return it;
- }
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t it = boost::find_end(cont, m_cont, m_pred);
+ BOOST_CHECK( it == boost::find_end(boost::make_iterator_range(cont), m_cont, m_pred) );
+ BOOST_CHECK( it == boost::find_end(cont, boost::make_iterator_range(m_cont), m_pred) );
+ BOOST_CHECK( it == boost::find_end(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont), m_pred) );
+ return it;
+ }
 
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::find_end<return_type>(cont, policy.cont(), policy.pred());
- BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont), policy.cont(), policy.pred()) );
- BOOST_CHECK( result == boost::find_end<return_type>(cont, boost::make_iterator_range(policy.cont()), policy.pred()) );
- BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont),
- boost::make_iterator_range(policy.cont()), policy.pred()) );
- return boost::find_end<return_type>(cont, policy.cont(), policy.pred());
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::find_end(cont.begin(), cont.end(),
- m_cont.begin(), m_cont.end(),
- m_pred);
+ template<boost::range_return_value return_type>
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::find_end<return_type>(cont, policy.cont(), policy.pred());
+ BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont), policy.cont(), policy.pred()) );
+ BOOST_CHECK( result == boost::find_end<return_type>(cont, boost::make_iterator_range(policy.cont()), policy.pred()) );
+ BOOST_CHECK( result == boost::find_end<return_type>(boost::make_iterator_range(cont),
+ boost::make_iterator_range(policy.cont()), policy.pred()) );
+ return boost::find_end<return_type>(cont, policy.cont(), policy.pred());
             }
-
- private:
- Container2 m_cont;
- BinaryPredicate m_pred;
         };
 
- template<class Container1, class Container2>
- void run_tests(Container1& cont1, Container2& cont2)
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- range_test::range_return_test_driver test_driver;
- test_driver(cont1, find_end_test_policy<Container2>(cont2));
- test_driver(cont1, find_end_pred_test_policy<Container2, std::less<int> >(cont2));
- test_driver(cont2, find_end_pred_test_policy<Container2, std::greater<int> >(cont2));
+ return std::find_end(cont.begin(), cont.end(),
+ m_cont.begin(), m_cont.end(),
+ m_pred);
         }
 
- template<class Container1, class Container2>
- void test_find_end_impl()
- {
- using namespace boost::assign;
+ private:
+ Container2 m_cont;
+ BinaryPredicate m_pred;
+ };
 
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container1>::type container1_t;
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container2>::type container2_t;
+ template<class Container1, class Container2>
+ void run_tests(Container1& cont1, Container2& cont2)
+ {
+ boost::range_test::range_return_test_driver test_driver;
+ test_driver(cont1, find_end_test_policy<Container2>(cont2));
+ test_driver(cont1, find_end_pred_test_policy<Container2, std::less<int> >(cont2));
+ test_driver(cont2, find_end_pred_test_policy<Container2, std::greater<int> >(cont2));
+ }
 
- container1_t mcont1;
- Container1& cont1 = mcont1;
- container2_t mcont2;
- Container2& cont2 = mcont2;
+ template<class Container1, class Container2>
+ void test_find_end_impl()
+ {
+ using namespace boost::assign;
 
- run_tests(cont1, cont2);
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container1>::type container1_t;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container2>::type container2_t;
 
- mcont1 += 1;
- run_tests(cont1, cont2);
+ container1_t mcont1;
+ Container1& cont1 = mcont1;
+ container2_t mcont2;
+ Container2& cont2 = mcont2;
 
- mcont2 += 1;
- run_tests(cont1, cont2);
+ run_tests(cont1, cont2);
 
- mcont1 += 2,3,4,5,6,7,8,9;
- mcont2 += 2,3,4;
- run_tests(cont1, cont2);
+ mcont1 += 1;
+ run_tests(cont1, cont2);
 
- mcont2.clear();
- mcont2 += 7,8,9;
- run_tests(cont1, cont2);
- }
+ mcont2 += 1;
+ run_tests(cont1, cont2);
 
- void test_find_end()
- {
- test_find_end_impl< std::vector<int>, std::vector<int> >();
- test_find_end_impl< std::list<int>, std::list<int> >();
- test_find_end_impl< std::deque<int>, std::deque<int> >();
- test_find_end_impl< const std::vector<int>, const std::vector<int> >();
- test_find_end_impl< const std::list<int>, const std::list<int> >();
- test_find_end_impl< const std::deque<int>, const std::deque<int> >();
- test_find_end_impl< const std::vector<int>, const std::list<int> >();
- test_find_end_impl< const std::list<int>, const std::vector<int> >();
- test_find_end_impl< const std::vector<int>, std::list<int> >();
- test_find_end_impl< const std::list<int>, std::vector<int> >();
- test_find_end_impl< std::vector<int>, std::list<int> >();
- test_find_end_impl< std::list<int>, std::vector<int> >();
- }
+ mcont1 += 2,3,4,5,6,7,8,9;
+ mcont2 += 2,3,4;
+ run_tests(cont1, cont2);
+
+ mcont2.clear();
+ mcont2 += 7,8,9;
+ run_tests(cont1, cont2);
+ }
+
+ void test_find_end()
+ {
+ test_find_end_impl< std::vector<int>, std::vector<int> >();
+ test_find_end_impl< std::list<int>, std::list<int> >();
+ test_find_end_impl< std::deque<int>, std::deque<int> >();
+ test_find_end_impl< const std::vector<int>, const std::vector<int> >();
+ test_find_end_impl< const std::list<int>, const std::list<int> >();
+ test_find_end_impl< const std::deque<int>, const std::deque<int> >();
+ test_find_end_impl< const std::vector<int>, const std::list<int> >();
+ test_find_end_impl< const std::list<int>, const std::vector<int> >();
+ test_find_end_impl< const std::vector<int>, std::list<int> >();
+ test_find_end_impl< const std::list<int>, std::vector<int> >();
+ test_find_end_impl< std::vector<int>, std::list<int> >();
+ test_find_end_impl< std::list<int>, std::vector<int> >();
     }
 }
 
@@ -197,7 +194,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.find_end" );
 
- test->add( BOOST_TEST_CASE( &boost::test_find_end ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_find_end::test_find_end ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/find_first_of.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/find_first_of.cpp (original)
+++ trunk/libs/range/test/algorithm_test/find_first_of.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -21,171 +21,168 @@
 #include <set>
 #include <list>
 
-namespace boost
+namespace boost_range_test_algorithm_find_first_of
 {
- namespace
+ template<class Container2>
+ class find_first_of_test_policy
     {
- template<class Container2>
- class find_first_of_test_policy
+ typedef Container2 container2_t;
+ public:
+ explicit find_first_of_test_policy(const Container2& cont)
+ : m_cont(cont)
         {
- typedef Container2 container2_t;
- public:
- explicit find_first_of_test_policy(const Container2& cont)
- : m_cont(cont)
- {
- }
+ }
 
- container2_t& cont() { return m_cont; }
+ container2_t& cont() { return m_cont; }
 
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::find_first_of(cont, m_cont);
- BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), m_cont) );
- BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(m_cont)) );
- BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont)) );
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::find_first_of(cont, m_cont);
+ BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), m_cont) );
+ BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(m_cont)) );
+ BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont)) );
+ return result;
+ }
+
+ template<boost::range_return_value return_type>
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::find_first_of<return_type>(cont, policy.cont());
+ BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), policy.cont()) );
+ BOOST_CHECK( result == boost::find_first_of<return_type>(cont, boost::make_iterator_range(policy.cont())) );
+ BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), boost::make_iterator_range(policy.cont())) );
                 return result;
             }
+ };
 
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::find_first_of<return_type>(cont, policy.cont());
- BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), policy.cont()) );
- BOOST_CHECK( result == boost::find_first_of<return_type>(cont, boost::make_iterator_range(policy.cont())) );
- BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), boost::make_iterator_range(policy.cont())) );
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::find_first_of(cont.begin(), cont.end(),
- m_cont.begin(), m_cont.end());
- }
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
+ {
+ return std::find_first_of(cont.begin(), cont.end(),
+ m_cont.begin(), m_cont.end());
+ }
 
- private:
- Container2 m_cont;
- };
+ private:
+ Container2 m_cont;
+ };
 
- template<class Container2, class BinaryPredicate>
- class find_first_of_pred_test_policy
+ template<class Container2, class BinaryPredicate>
+ class find_first_of_pred_test_policy
+ {
+ typedef Container2 container2_t;
+ public:
+ explicit find_first_of_pred_test_policy(const Container2& cont)
+ : m_cont(cont)
         {
- typedef Container2 container2_t;
- public:
- explicit find_first_of_pred_test_policy(const Container2& cont)
- : m_cont(cont)
- {
- }
+ }
 
- container2_t& cont() { return m_cont; }
- BinaryPredicate& pred() { return m_pred; }
+ container2_t& cont() { return m_cont; }
+ BinaryPredicate& pred() { return m_pred; }
 
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::find_first_of(cont, m_cont, m_pred);
- BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), m_cont, m_pred) );
- BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(m_cont), m_pred) );
- BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont), m_pred) );
- return result;
- }
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::find_first_of(cont, m_cont, m_pred);
+ BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), m_cont, m_pred) );
+ BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(m_cont), m_pred) );
+ BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont), m_pred) );
+ return result;
+ }
 
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::find_first_of<return_type>(cont, policy.cont(), policy.pred());
- BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), policy.cont(), policy.pred()) );
- BOOST_CHECK( result == boost::find_first_of<return_type>(cont, boost::make_iterator_range(policy.cont()), policy.pred()) );
- BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), boost::make_iterator_range(policy.cont()), policy.pred()) );
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::find_first_of(cont.begin(), cont.end(),
- m_cont.begin(), m_cont.end(),
- m_pred);
+ template<boost::range_return_value return_type>
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::find_first_of<return_type>(cont, policy.cont(), policy.pred());
+ BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), policy.cont(), policy.pred()) );
+ BOOST_CHECK( result == boost::find_first_of<return_type>(cont, boost::make_iterator_range(policy.cont()), policy.pred()) );
+ BOOST_CHECK( result == boost::find_first_of<return_type>(boost::make_iterator_range(cont), boost::make_iterator_range(policy.cont()), policy.pred()) );
+ return result;
             }
-
- private:
- Container2 m_cont;
- BinaryPredicate m_pred;
         };
 
- template<class Container1, class Container2>
- void run_tests(Container1& cont1, Container2& cont2)
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- range_test::range_return_test_driver test_driver;
- test_driver(cont1, find_first_of_test_policy<Container2>(cont2));
- test_driver(cont1, find_first_of_pred_test_policy<Container2, std::less<int> >(cont2));
- test_driver(cont2, find_first_of_pred_test_policy<Container2, std::greater<int> >(cont2));
+ return std::find_first_of(cont.begin(), cont.end(),
+ m_cont.begin(), m_cont.end(),
+ m_pred);
         }
 
- template<class Container1, class Container2>
- void test_find_first_of_impl()
- {
- using namespace boost::assign;
+ private:
+ Container2 m_cont;
+ BinaryPredicate m_pred;
+ };
 
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container1>::type container1_t;
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container2>::type container2_t;
+ template<class Container1, class Container2>
+ void run_tests(Container1& cont1, Container2& cont2)
+ {
+ boost::range_test::range_return_test_driver test_driver;
+ test_driver(cont1, find_first_of_test_policy<Container2>(cont2));
+ test_driver(cont1, find_first_of_pred_test_policy<Container2, std::less<int> >(cont2));
+ test_driver(cont2, find_first_of_pred_test_policy<Container2, std::greater<int> >(cont2));
+ }
 
- container1_t mcont1;
- Container1& cont1 = mcont1;
- container2_t mcont2;
- Container2& cont2 = mcont2;
+ template<class Container1, class Container2>
+ void test_find_first_of_impl()
+ {
+ using namespace boost::assign;
 
- run_tests(cont1, cont2);
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container1>::type container1_t;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container2>::type container2_t;
 
- mcont1 += 1;
- run_tests(cont1, cont2);
+ container1_t mcont1;
+ Container1& cont1 = mcont1;
+ container2_t mcont2;
+ Container2& cont2 = mcont2;
 
- mcont2 += 1;
- run_tests(cont1, cont2);
+ run_tests(cont1, cont2);
 
- mcont1 += 2,3,4,5,6,7,8,9;
- mcont2 += 2,3,4;
- run_tests(cont1, cont2);
+ mcont1 += 1;
+ run_tests(cont1, cont2);
 
- mcont2.clear();
- mcont2 += 7,8,9;
- run_tests(cont1, cont2);
- }
+ mcont2 += 1;
+ run_tests(cont1, cont2);
 
- void test_find_first_of()
- {
- test_find_first_of_impl< std::vector<int>, std::vector<int> >();
- test_find_first_of_impl< std::list<int>, std::list<int> >();
- test_find_first_of_impl< std::deque<int>, std::deque<int> >();
- test_find_first_of_impl< const std::vector<int>, const std::vector<int> >();
- test_find_first_of_impl< const std::list<int>, const std::list<int> >();
- test_find_first_of_impl< const std::deque<int>, const std::deque<int> >();
- test_find_first_of_impl< const std::vector<int>, const std::list<int> >();
- test_find_first_of_impl< const std::list<int>, const std::vector<int> >();
- test_find_first_of_impl< const std::vector<int>, std::list<int> >();
- test_find_first_of_impl< const std::list<int>, std::vector<int> >();
- test_find_first_of_impl< std::vector<int>, std::list<int> >();
- test_find_first_of_impl< std::list<int>, std::vector<int> >();
- }
+ mcont1 += 2,3,4,5,6,7,8,9;
+ mcont2 += 2,3,4;
+ run_tests(cont1, cont2);
+
+ mcont2.clear();
+ mcont2 += 7,8,9;
+ run_tests(cont1, cont2);
+ }
+
+ void test_find_first_of()
+ {
+ test_find_first_of_impl< std::vector<int>, std::vector<int> >();
+ test_find_first_of_impl< std::list<int>, std::list<int> >();
+ test_find_first_of_impl< std::deque<int>, std::deque<int> >();
+ test_find_first_of_impl< const std::vector<int>, const std::vector<int> >();
+ test_find_first_of_impl< const std::list<int>, const std::list<int> >();
+ test_find_first_of_impl< const std::deque<int>, const std::deque<int> >();
+ test_find_first_of_impl< const std::vector<int>, const std::list<int> >();
+ test_find_first_of_impl< const std::list<int>, const std::vector<int> >();
+ test_find_first_of_impl< const std::vector<int>, std::list<int> >();
+ test_find_first_of_impl< const std::list<int>, std::vector<int> >();
+ test_find_first_of_impl< std::vector<int>, std::list<int> >();
+ test_find_first_of_impl< std::list<int>, std::vector<int> >();
     }
 }
 
@@ -195,7 +192,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.find_first_of" );
 
- test->add( BOOST_TEST_CASE( &boost::test_find_first_of ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_find_first_of::test_find_first_of ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/find_if.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/find_if.cpp (original)
+++ trunk/libs/range/test/algorithm_test/find_if.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -23,97 +23,94 @@
 #include <list>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_find_if
 {
- namespace
+ template<class UnaryPredicate>
+ class find_if_test_policy
     {
- template<class UnaryPredicate>
- class find_if_test_policy
+ public:
+ explicit find_if_test_policy(UnaryPredicate pred)
+ : m_pred(pred) {}
+
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- public:
- explicit find_if_test_policy(UnaryPredicate pred)
- : m_pred(pred) {}
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::find_if(cont, m_pred);
+ BOOST_CHECK( result == boost::find_if(boost::make_iterator_range(cont), m_pred) );
+ return result;
+ }
 
+ template<boost::range_return_value return_type>
+ struct test_range
+ {
             template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(find_if_test_policy& policy, Container& cont)
             {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::find_if(cont, m_pred);
- BOOST_CHECK( result == boost::find_if(boost::make_iterator_range(cont), m_pred) );
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::find_if<return_type>(cont, policy.pred());
+ BOOST_CHECK( result == boost::find_if<return_type>(boost::make_iterator_range(cont), policy.pred()) );
                 return result;
             }
-
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(find_if_test_policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::find_if<return_type>(cont, policy.pred());
- BOOST_CHECK( result == boost::find_if<return_type>(boost::make_iterator_range(cont), policy.pred()) );
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::find_if(cont.begin(), cont.end(), m_pred);
- }
-
- UnaryPredicate& pred() { return m_pred; }
-
- private:
- UnaryPredicate m_pred;
         };
 
- template<class UnaryPredicate>
- find_if_test_policy<UnaryPredicate>
- make_policy(UnaryPredicate pred)
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- return find_if_test_policy<UnaryPredicate>(pred);
+ return std::find_if(cont.begin(), cont.end(), m_pred);
         }
 
- template<class Container>
- void test_find_if_container()
- {
- using namespace boost::assign;
- using namespace boost::range_test_function;
+ UnaryPredicate& pred() { return m_pred; }
 
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container>::type container_t;
+ private:
+ UnaryPredicate m_pred;
+ };
+
+ template<class UnaryPredicate>
+ find_if_test_policy<UnaryPredicate>
+ make_policy(UnaryPredicate pred)
+ {
+ return find_if_test_policy<UnaryPredicate>(pred);
+ }
 
- range_test::range_return_test_driver test_driver;
+ template<class Container>
+ void test_find_if_container()
+ {
+ using namespace boost::assign;
+ using namespace boost::range_test_function;
 
- container_t mcont;
- Container& cont = mcont;
- test_driver(cont, make_policy(greater_than_x<int>(5)));
- test_driver(cont, make_policy(false_predicate()));
-
- mcont.clear();
- mcont += 1;
- test_driver(cont, make_policy(greater_than_x<int>(5)));
- test_driver(cont, make_policy(false_predicate()));
-
- mcont.clear();
- mcont += 1,2,3,4,5,6,7,8,9;
- test_driver(cont, make_policy(greater_than_x<int>(5)));
- test_driver(cont, make_policy(false_predicate()));
- }
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
 
- void test_find_if()
- {
- test_find_if_container< std::vector<int> >();
- test_find_if_container< std::list<int> >();
- test_find_if_container< std::deque<int> >();
-
- test_find_if_container< const std::vector<int> >();
- test_find_if_container< const std::list<int> >();
- test_find_if_container< const std::deque<int> >();
- }
+ boost::range_test::range_return_test_driver test_driver;
+
+ container_t mcont;
+ Container& cont = mcont;
+ test_driver(cont, make_policy(greater_than_x<int>(5)));
+ test_driver(cont, make_policy(false_predicate()));
+
+ mcont.clear();
+ mcont += 1;
+ test_driver(cont, make_policy(greater_than_x<int>(5)));
+ test_driver(cont, make_policy(false_predicate()));
+
+ mcont.clear();
+ mcont += 1,2,3,4,5,6,7,8,9;
+ test_driver(cont, make_policy(greater_than_x<int>(5)));
+ test_driver(cont, make_policy(false_predicate()));
+ }
+
+ void test_find_if()
+ {
+ test_find_if_container< std::vector<int> >();
+ test_find_if_container< std::list<int> >();
+ test_find_if_container< std::deque<int> >();
+
+ test_find_if_container< const std::vector<int> >();
+ test_find_if_container< const std::list<int> >();
+ test_find_if_container< const std::deque<int> >();
     }
 }
 
@@ -123,7 +120,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.find_if" );
 
- test->add( BOOST_TEST_CASE( &boost::test_find_if ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_find_if::test_find_if ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/lower_bound.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/lower_bound.cpp (original)
+++ trunk/libs/range/test/algorithm_test/lower_bound.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -22,156 +22,152 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_lower_bound
 {
- namespace
+ class lower_bound_policy
     {
- class lower_bound_policy
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::lower_bound(cont, 5);
- BOOST_CHECK( result == boost::lower_bound(boost::make_iterator_range(cont), 5) );
- return result;
- }
-
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy&, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::lower_bound<return_type>(cont, 5);
- BOOST_CHECK( result == boost::lower_bound<return_type>(boost::make_iterator_range(cont), 5) );
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::lower_bound(cont.begin(), cont.end(), 5);
- }
- };
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::lower_bound(cont, 5);
+ BOOST_CHECK( result == boost::lower_bound(boost::make_iterator_range(cont), 5) );
+ return result;
+ }
 
- template< class BinaryPredicate >
- struct lower_bound_pred_policy
+ template<boost::range_return_value return_type>
+ struct test_range
         {
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::lower_bound(cont, 5, m_pred);
- BOOST_CHECK( result == boost::lower_bound(
- boost::make_iterator_range(cont), 5, m_pred) );
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy&, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::lower_bound<return_type>(cont, 5);
+ BOOST_CHECK( result == boost::lower_bound<return_type>(boost::make_iterator_range(cont), 5) );
                 return result;
             }
+ };
 
- template< range_return_value return_type >
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::lower_bound<return_type>(cont, 5, policy.pred());
- BOOST_CHECK( result == boost::lower_bound<return_type>(
- boost::make_iterator_range(cont), 5, policy.pred()) );
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::lower_bound(
- cont.begin(), cont.end(), 5, m_pred);
- }
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
+ {
+ return std::lower_bound(cont.begin(), cont.end(), 5);
+ }
+ };
 
- BinaryPredicate& pred() { return m_pred; }
+ template< class BinaryPredicate >
+ struct lower_bound_pred_policy
+ {
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::lower_bound(cont, 5, m_pred);
+ BOOST_CHECK( result == boost::lower_bound(
+ boost::make_iterator_range(cont), 5, m_pred) );
+ return result;
+ }
 
- private:
- BinaryPredicate m_pred;
+ template< boost::range_return_value return_type >
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::lower_bound<return_type>(cont, 5, policy.pred());
+ BOOST_CHECK( result == boost::lower_bound<return_type>(
+ boost::make_iterator_range(cont), 5, policy.pred()) );
+ return result;
+ }
         };
 
- template<class Container,
- class TestPolicy,
- class BinaryPredicate>
- void test_lower_bound_impl(TestPolicy policy, BinaryPredicate pred)
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::lower_bound(
+ cont.begin(), cont.end(), 5, m_pred);
+ }
 
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container>::type container_t;
- typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
+ BinaryPredicate& pred() { return m_pred; }
 
- range_test::range_return_test_driver test_driver;
+ private:
+ BinaryPredicate m_pred;
+ };
+
+ template<class Container,
+ class TestPolicy,
+ class BinaryPredicate>
+ void test_lower_bound_impl(TestPolicy policy, BinaryPredicate pred)
+ {
+ using namespace boost::assign;
 
- container_t mcont;
- Container& cont = mcont;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
+ typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
 
- test_driver(cont, policy);
+ boost::range_test::range_return_test_driver test_driver;
 
- mcont.clear();
- mcont += 1;
+ container_t mcont;
+ Container& cont = mcont;
 
- std::vector<value_t> temp(mcont.begin(), mcont.end());
- std::sort(temp.begin(), temp.end(), pred);
- mcont.assign(temp.begin(), temp.end());
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
+ mcont.clear();
+ mcont += 1;
 
- mcont.clear();
- mcont += 1,2,3,4,5,6,7,8,9;
+ std::vector<value_t> temp(mcont.begin(), mcont.end());
+ std::sort(temp.begin(), temp.end(), pred);
+ mcont.assign(temp.begin(), temp.end());
 
- temp.assign(mcont.begin(), mcont.end());
- std::sort(temp.begin(), temp.end(), pred);
- mcont.assign(temp.begin(), temp.end());
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
- }
+ mcont.clear();
+ mcont += 1,2,3,4,5,6,7,8,9;
 
- template<class Container>
- void test_lower_bound_impl()
- {
- test_lower_bound_impl<Container>(
- lower_bound_policy(),
- std::less<int>()
- );
-
- test_lower_bound_impl<Container>(
- lower_bound_pred_policy<std::less<int> >(),
- std::less<int>()
- );
-
- test_lower_bound_impl<Container>(
- lower_bound_pred_policy<std::greater<int> >(),
- std::greater<int>()
- );
- }
+ temp.assign(mcont.begin(), mcont.end());
+ std::sort(temp.begin(), temp.end(), pred);
+ mcont.assign(temp.begin(), temp.end());
 
- void test_lower_bound()
- {
- test_lower_bound_impl< std::vector<int> >();
- test_lower_bound_impl< std::list<int> >();
- test_lower_bound_impl< std::deque<int> >();
-
- test_lower_bound_impl< const std::vector<int> >();
- test_lower_bound_impl< const std::list<int> >();
- test_lower_bound_impl< const std::deque<int> >();
- }
+ test_driver(cont, policy);
     }
-}
 
+ template<class Container>
+ void test_lower_bound_impl()
+ {
+ test_lower_bound_impl<Container>(
+ lower_bound_policy(),
+ std::less<int>()
+ );
+
+ test_lower_bound_impl<Container>(
+ lower_bound_pred_policy<std::less<int> >(),
+ std::less<int>()
+ );
+
+ test_lower_bound_impl<Container>(
+ lower_bound_pred_policy<std::greater<int> >(),
+ std::greater<int>()
+ );
+ }
+
+ void test_lower_bound()
+ {
+ test_lower_bound_impl< std::vector<int> >();
+ test_lower_bound_impl< std::list<int> >();
+ test_lower_bound_impl< std::deque<int> >();
+
+ test_lower_bound_impl< const std::vector<int> >();
+ test_lower_bound_impl< const std::list<int> >();
+ test_lower_bound_impl< const std::deque<int> >();
+ }
+}
 
 boost::unit_test::test_suite*
 init_unit_test_suite(int argc, char* argv[])
@@ -179,7 +175,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.lower_bound" );
 
- test->add( BOOST_TEST_CASE( &boost::test_lower_bound ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_lower_bound::test_lower_bound ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/max_element.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/max_element.cpp (original)
+++ trunk/libs/range/test/algorithm_test/max_element.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -22,134 +22,131 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_max_element
 {
- namespace
+ class max_element_test_policy
     {
- class max_element_test_policy
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::max_element(cont);
- BOOST_CHECK( result == boost::max_element(
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::max_element(cont);
+ BOOST_CHECK( result == boost::max_element(
+ boost::make_iterator_range(cont)) );
+ return result;
+ }
+
+ template<boost::range_return_value return_type>
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy&, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::max_element<return_type>(cont);
+ BOOST_CHECK( result == boost::max_element<return_type>(
                                             boost::make_iterator_range(cont)) );
                 return result;
             }
-
- template<range_return_value return_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy&, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::max_element<return_type>(cont);
- BOOST_CHECK( result == boost::max_element<return_type>(
- boost::make_iterator_range(cont)) );
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::max_element(cont.begin(), cont.end());
- }
         };
 
- template<class Pred>
- class max_element_pred_test_policy
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::max_element(cont, Pred());
- BOOST_CHECK( result == boost::max_element(
- boost::make_iterator_range(cont), Pred()) );
- return result;
- }
+ return std::max_element(cont.begin(), cont.end());
+ }
+ };
 
- Pred pred() const { return Pred(); }
+ template<class Pred>
+ class max_element_pred_test_policy
+ {
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::max_element(cont, Pred());
+ BOOST_CHECK( result == boost::max_element(
+ boost::make_iterator_range(cont), Pred()) );
+ return result;
+ }
 
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::max_element<return_type>(cont, policy.pred());
- BOOST_CHECK( result == boost::max_element<return_type>(
- boost::make_iterator_range(cont), policy.pred()) );
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::max_element(cont.begin(), cont.end(), Pred());
+ Pred pred() const { return Pred(); }
+
+ template< boost::range_return_value return_type >
+ struct test_range
+ {
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::max_element<return_type>(cont, policy.pred());
+ BOOST_CHECK( result == boost::max_element<return_type>(
+ boost::make_iterator_range(cont), policy.pred()) );
+ return result;
             }
         };
 
- template<class Container, class TestPolicy>
- void test_max_element_impl(TestPolicy policy)
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::max_element(cont.begin(), cont.end(), Pred());
+ }
+ };
 
- typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container>::type container_t;
+ template<class Container, class TestPolicy>
+ void test_max_element_impl(TestPolicy policy)
+ {
+ using namespace boost::assign;
 
- range_test::range_return_test_driver test_driver;
+ typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
 
- container_t cont;
+ boost::range_test::range_return_test_driver test_driver;
 
- test_driver(cont, policy);
+ container_t cont;
 
- cont.clear();
- cont += 1;
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
+ cont.clear();
+ cont += 1;
 
- cont.clear();
- cont += 1,2,2,2,3,4,5,6,7,8,9;
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
- }
+ cont.clear();
+ cont += 1,2,2,2,3,4,5,6,7,8,9;
 
- template<class Container>
- void test_max_element_impl()
- {
- test_max_element_impl<Container>(max_element_test_policy());
-
- test_max_element_impl<Container>(
- max_element_pred_test_policy<std::less<int> >());
+ test_driver(cont, policy);
+ }
 
- test_max_element_impl<Container>(
- max_element_pred_test_policy<std::greater<int> >());
- }
+ template<class Container>
+ void test_max_element_impl()
+ {
+ test_max_element_impl<Container>(max_element_test_policy());
 
- void test_max_element()
- {
- test_max_element_impl< const std::vector<int> >();
- test_max_element_impl< const std::deque<int> >();
- test_max_element_impl< const std::list<int> >();
-
- test_max_element_impl< std::vector<int> >();
- test_max_element_impl< std::deque<int> >();
- test_max_element_impl< std::list<int> >();
- }
+ test_max_element_impl<Container>(
+ max_element_pred_test_policy<std::less<int> >());
+
+ test_max_element_impl<Container>(
+ max_element_pred_test_policy<std::greater<int> >());
+ }
+
+ void test_max_element()
+ {
+ test_max_element_impl< const std::vector<int> >();
+ test_max_element_impl< const std::deque<int> >();
+ test_max_element_impl< const std::list<int> >();
+
+ test_max_element_impl< std::vector<int> >();
+ test_max_element_impl< std::deque<int> >();
+ test_max_element_impl< std::list<int> >();
     }
 }
 
@@ -159,7 +156,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.max_element" );
 
- test->add( BOOST_TEST_CASE( &boost::test_max_element ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_max_element::test_max_element ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/min_element.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/min_element.cpp (original)
+++ trunk/libs/range/test/algorithm_test/min_element.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -22,132 +22,129 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_min_element
 {
- namespace
+ class min_element_test_policy
     {
- class min_element_test_policy
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::min_element(cont);
- BOOST_CHECK( result == boost::min_element(boost::make_iterator_range(cont)) );
- return result;
- }
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::min_element(cont);
+ BOOST_CHECK( result == boost::min_element(boost::make_iterator_range(cont)) );
+ return result;
+ }
 
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy&, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::min_element<return_type>(cont);
- BOOST_CHECK( result == boost::min_element<return_type>(boost::make_iterator_range(cont)) );
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::min_element(cont.begin(), cont.end());
+ template< boost::range_return_value return_type >
+ struct test_range
+ {
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy&, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::min_element<return_type>(cont);
+ BOOST_CHECK( result == boost::min_element<return_type>(boost::make_iterator_range(cont)) );
+ return result;
             }
         };
 
- template<class Pred>
- class min_element_pred_test_policy
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::min_element(cont, Pred());
- BOOST_CHECK( result == boost::min_element(
- boost::make_iterator_range(cont), Pred()) );
- return result;
- }
+ return std::min_element(cont.begin(), cont.end());
+ }
+ };
 
- Pred pred() const { return Pred(); }
+ template<class Pred>
+ class min_element_pred_test_policy
+ {
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::min_element(cont, Pred());
+ BOOST_CHECK( result == boost::min_element(
+ boost::make_iterator_range(cont), Pred()) );
+ return result;
+ }
 
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- result_t result = boost::min_element<return_type>(cont, policy.pred());
- BOOST_CHECK( result == boost::min_element<return_type>(
- boost::make_iterator_range(cont), policy.pred()) );
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::min_element(cont.begin(), cont.end(), Pred());
+ Pred pred() const { return Pred(); }
+
+ template< boost::range_return_value return_type >
+ struct test_range
+ {
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+ result_t result = boost::min_element<return_type>(cont, policy.pred());
+ BOOST_CHECK( result == boost::min_element<return_type>(
+ boost::make_iterator_range(cont), policy.pred()) );
+ return result;
             }
         };
 
- template<class Container, class TestPolicy>
- void test_min_element_impl(TestPolicy policy)
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::min_element(cont.begin(), cont.end(), Pred());
+ }
+ };
 
- typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container>::type container_t;
+ template<class Container, class TestPolicy>
+ void test_min_element_impl(TestPolicy policy)
+ {
+ using namespace boost::assign;
 
- range_test::range_return_test_driver test_driver;
+ typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
 
- container_t cont;
+ boost::range_test::range_return_test_driver test_driver;
 
- test_driver(cont, policy);
+ container_t cont;
 
- cont.clear();
- cont += 1;
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
+ cont.clear();
+ cont += 1;
 
- cont.clear();
- cont += 1,2,2,2,3,4,5,6,7,8,9;
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
- }
+ cont.clear();
+ cont += 1,2,2,2,3,4,5,6,7,8,9;
 
- template<class Container>
- void test_min_element_impl()
- {
- test_min_element_impl<Container>(min_element_test_policy());
-
- test_min_element_impl<Container>(
- min_element_pred_test_policy<std::less<int> >());
+ test_driver(cont, policy);
+ }
 
- test_min_element_impl<Container>(
- min_element_pred_test_policy<std::greater<int> >());
- }
+ template<class Container>
+ void test_min_element_impl()
+ {
+ test_min_element_impl<Container>(min_element_test_policy());
 
- void test_min_element()
- {
- test_min_element_impl< const std::vector<int> >();
- test_min_element_impl< const std::deque<int> >();
- test_min_element_impl< const std::list<int> >();
-
- test_min_element_impl< std::vector<int> >();
- test_min_element_impl< std::deque<int> >();
- test_min_element_impl< std::list<int> >();
- }
+ test_min_element_impl<Container>(
+ min_element_pred_test_policy<std::less<int> >());
+
+ test_min_element_impl<Container>(
+ min_element_pred_test_policy<std::greater<int> >());
+ }
+
+ void test_min_element()
+ {
+ test_min_element_impl< const std::vector<int> >();
+ test_min_element_impl< const std::deque<int> >();
+ test_min_element_impl< const std::list<int> >();
+
+ test_min_element_impl< std::vector<int> >();
+ test_min_element_impl< std::deque<int> >();
+ test_min_element_impl< std::list<int> >();
     }
 }
 
@@ -157,7 +154,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.min_element" );
 
- test->add( BOOST_TEST_CASE( &boost::test_min_element ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_min_element::test_min_element ) );
 
     return test;
 }

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 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -21,109 +21,106 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_partition
 {
- namespace
+ struct equal_to_5
     {
- struct equal_to_5
+ typedef bool result_type;
+ typedef int argument_type;
+ bool operator()(int x) const { return x == 5; }
+ };
+
+ // test the 'partition' algorithm
+ template<class UnaryPredicate>
+ class partition_test_policy
+ {
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- typedef bool result_type;
- typedef int argument_type;
- bool operator()(int x) const { return x == 5; }
- };
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+
+ const Container old_cont(cont);
+ Container cont2(old_cont);
+ iter_t result = boost::partition(cont, UnaryPredicate());
 
- // test the 'partition' algorithm
- template<class UnaryPredicate>
- class partition_test_policy
+ boost::partition(cont2, UnaryPredicate());
+ cont2 = old_cont;
+ boost::partition(
+ boost::make_iterator_range(cont2), UnaryPredicate());
+
+ BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
+ cont2.begin(), cont2.end() );
+
+ return result;
+ }
+
+ UnaryPredicate pred() const { return UnaryPredicate(); }
+
+ template< boost::range_return_value return_type >
+ struct test_range
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
             {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
 
                 const Container old_cont(cont);
                 Container cont2(old_cont);
- iter_t result = boost::partition(cont, UnaryPredicate());
+ result_t result = boost::partition<return_type>(cont, policy.pred());
 
- boost::partition(cont2, UnaryPredicate());
- cont2 = old_cont;
- boost::partition(
- boost::make_iterator_range(cont2), UnaryPredicate());
+ // 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;
             }
-
- UnaryPredicate pred() const { return UnaryPredicate(); }
-
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- 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());
-
- // 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;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::partition(cont.begin(), cont.end(), UnaryPredicate());
- }
         };
 
- template<class Container>
- void test_partition_impl()
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::partition(cont.begin(), cont.end(), UnaryPredicate());
+ }
+ };
 
- range_test::range_return_test_driver test_driver;
+ template<class Container>
+ void test_partition_impl()
+ {
+ using namespace boost::assign;
 
- partition_test_policy< equal_to_5 > policy;
+ boost::range_test::range_return_test_driver test_driver;
 
- Container cont;
- test_driver(cont, policy);
+ partition_test_policy< equal_to_5 > policy;
 
- cont.clear();
- cont += 1;
- test_driver(cont, policy);
+ Container cont;
+ test_driver(cont, policy);
 
- cont.clear();
- cont += 1,2,2,2,2,2,3,4,5,6,7,8,9;
- test_driver(cont, policy);
+ cont.clear();
+ cont += 1;
+ test_driver(cont, policy);
 
- cont.clear();
- cont += 1,2,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,5,6,7,8,9;
- test_driver(cont, policy);
- }
+ cont.clear();
+ cont += 1,2,2,2,2,2,3,4,5,6,7,8,9;
+ test_driver(cont, policy);
 
- void test_partition()
- {
- test_partition_impl< std::vector<int> >();
- test_partition_impl< std::list<int> >();
- test_partition_impl< std::deque<int> >();
- }
+ cont.clear();
+ cont += 1,2,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,5,6,7,8,9;
+ test_driver(cont, policy);
+ }
+
+ void test_partition()
+ {
+ test_partition_impl< std::vector<int> >();
+ test_partition_impl< std::list<int> >();
+ test_partition_impl< std::deque<int> >();
     }
 }
 
@@ -133,7 +130,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.partition" );
 
- test->add( BOOST_TEST_CASE( &boost::test_partition ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_partition::test_partition ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/stable_partition.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/stable_partition.cpp (original)
+++ trunk/libs/range/test/algorithm_test/stable_partition.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -21,108 +21,104 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_stable_partition
 {
- namespace
+ struct equal_to_5
     {
- struct equal_to_5
+ typedef bool result_type;
+ typedef int argument_type;
+ bool operator()(int x) const { return x == 5; }
+ };
+
+ // test the 'partition' algorithm
+ template<class UnaryPredicate>
+ class stable_partition_test_policy
+ {
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- typedef bool result_type;
- typedef int argument_type;
- bool operator()(int x) const { return x == 5; }
- };
+ Container cont2(cont);
+
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::stable_partition(cont, UnaryPredicate());
+
+ iter_t temp_result = boost::stable_partition(
+ boost::make_iterator_range(cont2), UnaryPredicate());
+
+ BOOST_CHECK_EQUAL( std::distance(cont.begin(), result),
+ std::distance(cont2.begin(), temp_result) );
+
+ BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
+ cont2.begin(), cont2.end() );
 
- // test the 'partition' algorithm
- template<class UnaryPredicate>
- class stable_partition_test_policy
+ return result;
+ }
+
+ UnaryPredicate pred() const { return UnaryPredicate(); }
+
+ template< boost::range_return_value return_type >
+ struct test_range
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
             {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
                 Container cont2(cont);
-
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::stable_partition(cont, UnaryPredicate());
-
- iter_t temp_result = boost::stable_partition(
- boost::make_iterator_range(cont2), UnaryPredicate());
-
- BOOST_CHECK_EQUAL( std::distance(cont.begin(), result),
- std::distance(cont2.begin(), temp_result) );
-
- BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
- cont2.begin(), cont2.end() );
-
- return result;
- }
+ result_t result = boost::stable_partition<return_type>(cont, policy.pred());
 
- UnaryPredicate pred() const { return UnaryPredicate(); }
+ result_t result2 = boost::stable_partition<return_type>(
+ boost::make_iterator_range(cont2), policy.pred());
 
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
- Container cont2(cont);
- result_t result = boost::stable_partition<return_type>(cont, policy.pred());
-
- result_t result2 = boost::stable_partition<return_type>(
- boost::make_iterator_range(cont2), policy.pred());
-
- BOOST_CHECK_EQUAL_COLLECTIONS( cont2.begin(), cont2.end(),
- cont.begin(), cont.end() );
-
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::stable_partition(cont.begin(), cont.end(), UnaryPredicate());
+ BOOST_CHECK_EQUAL_COLLECTIONS( cont2.begin(), cont2.end(),
+ cont.begin(), cont.end() );
+
+ return result;
             }
         };
 
- template<class Container>
- void test_stable_partition_impl()
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::stable_partition(cont.begin(), cont.end(), UnaryPredicate());
+ }
+ };
 
- range_test::range_return_test_driver test_driver;
+ template<class Container>
+ void test_stable_partition_impl()
+ {
+ using namespace boost::assign;
 
- stable_partition_test_policy< equal_to_5 > policy;
+ boost::range_test::range_return_test_driver test_driver;
 
- Container cont;
- test_driver(cont, policy);
+ stable_partition_test_policy< equal_to_5 > policy;
 
- cont.clear();
- cont += 1;
- test_driver(cont, policy);
+ Container cont;
+ test_driver(cont, policy);
 
- cont.clear();
- cont += 1,2,2,2,2,2,3,4,5,6,7,8,9;
- test_driver(cont, policy);
+ cont.clear();
+ cont += 1;
+ test_driver(cont, policy);
 
- cont.clear();
- cont += 1,2,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,5,6,7,8,9;
- test_driver(cont, policy);
- }
+ cont.clear();
+ cont += 1,2,2,2,2,2,3,4,5,6,7,8,9;
+ test_driver(cont, policy);
 
- void test_stable_partition()
- {
- test_stable_partition_impl< std::vector<int> >();
- test_stable_partition_impl< std::list<int> >();
- test_stable_partition_impl< std::deque<int> >();
- }
+ cont.clear();
+ cont += 1,2,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,5,6,7,8,9;
+ test_driver(cont, policy);
     }
-}
 
+ void test_stable_partition()
+ {
+ test_stable_partition_impl< std::vector<int> >();
+ test_stable_partition_impl< std::list<int> >();
+ test_stable_partition_impl< std::deque<int> >();
+ }
+}
 
 boost::unit_test::test_suite*
 init_unit_test_suite(int argc, char* argv[])
@@ -130,7 +126,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.stable_partition" );
 
- test->add( BOOST_TEST_CASE( &boost::test_stable_partition ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_stable_partition::test_stable_partition ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/unique.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/unique.cpp (original)
+++ trunk/libs/range/test/algorithm_test/unique.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -23,156 +23,153 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_unique
 {
- namespace
+ // test the 'unique' algorithm without a predicate
+ class unique_test_policy
     {
- // test the 'unique' algorithm without a predicate
- class unique_test_policy
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- // There isn't an iterator return version of boost::unique, so just
- // perform the standard algorithm
- return std::unique(cont.begin(), cont.end());
- }
+ // There isn't an iterator return version of boost::unique, so just
+ // perform the standard algorithm
+ return std::unique(cont.begin(), cont.end());
+ }
 
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy&, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
-
- Container cont2(cont);
-
- result_t result = boost::unique<return_type>(cont);
-
- boost::unique<return_type>(boost::make_iterator_range(cont2));
-
- BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
- cont2.begin(), cont2.end() );
-
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
+ template< boost::range_return_value return_type >
+ struct test_range
+ {
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy&, Container& cont)
             {
- return std::unique(cont.begin(), cont.end());
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+
+ Container cont2(cont);
+
+ result_t result = boost::unique<return_type>(cont);
+
+ boost::unique<return_type>(boost::make_iterator_range(cont2));
+
+ BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
+ cont2.begin(), cont2.end() );
+
+ return result;
             }
         };
 
- // test the 'unique' algorithm with a predicate
- template<class Pred>
- class unique_pred_test_policy
- {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- // There isn't an iterator return version of boost::unique, so just
- // perform the standard algorithm
- return std::unique(cont.begin(), cont.end(), Pred());
- }
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
+ {
+ return std::unique(cont.begin(), cont.end());
+ }
+ };
 
- Pred pred() const { return Pred(); }
+ // test the 'unique' algorithm with a predicate
+ template<class Pred>
+ class unique_pred_test_policy
+ {
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ // There isn't an iterator return version of boost::unique, so just
+ // perform the standard algorithm
+ return std::unique(cont.begin(), cont.end(), Pred());
+ }
 
- template< range_return_value return_type >
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,return_type>::type result_t;
-
- Container cont2(cont);
-
- result_t result = boost::unique<return_type>(cont, policy.pred());
-
- boost::unique<return_type>(boost::make_iterator_range(cont2), policy.pred());
-
- BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
- cont2.begin(), cont2.end() );
-
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
+ Pred pred() const { return Pred(); }
+
+ template< boost::range_return_value return_type >
+ struct test_range
+ {
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type
+ operator()(Policy& policy, Container& cont)
             {
- return std::unique(cont.begin(), cont.end(), Pred());
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,return_type>::type result_t;
+
+ Container cont2(cont);
+
+ result_t result = boost::unique<return_type>(cont, policy.pred());
+
+ boost::unique<return_type>(boost::make_iterator_range(cont2), policy.pred());
+
+ BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(),
+ cont2.begin(), cont2.end() );
+
+ return result;
             }
         };
 
- template<class Container, class TestPolicy, class Pred>
- void test_unique_impl(TestPolicy policy, Pred pred)
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::unique(cont.begin(), cont.end(), Pred());
+ }
+ };
 
- typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
+ template<class Container, class TestPolicy, class Pred>
+ void test_unique_impl(TestPolicy policy, Pred pred)
+ {
+ using namespace boost::assign;
 
- range_test::range_return_test_driver test_driver;
+ typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
 
- Container cont;
+ boost::range_test::range_return_test_driver test_driver;
 
- test_driver(cont, policy);
+ Container cont;
 
- cont.clear();
- cont += 1;
+ test_driver(cont, policy);
 
- std::vector<value_t> temp(cont.begin(), cont.end());
- std::sort(temp.begin(), temp.end(), pred);
- cont.assign(temp.begin(), temp.end());
+ cont.clear();
+ cont += 1;
 
- test_driver(cont, policy);
+ std::vector<value_t> temp(cont.begin(), cont.end());
+ std::sort(temp.begin(), temp.end(), pred);
+ cont.assign(temp.begin(), temp.end());
 
- cont.clear();
- cont += 1,2,2,2,2,3,4,5,6,7,8,9;
-
- temp.assign(cont.begin(), cont.end());
- std::sort(temp.begin(), temp.end(), pred);
- cont.assign(temp.begin(), temp.end());
+ test_driver(cont, policy);
 
- test_driver(cont, policy);
- }
+ cont.clear();
+ cont += 1,2,2,2,2,3,4,5,6,7,8,9;
 
- template<class Container>
- void test_unique_impl()
- {
- test_unique_impl<Container>(
- unique_test_policy(),
- std::less<int>()
- );
-
- test_unique_impl<Container>(
- unique_pred_test_policy<std::less<int> >(),
- std::less<int>()
- );
-
- test_unique_impl<Container>(
- unique_pred_test_policy<std::greater<int> >(),
- std::greater<int>()
- );
- }
+ temp.assign(cont.begin(), cont.end());
+ std::sort(temp.begin(), temp.end(), pred);
+ cont.assign(temp.begin(), temp.end());
 
- void test_unique()
- {
- test_unique_impl< std::vector<int> >();
- test_unique_impl< std::list<int> >();
- test_unique_impl< std::deque<int> >();
- }
+ test_driver(cont, policy);
+ }
+
+ template<class Container>
+ void test_unique_impl()
+ {
+ test_unique_impl<Container>(
+ unique_test_policy(),
+ std::less<int>()
+ );
+
+ test_unique_impl<Container>(
+ unique_pred_test_policy<std::less<int> >(),
+ std::less<int>()
+ );
+
+ test_unique_impl<Container>(
+ unique_pred_test_policy<std::greater<int> >(),
+ std::greater<int>()
+ );
+ }
+
+ void test_unique()
+ {
+ test_unique_impl< std::vector<int> >();
+ test_unique_impl< std::list<int> >();
+ test_unique_impl< std::deque<int> >();
     }
 }
 
@@ -182,7 +179,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.unique" );
 
- test->add( BOOST_TEST_CASE( &boost::test_unique ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_unique::test_unique ) );
 
     return test;
 }

Modified: trunk/libs/range/test/algorithm_test/upper_bound.cpp
==============================================================================
--- trunk/libs/range/test/algorithm_test/upper_bound.cpp (original)
+++ trunk/libs/range/test/algorithm_test/upper_bound.cpp 2011-01-02 20:33:04 EST (Sun, 02 Jan 2011)
@@ -21,144 +21,141 @@
 #include <deque>
 #include <vector>
 
-namespace boost
+namespace boost_range_test_algorithm_upper_bound
 {
- namespace
+ class upper_bound_policy
     {
- class upper_bound_policy
+ public:
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
         {
- public:
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::upper_bound(cont, 5);
- BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5) );
- return result;
- }
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::upper_bound(cont, 5);
+ BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5) );
+ return result;
+ }
 
- template<range_return_value result_type>
- struct test_range
- {
- template<class Container, class Policy>
- BOOST_DEDUCED_TYPENAME range_return<Container,result_type>::type
- operator()(Policy&, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,result_type>::type result_t;
- result_t result = boost::upper_bound<result_type>(cont, 5);
- BOOST_CHECK( result == boost::upper_bound<result_type>(boost::make_iterator_range(cont), 5) );
- return result;
- }
- };
-
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
- {
- return std::upper_bound(cont.begin(), cont.end(), 5);
+ template<boost::range_return_value result_type>
+ struct test_range
+ {
+ template<class Container, class Policy>
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,result_type>::type
+ operator()(Policy&, Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,result_type>::type result_t;
+ result_t result = boost::upper_bound<result_type>(cont, 5);
+ BOOST_CHECK( result == boost::upper_bound<result_type>(boost::make_iterator_range(cont), 5) );
+ return result;
             }
         };
 
- template< class BinaryPredicate >
- struct upper_bound_pred_policy
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- template< class Container >
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- test_iter(Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iter_t;
- iter_t result = boost::upper_bound(cont, 5, BinaryPredicate());
- BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5, BinaryPredicate()) );
- return result;
- }
+ return std::upper_bound(cont.begin(), cont.end(), 5);
+ }
+ };
 
- template< range_return_value result_type>
- struct test_range
- {
- template< class Container, class Policy >
- BOOST_DEDUCED_TYPENAME range_return<Container,result_type>::type
- operator()(Policy& policy, Container& cont)
- {
- typedef BOOST_DEDUCED_TYPENAME range_return<Container,result_type>::type result_t;
-
- result_t result = boost::upper_bound<result_type>(cont, 5, policy.pred());
-
- BOOST_CHECK( result == boost::upper_bound<result_type>(
- boost::make_iterator_range(cont), 5, policy.pred()) );
-
- return result;
- }
- };
-
- template<class Container>
- BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
- reference(Container& cont)
+ template< class BinaryPredicate >
+ struct upper_bound_pred_policy
+ {
+ template< class Container >
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ test_iter(Container& cont)
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iter_t;
+ iter_t result = boost::upper_bound(cont, 5, BinaryPredicate());
+ BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5, BinaryPredicate()) );
+ return result;
+ }
+
+ template< boost::range_return_value result_type>
+ struct test_range
+ {
+ template< class Container, class Policy >
+ BOOST_DEDUCED_TYPENAME boost::range_return<Container,result_type>::type
+ operator()(Policy& policy, Container& cont)
             {
- return std::upper_bound(
- cont.begin(), cont.end(), 5, BinaryPredicate());
+ typedef BOOST_DEDUCED_TYPENAME boost::range_return<Container,result_type>::type result_t;
+
+ result_t result = boost::upper_bound<result_type>(cont, 5, policy.pred());
+
+ BOOST_CHECK( result == boost::upper_bound<result_type>(
+ boost::make_iterator_range(cont), 5, policy.pred()) );
+
+ return result;
             }
-
- BinaryPredicate& pred() { return m_pred; }
-
- private:
- BinaryPredicate m_pred;
         };
 
- template<class Container,
- class TestPolicy,
- class BinaryPredicate>
- void test_upper_bound_impl(TestPolicy policy, BinaryPredicate pred)
+ template<class Container>
+ BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
+ reference(Container& cont)
         {
- using namespace boost::assign;
+ return std::upper_bound(
+ cont.begin(), cont.end(), 5, BinaryPredicate());
+ }
+
+ BinaryPredicate& pred() { return m_pred; }
 
- typedef BOOST_DEDUCED_TYPENAME remove_const<Container>::type container_t;
- typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
+ private:
+ BinaryPredicate m_pred;
+ };
+
+ template<class Container,
+ class TestPolicy,
+ class BinaryPredicate>
+ void test_upper_bound_impl(TestPolicy policy, BinaryPredicate pred)
+ {
+ using namespace boost::assign;
 
- range_test::range_return_test_driver test_driver;
+ typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
+ typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
 
- container_t mcont;
- Container& cont = mcont;
+ boost::range_test::range_return_test_driver test_driver;
 
- test_driver(cont, policy);
+ container_t mcont;
+ Container& cont = mcont;
 
- mcont.clear();
- mcont += 1;
+ test_driver(cont, policy);
 
- std::vector<value_t> temp(mcont.begin(), mcont.end());
- std::sort(temp.begin(), temp.end(), pred);
- mcont.assign(temp.begin(), temp.end());
+ mcont.clear();
+ mcont += 1;
 
- test_driver(cont, policy);
+ std::vector<value_t> temp(mcont.begin(), mcont.end());
+ std::sort(temp.begin(), temp.end(), pred);
+ mcont.assign(temp.begin(), temp.end());
 
- mcont.clear();
- mcont += 1,2,3,4,5,6,7,8,9;
+ test_driver(cont, policy);
 
- temp.assign(mcont.begin(), mcont.end());
- std::sort(temp.begin(), temp.end(), pred);
- mcont.assign(temp.begin(), temp.end());
+ mcont.clear();
+ mcont += 1,2,3,4,5,6,7,8,9;
 
- test_driver(cont, policy);
- }
+ temp.assign(mcont.begin(), mcont.end());
+ std::sort(temp.begin(), temp.end(), pred);
+ mcont.assign(temp.begin(), temp.end());
 
- template<class Container>
- void test_upper_bound_impl()
- {
- test_upper_bound_impl<Container>(
- upper_bound_policy(),
- std::less<int>()
- );
-
- test_upper_bound_impl<Container>(
- upper_bound_pred_policy<std::less<int> >(),
- std::less<int>()
- );
-
- test_upper_bound_impl<Container>(
- upper_bound_pred_policy<std::greater<int> >(),
- std::greater<int>()
- );
- }
+ test_driver(cont, policy);
+ }
+
+ template<class Container>
+ void test_upper_bound_impl()
+ {
+ test_upper_bound_impl<Container>(
+ upper_bound_policy(),
+ std::less<int>()
+ );
+
+ test_upper_bound_impl<Container>(
+ upper_bound_pred_policy<std::less<int> >(),
+ std::less<int>()
+ );
+
+ test_upper_bound_impl<Container>(
+ upper_bound_pred_policy<std::greater<int> >(),
+ std::greater<int>()
+ );
     }
 
     void test_upper_bound()
@@ -179,7 +176,7 @@
     boost::unit_test::test_suite* test
         = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.upper_bound" );
 
- test->add( BOOST_TEST_CASE( &boost::test_upper_bound ) );
+ test->add( BOOST_TEST_CASE( &boost_range_test_algorithm_upper_bound::test_upper_bound ) );
 
     return test;
 }


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