Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50431 - sandbox/SOC/2006/tree/trunk/libs/tree/test
From: ockham_at_[hidden]
Date: 2009-01-01 10:37:44


Author: bernhard.reiter
Date: 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
New Revision: 50431
URL: http://svn.boost.org/trac/boost/changeset/50431

Log:
Split up algorithm tests.
Added:
   sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp
      - copied, changed from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
   sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp
      - copied, changed from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
   sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp
      - copied, changed from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
   sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp
      - copied, changed from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
   sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp
      - copied, changed from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
   sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp
      - copied, changed from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
Text files modified:
   sandbox/SOC/2006/tree/trunk/libs/tree/test/Jamfile.v2 | 8 +
   sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp | 149 ---------------------------------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp | 160 ++---------------------------------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/fake_binary_tree.hpp | 41 +++++++++
   sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp | 141 ------------------------------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/forest_tree_test.cpp | 60 ++++++------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp | 177 ++-------------------------------------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp | 180 ++-------------------------------------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp | 156 ----------------------------------
   sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp | 141 -------------------------------
   10 files changed, 116 insertions(+), 1097 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/Jamfile.v2 (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/Jamfile.v2 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -22,6 +22,14 @@
         ;
         
 test-suite tree :
+# Algorithms
+ [ run to_first_test.cpp ]
+ [ run successor_test.cpp ]
+ [ run predecessor_test.cpp ]
+ [ run for_each_test.cpp ]
+ [ run copy_test.cpp ]
+ [ run transform_test.cpp ]
+#
         [ run range_helpers_test.cpp ]
         [ run binary_tree_test.cpp ]
         [ run binary_tree_search_test.cpp ]

Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp (from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -6,8 +6,6 @@
 
 #include <boost/tree/algorithm.hpp>
 
-#include <boost/lambda/bind.hpp>
-
 #define BOOST_TEST_MODULE cursor_algorithm test
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/test_case_template.hpp>
@@ -21,94 +19,6 @@
 
 BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
 
-BOOST_AUTO_TEST_CASE( test_to_first_preorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(preorder(), c);
- BOOST_CHECK_EQUAL(*c, 8);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_inorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(inorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_postorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(postorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.descending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.ascending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.descending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.ascending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
 BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
 {
     boost::tree::copy(Order(), fbt1.descending_root(), o);
@@ -137,63 +47,4 @@
     validate_test_dataset1_tree(fbt2.ascending_root());
 }
 
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::forward_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-//
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_asc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::bidirectional_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.descending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_ascending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.ascending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
-}
-
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -19,123 +19,22 @@
 
 using namespace boost::tree;
 
-BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
-
-BOOST_AUTO_TEST_CASE( test_to_first_preorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(preorder(), c);
- BOOST_CHECK_EQUAL(*c, 8);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_inorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(inorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_postorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(postorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.descending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.ascending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
+BOOST_AUTO_TEST_SUITE( empty_subtree_algorithms_test )
 
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_first_equals_last, Order, orders )
 {
- boost::tree::for_each(
- preorder(),
- fbt1.descending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
+ typedef fake_binary_tree<int> tree_type;
+ tree_type fbt(1);
+ tree_type::descending_cursor f = fbt.descending_root();
+ tree_type::descending_cursor l = fbt.descending_root();
+ boost::tree::to_first(Order(), f);
+ boost::tree::to_first(Order(), l);
+ BOOST_CHECK(f == l);
 }
 
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.ascending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.descending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_ascending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.ascending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.descending_root(), fbt2.descending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.descending_root());
-}
+BOOST_AUTO_TEST_SUITE_END()
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.ascending_root(), fbt2.ascending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.ascending_root());
-}
+BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
 
 //BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
 //{
@@ -159,41 +58,4 @@
 // BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
 //}
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.descending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_ascending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.ascending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
-}
-
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/fake_binary_tree.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/fake_binary_tree.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/fake_binary_tree.hpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -19,6 +19,9 @@
 template <class T>
 struct fake_ascending_binary_cursor;
 
+template <class T>
+struct fake_root_tracking_binary_cursor;
+
 /// See http://en.wikipedia.org/wiki/Binary_Tree#Methods_for_storing_binary_trees
 template <class T>
 struct fake_binary_tree {
@@ -27,6 +30,9 @@
 
     typedef fake_ascending_binary_cursor<T> ascending_cursor;
     typedef fake_ascending_binary_cursor<T const> const_ascending_cursor;
+
+ typedef fake_root_tracking_binary_cursor<T> root_tracking_cursor;
+ typedef fake_root_tracking_binary_cursor<T const> const_root_tracking_cursor;
         
     fake_binary_tree(typename std::vector<T>::size_type s) : m_data(s)
     { }
@@ -41,6 +47,11 @@
         return ascending_cursor(*this, 0);
     }
 
+ root_tracking_cursor root_tracking_root()
+ {
+ return root_tracking_cursor(*this, 0);
+ }
+
     typedef std::vector<T> children_type;
     typedef typename children_type::size_type size_type;
     typedef typename children_type::value_type value_type;
@@ -192,6 +203,36 @@
         --this->base_reference().m_pos;
         this->base_reference().m_pos >>= 1;
     }
+
+public:
+ bool is_root() const
+ {
+ return this->base_reference().m_pos == 0;
+ }
+};
+
+template <class T>
+struct fake_root_tracking_binary_cursor
+: public boost::tree::cursor_adaptor<fake_root_tracking_binary_cursor<T>
+ , fake_ascending_binary_cursor<T>
+ >
+{
+ typedef fake_root_tracking_binary_cursor<T> cursor;
+ typedef fake_root_tracking_binary_cursor<T const> const_cursor;
+
+ fake_root_tracking_binary_cursor(fake_binary_tree<T>& t
+ , typename fake_binary_tree<T>::size_type p)
+ : fake_root_tracking_binary_cursor::cursor_adaptor_(fake_ascending_binary_cursor<T>(t, p)) {}
+
+private:
+ friend class boost::iterator_core_access;
+ friend class boost::tree::cursor_core_access;
+
+public:
+ bool is_root() const
+ {
+ return this->base_reference().is_root();
+ }
 };
 
 //template <class T>

Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp (from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -21,53 +21,7 @@
 
 BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
 
-BOOST_AUTO_TEST_CASE( test_to_first_preorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(preorder(), c);
- BOOST_CHECK_EQUAL(*c, 8);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_inorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(inorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_postorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(postorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_for_each_descending, Order, orders)
 {
     boost::tree::for_each(
         Order(),
@@ -77,7 +31,7 @@
     test_traversal(Order(), l.begin(), l.end());
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_for_each_ascending, Order, orders)
 {
     boost::tree::for_each(
         Order(),
@@ -87,7 +41,7 @@
     test_traversal(Order(), l.begin(), l.end());
 }
 
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
+BOOST_AUTO_TEST_CASE( test_for_each_subtree3_descending )
 {
     boost::tree::for_each(
         preorder(),
@@ -98,7 +52,7 @@
     BOOST_CHECK_EQUAL(l.size(), 5);
 }
 
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
+BOOST_AUTO_TEST_CASE( test_for_each_subtree3_ascending )
 {
     boost::tree::for_each(
         preorder(),
@@ -109,91 +63,4 @@
     BOOST_CHECK_EQUAL(l.size(), 5);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.descending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_ascending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.ascending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.descending_root(), fbt2.descending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.ascending_root(), fbt2.ascending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.ascending_root());
-}
-
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::forward_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-//
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_asc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::bidirectional_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.descending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_ascending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.ascending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
-}
-
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/forest_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/forest_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/forest_tree_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -56,57 +56,57 @@
 //
 // forest_tree<int> ft0;
 //
-// forest_tree<int>::cursor c = ft0.insert(ft0.root().end(), 8);
+// forest_tree<int>::cursor c = ft0.insert(ft0.end(), 8); //FIXME
 //
 // BOOST_CHECK_EQUAL(*c, 8);
-// BOOST_CHECK(c == ft0.root().begin());
-// BOOST_CHECK(++c == ft0.root().end());
-// BOOST_CHECK(ft0.root().begin().parent() == ft0.root());
-// BOOST_CHECK(!ft0.root().empty());
-// BOOST_CHECK(ft0.root().begin().empty());
+// BOOST_CHECK(c == ft0.begin());
+// BOOST_CHECK(++c == ft0.end());
+//// BOOST_CHECK(ft0.begin().parent() == ft0.root());
+// BOOST_CHECK(!ft0.empty());
+// BOOST_CHECK(ft0.begin().empty());
 //
-// c = ft0.insert(ft0.root().end(), 6);
+// c = ft0.insert(ft0.end(), 6);
 // BOOST_CHECK_EQUAL(*c, 6);
-// BOOST_CHECK(ft0.root().begin() != ft0.root().end());
-// BOOST_CHECK(c != ft0.root().end());
-// BOOST_CHECK(c.base() == ft0.root().base().begin().end());
-// BOOST_CHECK(c.parent() == ft0.root());
-// BOOST_CHECK(!ft0.root().empty());
-// BOOST_CHECK(++c == ft0.root().end());
+// BOOST_CHECK(ft0.begin() != ft0.end());
+// BOOST_CHECK(c != ft0.end());
+//// BOOST_CHECK(c.base() == ft0.begin().end());
+//// BOOST_CHECK(c.parent() == ft0.root());
+// BOOST_CHECK(!ft0.empty());
+// BOOST_CHECK(++c == ft0.end());
 // ----c;
-// BOOST_CHECK(c == ft0.root().begin());
+// BOOST_CHECK(c == ft0.begin());
 // BOOST_CHECK_EQUAL(*c, 8);
 //
-// c = ft0.insert(ft0.root().end(), 7);
+// c = ft0.insert(ft0.end(), 7);
 // BOOST_CHECK_EQUAL(*c, 7);
-// BOOST_CHECK(c.parent() == ft0.root());
-// BOOST_CHECK(!ft0.root().empty());
-// BOOST_CHECK(++c == ft0.root().end());
+//// BOOST_CHECK(c.parent() == ft0.root());
+// BOOST_CHECK(!ft0.empty());
+// BOOST_CHECK(++c == ft0.end());
 // ----c;
 // BOOST_CHECK_EQUAL(*c, 6);
-// BOOST_CHECK(c.parent() == ft0.root());
+//// BOOST_CHECK(c.parent() == ft0.root());
 // --c;
-// BOOST_CHECK(c == ft0.root().begin());
-// BOOST_CHECK(c.parent() == ft0.root());
+// BOOST_CHECK(c == ft0.begin());
+//// BOOST_CHECK(c.parent() == ft0.root());
 // BOOST_CHECK_EQUAL(*c, 8);
-// c = ft0.root().begin().begin();
-// BOOST_CHECK(c.parent() == ft0.root().begin());
+// c = ft0.begin().begin();
+// BOOST_CHECK(c.parent() == ft0.begin());
 //
-// c = ft0.insert(ft0.root().begin().begin(), 3);
+// c = ft0.insert(ft0.begin().begin(), 3);
 // BOOST_CHECK_EQUAL(*c, 3);
-// BOOST_CHECK(c == ft0.root().begin().begin());
-// BOOST_CHECK(ft0.root().begin().begin().parent() == ft0.root().begin());
+// BOOST_CHECK(c == ft0.begin().begin());
+// BOOST_CHECK(ft0.begin().begin().parent() == ft0.begin());
 //
 // // Need more checks after this line...
-// c = ft0.insert(ft0.root().begin().begin().begin(), 1);
-// c = ft0.root().begin();
+// c = ft0.insert(ft0.begin().begin().begin(), 1);
+// c = ft0.begin();
 // (++c).to_end();
 //
 // c = ft0.insert(c, 4);
 // BOOST_CHECK_EQUAL(*c, 4);
-// BOOST_CHECK(--(c.to_parent()) == ft0.root().begin());
+// BOOST_CHECK(--(c.to_parent()) == ft0.begin());
 //
-// c = ft0.root().begin();
+// c = ft0.begin();
 // BOOST_CHECK_EQUAL(*c, 8);
 // BOOST_CHECK_EQUAL(*c.to_begin(), 3);
 // BOOST_CHECK_EQUAL(*c.to_begin(), 1);

Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp (from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -6,8 +6,6 @@
 
 #include <boost/tree/algorithm.hpp>
 
-#include <boost/lambda/bind.hpp>
-
 #define BOOST_TEST_MODULE cursor_algorithm test
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/test_case_template.hpp>
@@ -21,179 +19,24 @@
 
 BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
 
-BOOST_AUTO_TEST_CASE( test_to_first_preorder )
+BOOST_AUTO_TEST_CASE( test_predecessor_preorder )
 {
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(preorder(), c);
+ fake_binary_tree<int>::root_tracking_cursor c = fbt1.root_tracking_root().begin().begin();
+ boost::tree::predecessor(preorder(), c);
     BOOST_CHECK_EQUAL(*c, 8);
 }
 
-BOOST_AUTO_TEST_CASE( test_to_first_inorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(inorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_postorder )
+BOOST_AUTO_TEST_CASE( test_predecessor_inorder )
 {
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(postorder(), c);
+ fake_binary_tree<int>::root_tracking_cursor c = fbt1.root_tracking_root().begin().begin();
+ boost::tree::predecessor(inorder(), c);
     BOOST_CHECK_EQUAL(*c, 1);
 }
 
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.descending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.ascending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.descending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.ascending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.descending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_ascending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.ascending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.descending_root(), fbt2.descending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.ascending_root(), fbt2.ascending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.ascending_root());
-}
-
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::forward_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-//
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_asc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::bidirectional_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.descending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_ascending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.ascending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_descending, Order, orders)
+BOOST_AUTO_TEST_CASE( test_predecessor_postorder )
 {
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.descending_root());
+ fake_binary_tree<int>::root_tracking_cursor c = fbt1.root_tracking_root().begin().begin();
+ boost::tree::predecessor(postorder(), c);
+ BOOST_CHECK_EQUAL(*c, 6);
 }
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
-}
-
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp (from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -6,8 +6,6 @@
 
 #include <boost/tree/algorithm.hpp>
 
-#include <boost/lambda/bind.hpp>
-
 #define BOOST_TEST_MODULE cursor_algorithm test
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/test_case_template.hpp>
@@ -21,179 +19,25 @@
 
 BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
 
-BOOST_AUTO_TEST_CASE( test_to_first_preorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(preorder(), c);
- BOOST_CHECK_EQUAL(*c, 8);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_inorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(inorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_postorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(postorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.descending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.ascending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.descending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.ascending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
+BOOST_AUTO_TEST_CASE( test_successor_preorder )
 {
- boost::tree::copy(Order(), fbt1.descending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
+ fake_binary_tree<int>::root_tracking_cursor c = fbt1.root_tracking_root().begin();
+ boost::tree::successor(preorder(), c);
+ BOOST_CHECK_EQUAL(*c, 3);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_ascending, Order, orders)
+BOOST_AUTO_TEST_CASE( test_successor_inorder )
 {
- boost::tree::copy(Order(), fbt1.ascending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
+ fake_binary_tree<int>::root_tracking_cursor c = fbt1.root_tracking_root().begin();
+ boost::tree::successor(inorder(), c);
+ BOOST_CHECK_EQUAL(*c, 10);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.descending_root(), fbt2.descending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.ascending_root(), fbt2.ascending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.ascending_root());
-}
-
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::forward_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-//
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_asc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::bidirectional_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
+BOOST_AUTO_TEST_CASE( test_successor_postorder )
 {
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.descending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
+ fake_binary_tree<int>::root_tracking_cursor c = fbt1.root_tracking_root().begin();
+ boost::tree::successor(postorder(), c);
+ BOOST_CHECK(c == fbt1.root_tracking_root());
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_ascending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.ascending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
-}
-
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp (from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -6,8 +6,6 @@
 
 #include <boost/tree/algorithm.hpp>
 
-#include <boost/lambda/bind.hpp>
-
 #define BOOST_TEST_MODULE cursor_algorithm test
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/test_case_template.hpp>
@@ -42,158 +40,4 @@
     BOOST_CHECK_EQUAL(*c, 1);
 }
 
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.descending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.ascending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.descending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.ascending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.descending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_ascending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.ascending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.descending_root(), fbt2.descending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.ascending_root(), fbt2.ascending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.ascending_root());
-}
-
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::forward_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-//
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_asc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::bidirectional_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.descending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_ascending, Order, orders)
-{
- // First copy test_tree to test_tree2, by adding 1 to each element,
- // then copy test_tree2 to test_list, by subtracting 1 - so
- // test_list should hold test_tree's original elements in ORDER.
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root(), std::bind2nd(std::plus<int>(),1));
- boost::tree::transform(Order(), fbt2.ascending_root(), o, std::bind2nd(std::minus<int>(),1));
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.descending_root(), fbt2.descending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::transform(Order(), fbt1.ascending_root(), fbt2.ascending_root()
- , std::bind2nd(std::minus<int>(),1));
- validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
-}
-
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp (from r50430, /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp 2009-01-01 10:37:42 EST (Thu, 01 Jan 2009)
@@ -6,8 +6,6 @@
 
 #include <boost/tree/algorithm.hpp>
 
-#include <boost/lambda/bind.hpp>
-
 #define BOOST_TEST_MODULE cursor_algorithm test
 #include <boost/test/included/unit_test.hpp>
 #include <boost/test/test_case_template.hpp>
@@ -21,144 +19,6 @@
 
 BOOST_FIXTURE_TEST_SUITE(cursor_algorithms_test, fake_binary_tree_with_list_fixture<int>)
 
-BOOST_AUTO_TEST_CASE( test_to_first_preorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(preorder(), c);
- BOOST_CHECK_EQUAL(*c, 8);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_inorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(inorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-BOOST_AUTO_TEST_CASE( test_to_first_postorder )
-{
- fake_binary_tree<int>::descending_cursor c = fbt1.descending_root();
- boost::tree::to_first(postorder(), c);
- BOOST_CHECK_EQUAL(*c, 1);
-}
-
-// The following require RootTracker.
-
-//BOOST_AUTO_TEST_CASE( test_successor_preorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(preorder(), c);
-// BOOST_CHECK_EQUAL(*c, 3);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_inorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(inorder(), c);
-// BOOST_CHECK_EQUAL(*c, 10);
-//}
-//
-//BOOST_AUTO_TEST_CASE( test_successor_postorder )
-//{
-// fake_binary_tree<int>::ascending_cursor c = fbt1.ascending_root().begin();
-// boost::tree::successor(postorder(), c);
-// BOOST_CHECK(c == fbt1.ascending_root());
-//}
-
-// Also add tests for predecessor!
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_descending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.descending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_foreach_ascending, Order, orders)
-{
- boost::tree::for_each(
- Order(),
- fbt1.ascending_root(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_descending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.descending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE( test_foreach_subtree3_ascending )
-{
- boost::tree::for_each(
- preorder(),
- fbt1.ascending_root().begin(),
- boost::lambda::bind(&std::list<int>::push_back, &l, boost::lambda::_1)
- );
- test_subtree_traversal(preorder(), l.begin(), l.end(), 1);
- BOOST_CHECK_EQUAL(l.size(), 5);
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_descending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.descending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_ascending, Order, orders)
-{
- boost::tree::copy(Order(), fbt1.ascending_root(), o);
- test_traversal(Order(), l.begin(), l.end());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_descending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.descending_root(), fbt2.descending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.descending_root());
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy_trees_ascending, Order, orders)
-{
- BOOST_CHECK(fbt1 != fbt2);
- boost::tree::copy(Order(), fbt1.ascending_root(), fbt2.ascending_root());
- BOOST_CHECK(fbt1 == fbt2);
- validate_test_dataset1_tree(fbt2.ascending_root());
-}
-
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_desc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::forward_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-//
-//BOOST_AUTO_TEST_CASE_TEMPLATE ( test_asc_copy_using_insert_cursor, Order, orders )
-//{
-// bt2.clear();
-//
-// boost::tree::copy(Order(), bt.root(), tree_inserter(bt2, bt2.root())
-// , boost::bidirectional_traversal_tag());
-//
-// validate_test_dataset1_tree(bt2.root());
-// BOOST_CHECK_EQUAL(size(bt2.root()), size(bt.root()));
-//}
-
 BOOST_AUTO_TEST_CASE_TEMPLATE( test_transform_descending, Order, orders)
 {
     // First copy test_tree to test_tree2, by adding 1 to each element,
@@ -195,5 +55,4 @@
     validate_test_dataset1_minus_1_tree(fbt2.ascending_root());
 }
 
-
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file


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