|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50779 - in sandbox/SOC/2006/tree/trunk: . libs/tree/test
From: ockham_at_[hidden]
Date: 2009-01-25 19:06:45
Author: bernhard.reiter
Date: 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
New Revision: 50779
URL: http://svn.boost.org/trac/boost/changeset/50779
Log:
Remove helpers.hpp
Added:
sandbox/SOC/2006/tree/trunk/libs/tree/test/upper_bound_test.cpp
- copied, changed from r50778, /sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp
Text files modified:
sandbox/SOC/2006/tree/trunk/TODO | 3 +++
sandbox/SOC/2006/tree/trunk/libs/tree/test/Jamfile.v2 | 3 ++-
sandbox/SOC/2006/tree/trunk/libs/tree/test/binary_tree_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/cursor_algorithm_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/fake_binary_tree.hpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/graph_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/helpers.hpp | 32 ++++++++++++++++----------------
sandbox/SOC/2006/tree/trunk/libs/tree/test/insert_cursor_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/rank_search_binary_tree_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/red_black_tree_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/test_tree_traversal_data.hpp | 8 +++++---
sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/to_last_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/treap_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/unbalanced_binary_tree_test.cpp | 2 +-
sandbox/SOC/2006/tree/trunk/libs/tree/test/upper_bound_test.cpp | 18 +++++++++---------
23 files changed, 53 insertions(+), 47 deletions(-)
Modified: sandbox/SOC/2006/tree/trunk/TODO
==============================================================================
--- sandbox/SOC/2006/tree/trunk/TODO (original)
+++ sandbox/SOC/2006/tree/trunk/TODO 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -14,6 +14,9 @@
[section TODO]
General:
+* Re-merge algorithm tests into algorithm_test.cpp after they're all tidied up?
+* Add algorithms for construction of a tree based on two ranges specifying its
+ pre-/in-/postorder linearization (see Knuth).
* Use Boost.MultiIndex for organising mock objects to avoid redundancy?
(The data pairs position--value
are always the same, but the order in which they are accessed depends on the order of the
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-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -33,7 +33,8 @@
#
[ run range_helpers_test.cpp ]
[ run binary_tree_test.cpp ]
- [ run binary_tree_search_test.cpp ]
+ [ run lower_bound_test.cpp ]
+ [ run upper_bound_test.cpp ]
# [ run key_search_binary_tree_test.cpp ]
# [ run rank_search_binary_tree_test.cpp ]
[ run ascending_cursor_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 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -12,7 +12,7 @@
//#define BOOST_TEST_DYN_LINK
#include <boost/test/included/unit_test.hpp>
-//#include "helpers.hpp"
+//
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/copy_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -10,7 +10,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "mock_binary_cursor.hpp"
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-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -12,7 +12,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
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-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -12,7 +12,7 @@
#include <vector>
-#include "helpers.hpp"
+
template <class T>
struct fake_descending_binary_cursor;
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/for_each_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -12,7 +12,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/graph_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/graph_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/graph_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -18,7 +18,7 @@
#include <boost/tree/balance.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
typedef boost::tree::augmented_type< int, boost::default_color_type > data_type;
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/helpers.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/helpers.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/helpers.hpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -13,22 +13,22 @@
//
//#include <boost/multi_index/identity.hpp>
-#include <boost/tree/output_iterator_cursor.hpp>
-
-#include <list>
-
-struct test_with_list_fixture
-{
- typedef std::back_insert_iterator< std::list<int> > back_insert_iter_list_int;
- typedef boost::tree::output_iterator_cursor<back_insert_iter_list_int> oc_bi_lst_type;
-
- test_with_list_fixture()
- : l(), i(l), o(i) {}
-
- std::list<int> l;
- back_insert_iter_list_int i;
- oc_bi_lst_type o;
-};
+//#include <boost/tree/output_iterator_cursor.hpp>
+//
+//#include <list>
+//
+//struct test_with_list_fixture
+//{
+// typedef std::back_insert_iterator< std::list<int> > back_insert_iter_list_int;
+// typedef boost::tree::output_iterator_cursor<back_insert_iter_list_int> oc_bi_lst_type;
+//
+// test_with_list_fixture()
+// : l(), i(l), o(i) {}
+//
+// std::list<int> l;
+// back_insert_iter_list_int i;
+// oc_bi_lst_type o;
+//};
//using namespace boost::tree;
//
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/insert_cursor_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/insert_cursor_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/insert_cursor_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -14,7 +14,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/key_search_binary_tree_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -14,7 +14,7 @@
//#define BOOST_TEST_DYN_LINK
#include <boost/test/included/unit_test.hpp>
-#include "helpers.hpp"
+
//TODO: Make this a test suite.
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -19,7 +19,7 @@
#include <algorithm>
#include <iterator>
-#include "helpers.hpp"
+
#include "fake_binary_tree.hpp"
#include "test_tree_traversal_data.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/predecessor_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -10,7 +10,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/rank_search_binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/rank_search_binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/rank_search_binary_tree_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -11,7 +11,7 @@
#include <boost/tree/searcher.hpp>
#include <boost/tree/algorithm.hpp>
-#include "helpers.hpp"
+
//TODO: Make this a test suite.
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/red_black_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/red_black_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/red_black_tree_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -15,7 +15,7 @@
//#define BOOST_TEST_DYN_LINK
#include <boost/test/included/unit_test.hpp>
-#include "helpers.hpp"
+
using boost::tree::binary_tree;
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/successor_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -10,7 +10,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/test_tree_traversal_data.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/test_tree_traversal_data.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/test_tree_traversal_data.hpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -14,7 +14,7 @@
#include <boost/mpl/list.hpp>
-#include "helpers.hpp"
+
typedef boost::mpl::list<boost::tree::preorder
,boost::tree::inorder
@@ -108,10 +108,12 @@
template <class T = int>
struct test_binary_tree_with_list_fixture
: public test_binary_tree_fixture<T>
-, public test_with_list_fixture {
+//, public test_with_list_fixture
+{
test_binary_tree_with_list_fixture()
: test_binary_tree_fixture<T>()
- , test_with_list_fixture() {}
+ //, test_with_list_fixture()
+ {}
};
template <class Tree>
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/to_first_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -10,7 +10,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/to_last_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/to_last_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/to_last_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -10,7 +10,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "fake_binary_tree.hpp"
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/transform_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -10,7 +10,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
-#include "helpers.hpp"
+
#include "test_tree_traversal_data.hpp"
#include "mock_binary_cursor.hpp"
#include "fake_binary_tree.hpp"
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 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -15,7 +15,7 @@
//#define BOOST_TEST_DYN_LINK
#include <boost/test/included/unit_test.hpp>
-#include "helpers.hpp"
+
//TODO: Make this a test suite.
Modified: sandbox/SOC/2006/tree/trunk/libs/tree/test/unbalanced_binary_tree_test.cpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/libs/tree/test/unbalanced_binary_tree_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/unbalanced_binary_tree_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -8,7 +8,7 @@
#include <boost/tree/detail/balancers/unbalanced.hpp>
#include <boost/tree/binary_tree.hpp>
-#include "helpers.hpp"
+
#define BOOST_TEST_MODULE unbalanced_binary_tree test
//#define BOOST_TEST_DYN_LINK
Copied: sandbox/SOC/2006/tree/trunk/libs/tree/test/upper_bound_test.cpp (from r50778, /sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/libs/tree/test/lower_bound_test.cpp (original)
+++ sandbox/SOC/2006/tree/trunk/libs/tree/test/upper_bound_test.cpp 2009-01-25 19:06:40 EST (Sun, 25 Jan 2009)
@@ -19,7 +19,7 @@
#include <algorithm>
#include <iterator>
-#include "helpers.hpp"
+
#include "fake_binary_tree.hpp"
#include "test_tree_traversal_data.hpp"
@@ -27,20 +27,20 @@
BOOST_FIXTURE_TEST_SUITE(binary_tree_search_test, fake_binary_tree_fixture<int>)
-BOOST_AUTO_TEST_CASE( lower_bound_test )
+BOOST_AUTO_TEST_CASE( upper_bound_test )
{
fake_binary_tree<int>::cursor c(fbt1, 0), d(fbt1, 0);
- c = lower_bound(fbt1.root(), 4); // (Left) Leaf
- BOOST_CHECK_EQUAL(*c, 4);
- c = lower_bound(fbt1.root(), 7); // (Right) Leaf
- BOOST_CHECK_EQUAL(*c, 7);
- c = lower_bound(fbt1.root(), 6); // Non-Leaf
+ c = upper_bound(fbt1.root(), 4); // (Left) Leaf
BOOST_CHECK_EQUAL(*c, 6);
- c = lower_bound(fbt1.root(), 8); // root().begin()
+ c = upper_bound(fbt1.root(), 7); // (Right) Leaf
BOOST_CHECK_EQUAL(*c, 8);
+ c = upper_bound(fbt1.root(), 6); // Non-Leaf
+ BOOST_CHECK_EQUAL(*c, 7);
+ c = upper_bound(fbt1.root(), 8); // root().begin()
+ BOOST_CHECK_EQUAL(*c, 10);
- c = lower_bound(fbt1.root(), 5); // Not in tree
+ c = upper_bound(fbt1.root(), 5); // Not in tree
BOOST_CHECK_EQUAL(*c, 6);
}
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