Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49180 - sandbox/SOC/2006/tree/trunk/libs/tree/test
From: ockham_at_[hidden]
Date: 2008-10-08 13:59:08


Author: bernhard.reiter
Date: 2008-10-08 13:59:08 EDT (Wed, 08 Oct 2008)
New Revision: 49180
URL: http://svn.boost.org/trac/boost/changeset/49180

Log:
Remove rotate_binary_tree_test.cpp, merge tests into binary_tree_test.cpp
Removed:
   sandbox/SOC/2006/tree/trunk/libs/tree/test/rotate_binary_tree_test.cpp
Text files modified:
   sandbox/SOC/2006/tree/trunk/libs/tree/test/Jamfile.v2 | 1
   sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp | 59 +++++++++++++++++++++++++++++++++++++++
   sandbox/SOC/2006/tree/trunk/libs/tree/test/treap_test.cpp | 4 +-
   3 files changed, 60 insertions(+), 4 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 2008-10-08 13:59:08 EDT (Wed, 08 Oct 2008)
@@ -29,7 +29,6 @@
 # [ run rank_search_binary_tree_test.cpp ]
         [ run cursor_algorithm_test.cpp ]
         [ run iterator_algorithm_test.cpp ]
- [ run rotate_binary_tree_test.cpp ]
 # [ run string_search_binary_tree_test.cpp ]
 # [ run flat_forest_tree_test.cpp ]
 # [ run interval_search_binary_tree_test.cpp ]

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp 2008-10-08 13:59:08 EDT (Wed, 08 Oct 2008)
@@ -222,8 +222,65 @@
     BOOST_CHECK(*c == 1);
 
     inorder_erase_test_data_tree(bt);
+}
+
+BOOST_AUTO_TEST_CASE( rotate_binary_tree_test )
+{
+ binary_tree<int>::cursor c = bt.root().begin().end();
+ BOOST_CHECK(*c.begin() == 6);
+
+ BOOST_CHECK(*c.parent() == 8);
+ BOOST_CHECK(*c.parent().begin() == 3); // invariant candidate
+
+ BOOST_CHECK(*--c == 3); // differently (not invariantly!) spoken
+ BOOST_CHECK(*c.begin() == 1);
+ BOOST_CHECK(*((++c).begin()).begin() == 4);
+ BOOST_CHECK(*(++c.begin()).begin() == 7);
+
+ BOOST_CHECK(c.parity() == 1);
+ BOOST_CHECK(*c.begin() == 6);
+
+ bt.rotate(c); // Left rotate
+
+ BOOST_CHECK(*c.begin() == 6);
+ BOOST_CHECK(*c.parent().begin() == 8);
+
+ BOOST_CHECK(*c.end().begin() == 7);
+ BOOST_CHECK(*c.begin().begin() == 3);
+ BOOST_CHECK(*c.begin().begin().begin() == 1);
+
+ BOOST_CHECK(*c.begin().end().begin() == 4);
+
+ c = c.begin();
+ BOOST_CHECK(*c.begin() == 3);
+
+ bt.rotate(c); // Right rotate
+
+ BOOST_CHECK(*c.begin() == 3);
+ c = c.end();
+
+ BOOST_CHECK(*c.begin() == 6);
+
+ BOOST_CHECK(*c.parent() == 8);
+ BOOST_CHECK(*c.parent().begin() == 3); // other invariant candidate
+
+ BOOST_CHECK(*--c == 3);
+ BOOST_CHECK(*c.begin() == 1);
+ BOOST_CHECK(*((++c).begin()).begin() == 4);
+ BOOST_CHECK(*(++c.begin()).begin() == 7);
+
+ BOOST_CHECK(*c.begin() == 6);
+
+// BOOST_CHECK(*c.parent().parent().begin() == 6);
+// BOOST_CHECK(*c.parent().parent().end().begin() == 7);
+
+// BOOST_CHECK(*c.begin() == 1);
+// BOOST_CHECK(*c.parent().begin() == 3); // invariant?
+//
+// BOOST_CHECK(*c.parent().parent().begin() == 6);
+// BOOST_CHECK(*c.parent().parent().parent().begin() == 8);
+// BOOST_CHECK(*c.parent().parent().end().begin() == 7);
     
- //return 0;
 }
 
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

Deleted: sandbox/SOC/2006/tree/trunk/libs/tree/test/rotate_binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/rotate_binary_tree_test.cpp 2008-10-08 13:59:08 EDT (Wed, 08 Oct 2008)
+++ (empty file)
@@ -1,84 +0,0 @@
-// Copyright (c) 2006-2008, Bernhard Reiter
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/tree/binary_tree.hpp>
-
-#include <boost/tree/searcher.hpp>
-
-#include "helpers.hpp"
-#include "test_tree_traversal_data.hpp"
-
-#define BOOST_TEST_MODULE rotate_binary_tree test
-//#define BOOST_TEST_DYN_LINK
-#include <boost/test/included/unit_test.hpp>
-
-using boost::tree::binary_tree;
-
-BOOST_FIXTURE_TEST_SUITE(rotate_binary_tree_test, test_binary_tree_with_list_fixture<int>)
-
-BOOST_AUTO_TEST_CASE( rotate_binary_tree_test1 )
-{
- //binary_tree<int> a;
-
- //create_test_data_tree(bt);
- binary_tree<int>::cursor c = bt.root().begin().end();
- BOOST_CHECK(*c.begin() == 6);
-
- BOOST_CHECK(*c.parent() == 8);
- BOOST_CHECK(*c.parent().begin() == 3); // invariant candidate
-
- BOOST_CHECK(*--c == 3); // differently (not invariantly!) spoken
- BOOST_CHECK(*c.begin() == 1);
- BOOST_CHECK(*((++c).begin()).begin() == 4);
- BOOST_CHECK(*(++c.begin()).begin() == 7);
-
- BOOST_CHECK(c.parity() == 1);
- BOOST_CHECK(*c.begin() == 6);
-
- bt.rotate(c); // Left rotate
-
- BOOST_CHECK(*c.begin() == 6);
- BOOST_CHECK(*c.parent().begin() == 8);
-
- BOOST_CHECK(*c.end().begin() == 7);
- BOOST_CHECK(*c.begin().begin() == 3);
- BOOST_CHECK(*c.begin().begin().begin() == 1);
-
- BOOST_CHECK(*c.begin().end().begin() == 4);
-
- c = c.begin();
- BOOST_CHECK(*c.begin() == 3);
-
- bt.rotate(c); // Right rotate
-
- BOOST_CHECK(*c.begin() == 3);
- c = c.end();
-
- BOOST_CHECK(*c.begin() == 6);
-
- BOOST_CHECK(*c.parent() == 8);
- BOOST_CHECK(*c.parent().begin() == 3); // other invariant candidate
-
- BOOST_CHECK(*--c == 3);
- BOOST_CHECK(*c.begin() == 1);
- BOOST_CHECK(*((++c).begin()).begin() == 4);
- BOOST_CHECK(*(++c.begin()).begin() == 7);
-
- BOOST_CHECK(*c.begin() == 6);
-
-// BOOST_CHECK(*c.parent().parent().begin() == 6);
-// BOOST_CHECK(*c.parent().parent().end().begin() == 7);
-
-// BOOST_CHECK(*c.begin() == 1);
-// BOOST_CHECK(*c.parent().begin() == 3); // invariant?
-//
-// BOOST_CHECK(*c.parent().parent().begin() == 6);
-// BOOST_CHECK(*c.parent().parent().parent().begin() == 8);
-// BOOST_CHECK(*c.parent().parent().end().begin() == 7);
-
-}
-
-BOOST_AUTO_TEST_SUITE_END()

Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/treap_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/treap_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/treap_test.cpp 2008-10-08 13:59:08 EDT (Wed, 08 Oct 2008)
@@ -5,8 +5,8 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 #include <boost/tree/binary_tree.hpp>
-#include <boost/tree/balancers/treap.hpp>
-#include <boost/tree/augmentors/unaugmented.hpp>
+#include <boost/tree/detail/balancers/treap.hpp>
+#include <boost/tree/detail/augmentors/unaugmented.hpp>
 
 #include <vector>
 #include <algorithm>


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