diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk
index 9065b99..2682900 100644
--- a/doc/intrusive.qbk
+++ b/doc/intrusive.qbk
@@ -2410,7 +2410,7 @@ helpful discussions.
* [*Jaap Suter] for the initial hint, which eventually leads to the member value_traits.
-[*Ion GaztaÃąaga] would like to thank:
+[*Ion Gaztanaga] would like to thank:
* [*Olaf Krzikalla] for the permission to continue his great work.
diff --git a/example/doc_advanced_value_traits.cpp b/example/doc_advanced_value_traits.cpp
index 1d4b018..bdcd4ca 100644
--- a/example/doc_advanced_value_traits.cpp
+++ b/example/doc_advanced_value_traits.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_assoc_optimized_code.cpp b/example/doc_assoc_optimized_code.cpp
index 594c643..18dfe70 100644
--- a/example/doc_assoc_optimized_code.cpp
+++ b/example/doc_assoc_optimized_code.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_auto_unlink.cpp b/example/doc_auto_unlink.cpp
index e068aec..7e048a7 100644
--- a/example/doc_auto_unlink.cpp
+++ b/example/doc_auto_unlink.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_clone_from.cpp b/example/doc_clone_from.cpp
index f61f3c4..c1351c1 100644
--- a/example/doc_clone_from.cpp
+++ b/example/doc_clone_from.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_entity.cpp b/example/doc_entity.cpp
index efbb96c..4df09e4 100644
--- a/example/doc_entity.cpp
+++ b/example/doc_entity.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_erasing_and_destroying.cpp b/example/doc_erasing_and_destroying.cpp
index d6634ad..a6759e0 100644
--- a/example/doc_erasing_and_destroying.cpp
+++ b/example/doc_erasing_and_destroying.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_how_to_use.cpp b/example/doc_how_to_use.cpp
index 5342b46..30933a9 100644
--- a/example/doc_how_to_use.cpp
+++ b/example/doc_how_to_use.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_iterator_from_value.cpp b/example/doc_iterator_from_value.cpp
index c4135ce..4b935a6 100644
--- a/example/doc_iterator_from_value.cpp
+++ b/example/doc_iterator_from_value.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_list.cpp b/example/doc_list.cpp
index e695bb6..e923419 100644
--- a/example/doc_list.cpp
+++ b/example/doc_list.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_list_algorithms.cpp b/example/doc_list_algorithms.cpp
index 1e63330..0d1277d 100644
--- a/example/doc_list_algorithms.cpp
+++ b/example/doc_list_algorithms.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_offset_ptr.cpp b/example/doc_offset_ptr.cpp
index e3765a2..c5c2c25 100644
--- a/example/doc_offset_ptr.cpp
+++ b/example/doc_offset_ptr.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_rbtree_algorithms.cpp b/example/doc_rbtree_algorithms.cpp
index e372859..d51d26d 100644
--- a/example/doc_rbtree_algorithms.cpp
+++ b/example/doc_rbtree_algorithms.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_set.cpp b/example/doc_set.cpp
index a624a1e..443fd48 100644
--- a/example/doc_set.cpp
+++ b/example/doc_set.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -34,6 +34,8 @@ class MyClass : public set_base_hook<>
{ return a.get() < b.get(); }
friend bool operator> (const MyClass &a, const MyClass &b)
{ return a.get() > b.get(); }
+ friend bool operator== (const MyClass &a, const MyClass &b)
+ { return a.get() < b.get(); }
};
//Define an set that will store MyClass
diff --git a/example/doc_slist.cpp b/example/doc_slist.cpp
index 67d4bde..d408662 100644
--- a/example/doc_slist.cpp
+++ b/example/doc_slist.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_slist_algorithms.cpp b/example/doc_slist_algorithms.cpp
index 779b6e8..d13d333 100644
--- a/example/doc_slist_algorithms.cpp
+++ b/example/doc_slist_algorithms.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_unordered_set.cpp b/example/doc_unordered_set.cpp
index c4e1c65..f561596 100644
--- a/example/doc_unordered_set.cpp
+++ b/example/doc_unordered_set.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -107,4 +107,3 @@ int main()
return 0;
}
//]
-
diff --git a/example/doc_value_traits.cpp b/example/doc_value_traits.cpp
index f091da2..c29e4f0 100644
--- a/example/doc_value_traits.cpp
+++ b/example/doc_value_traits.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/example/doc_window.cpp b/example/doc_window.cpp
index 7154c46..dcb4875 100644
--- a/example/doc_window.cpp
+++ b/example/doc_window.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/perf/perf_list.cpp b/perf/perf_list.cpp
index 730b936..6118eb3 100644
--- a/perf/perf_list.cpp
+++ b/perf/perf_list.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2007
+// (C) Copyright Ion Gaztanaga 2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj b/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj
index cf7e5e9..1635d52 100644
--- a/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj
+++ b/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj
@@ -1,294 +1,297 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="_intrusivelib"
+ ProjectGUID="{90F3C5BD-8E6C-4629-BC71-A1009EC88059}"
+ Keyword="Win32Proj">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/common_functors.hpp b/test/common_functors.hpp
index 928df60..7097f38 100644
--- a/test/common_functors.hpp
+++ b/test/common_functors.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztaņaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -13,6 +13,8 @@
#ifndef BOOST_INTRUSIVE_TEST_COMMON_FUNCTORS_HPP
#define BOOST_INTRUSIVE_TEST_COMMON_FUNCTORS_HPP
+#include
+
namespace boost {
namespace intrusive {
namespace test {
@@ -23,8 +25,7 @@ public:
template
void operator()(Pointer p)
{
- using boost::get_pointer;
- delete get_pointer(p);
+ delete detail::get_pointer(p);
}
};
diff --git a/test/itestvalue.hpp b/test/itestvalue.hpp
index 04476a9..4af2d8d 100644
--- a/test/itestvalue.hpp
+++ b/test/itestvalue.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztaņaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2007.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -13,17 +13,11 @@
#ifndef BOOST_INTRUSIVE_ITESTVALUE
#define BOOST_INTRUSIVE_ITESTVALUE
-#ifdef _MSC_VER
-//#pragma warning(disable : 4584)
-#endif
-
#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
#include "smart_ptr.hpp"
namespace boost{
@@ -40,46 +34,39 @@ struct testvalue
, slist_base_hook
, slist_base_hook
{
- typedef set_base_hook set_auto_base_hook;
- typedef set_base_hookset_base_hook;
- typedef set_member_hook set_auto_member_hook;
- typedef set_member_hook set_member_hook;
+ typedef set_base_hook set_auto_base_hook_t;
+ typedef set_base_hook set_base_hook_t;
+ typedef set_member_hook set_auto_member_hook_t;
+ typedef set_member_hook set_member_hook_t;
- typedef unordered_set_base_hook unordered_set_auto_base_hook;
- typedef unordered_set_base_hook unordered_set_base_hook;
- typedef unordered_set_member_hook unordered_set_auto_member_hook;
- typedef unordered_set_member_hook unordered_set_member_hook;
+ typedef unordered_set_base_hook unordered_set_auto_base_hook_t;
+ typedef unordered_set_base_hook unordered_set_base_hook_t;
+ typedef unordered_set_member_hook unordered_set_auto_member_hook_t;
+ typedef unordered_set_member_hook unordered_set_member_hook_t;
- typedef list_base_hook list_auto_base_hook;
- typedef list_base_hook list_base_hook;
- typedef list_member_hook list_auto_member_hook;
- typedef list_member_hook list_member_hook;
+ typedef list_base_hook list_auto_base_hook_t;
+ typedef list_base_hook list_base_hook_t;
+ typedef list_member_hook list_auto_member_hook_t;
+ typedef list_member_hook list_member_hook_t;
- typedef slist_base_hook slist_auto_base_hook;
- typedef slist_base_hook slist_base_hook;
- typedef slist_member_hook slist_auto_member_hook;
- typedef slist_member_hook slist_member_hook;
-
- typedef typename boost::pointer_to_other
- ::type pointer;
+ typedef slist_base_hook slist_auto_base_hook_t;
+ typedef slist_base_hook slist_base_hook_t;
+ typedef slist_member_hook slist_auto_member_hook_t;
+ typedef slist_member_hook slist_member_hook_t;
//Set members
- //pointer set_parent_, set_left_, set_right_;
- //int set_color_;
- set_member_hook set_node_;
- set_auto_member_hook set_auto_node_;
- unordered_set_member_hook unordered_set_node_;
- unordered_set_auto_member_hook unordered_set_auto_node_;
+ set_member_hook_t set_node_;
+ set_auto_member_hook_t set_auto_node_;
+ unordered_set_member_hook_t unordered_set_node_;
+ unordered_set_auto_member_hook_t unordered_set_auto_node_;
//List members
- //pointer list_next_, list_prev_;
- list_member_hook list_node_;
- list_auto_member_hook list_auto_node_;
+ list_member_hook_t list_node_;
+ list_auto_member_hook_t list_auto_node_;
//Slist members
- //pointer slist_next_;
- slist_member_hook slist_node_;
- slist_auto_member_hook slist_auto_node_;
+ slist_member_hook_t slist_node_;
+ slist_auto_member_hook_t slist_auto_node_;
int value_;
@@ -101,24 +88,24 @@ struct testvalue
testvalue & operator= (const testvalue& src)
{
- set_base_hook::operator=(src);
+ set_base_hook_t::operator=(src);
this->set_node_ = src.set_node_;
- set_auto_base_hook::operator=(src);
+ set_auto_base_hook_t::operator=(src);
this->set_auto_node_ = src.set_auto_node_;
- unordered_set_base_hook::operator=(src);
+ unordered_set_base_hook_t::operator=(src);
this->unordered_set_node_ = src.unordered_set_node_;
- unordered_set_auto_base_hook::operator=(src);
+ unordered_set_auto_base_hook_t::operator=(src);
this->unordered_set_auto_node_ = src.unordered_set_auto_node_;
- list_base_hook::operator=(src);
+ list_base_hook_t::operator=(src);
this->list_node_ = src.list_node_;
- list_auto_base_hook::operator=(src);
+ list_auto_base_hook_t::operator=(src);
this->list_auto_node_ = src.list_auto_node_;
- slist_base_hook::operator=(src);
+ slist_base_hook_t::operator=(src);
this->slist_node_ = src.slist_node_;
- slist_auto_base_hook::operator=(src);
+ slist_auto_base_hook_t::operator=(src);
this->slist_auto_node_ = src.slist_auto_node_;
value_ = src.value_;
return *this;
@@ -131,15 +118,15 @@ struct testvalue
//...
//List
- list_base_hook::swap_nodes(other);
+ list_base_hook_t::swap_nodes(other);
list_node_.swap_nodes(other.list_node_);
- list_auto_base_hook::swap_nodes(other);
+ list_auto_base_hook_t::swap_nodes(other);
list_auto_node_.swap_nodes(other.list_auto_node_);
//Slist
- slist_base_hook::swap_nodes(other);
+ slist_base_hook_t::swap_nodes(other);
slist_node_.swap_nodes(other.slist_node_);
- slist_auto_base_hook::swap_nodes(other);
+ slist_auto_base_hook_t::swap_nodes(other);
slist_auto_node_.swap_nodes(other.slist_auto_node_);
}
@@ -151,6 +138,18 @@ struct testvalue
bool operator==(const testvalue &other) const
{ return value_ == other.value_; }
+
+ friend bool operator< (int other1, const testvalue &other2)
+ { return other1 < other2.value_; }
+
+ friend bool operator< (const testvalue &other1, int other2)
+ { return other1.value_ < other2; }
+
+ friend bool operator== (int other1, const testvalue &other2)
+ { return other1 == other2.value_; }
+
+ friend bool operator== (const testvalue &other1, int other2)
+ { return other1.value_ == other2; }
};
template
@@ -185,151 +184,151 @@ typedef testvalue value_r_t;
typedef testvalue, true> value_s_t;
//Typedefs
-typedef value_r_f::set_base_hook::
+typedef value_r_f::set_base_hook_t::
value_traits set_base_raw;
-typedef value_r_f::set_member_hook::
+typedef value_r_f::set_member_hook_t::
value_traits set_member_raw;
-typedef value_r_f::set_auto_base_hook::
+typedef value_r_f::set_auto_base_hook_t::
value_traits set_auto_base_raw;
-typedef value_r_f::set_auto_member_hook::
+typedef value_r_f::set_auto_member_hook_t::
value_traits set_auto_member_raw;
-typedef value_s_f::set_base_hook::
+typedef value_s_f::set_base_hook_t::
value_traits set_base_smart;
-typedef value_s_f::set_member_hook::
+typedef value_s_f::set_member_hook_t::
value_traits set_member_smart;
-typedef value_s_f::set_auto_base_hook::
+typedef value_s_f::set_auto_base_hook_t::
value_traits set_auto_base_smart;
-typedef value_s_f::set_auto_member_hook::
+typedef value_s_f::set_auto_member_hook_t::
value_traits set_auto_member_smart;
-typedef value_r_t::set_base_hook::
+typedef value_r_t::set_base_hook_t::
value_traits set_base_raw_t;
-typedef value_r_t::set_member_hook::
+typedef value_r_t::set_member_hook_t::
value_traits set_member_raw_t;
-typedef value_s_t::set_base_hook::
+typedef value_s_t::set_base_hook_t::
value_traits set_base_smart_t;
-typedef value_s_t::set_member_hook::
+typedef value_s_t::set_member_hook_t::
value_traits set_member_smart_t;
//Typedefs
-typedef value_r_f::unordered_set_base_hook::
+typedef value_r_f::unordered_set_base_hook_t::
value_traits unordered_set_base_raw;
-typedef value_r_f::unordered_set_member_hook::
+typedef value_r_f::unordered_set_member_hook_t::
value_traits unordered_set_member_raw;
-typedef value_r_f::unordered_set_auto_base_hook::
+typedef value_r_f::unordered_set_auto_base_hook_t::
value_traits unordered_set_auto_base_raw;
-typedef value_r_f::unordered_set_auto_member_hook::
+typedef value_r_f::unordered_set_auto_member_hook_t::
value_traits unordered_set_auto_member_raw;
-typedef value_s_f::unordered_set_base_hook::
+typedef value_s_f::unordered_set_base_hook_t::
value_traits unordered_set_base_smart;
-typedef value_s_f::unordered_set_member_hook::
+typedef value_s_f::unordered_set_member_hook_t::
value_traits unordered_set_member_smart;
-typedef value_s_f::unordered_set_auto_base_hook::
+typedef value_s_f::unordered_set_auto_base_hook_t::
value_traits unordered_set_auto_base_smart;
-typedef value_s_f::unordered_set_auto_member_hook::
+typedef value_s_f::unordered_set_auto_member_hook_t::
value_traits unordered_set_auto_member_smart;
-typedef value_r_t::unordered_set_base_hook::
+typedef value_r_t::unordered_set_base_hook_t::
value_traits unordered_set_base_raw_t;
-typedef value_r_t::unordered_set_member_hook::
+typedef value_r_t::unordered_set_member_hook_t::
value_traits unordered_set_member_raw_t;
-typedef value_s_t::unordered_set_base_hook::
+typedef value_s_t::unordered_set_base_hook_t::
value_traits unordered_set_base_smart_t;
-typedef value_s_t::unordered_set_member_hook::
+typedef value_s_t::unordered_set_member_hook_t::
value_traits unordered_set_member_smart_t;
//Explicit instantiations
-typedef value_r_f::list_base_hook::
+typedef value_r_f::list_base_hook_t::
value_traits list_base_raw;
-typedef value_r_f::list_member_hook::
+typedef value_r_f::list_member_hook_t::
value_traits list_member_raw;
-typedef value_r_f::list_auto_base_hook::
+typedef value_r_f::list_auto_base_hook_t::
value_traits list_auto_base_raw;
-typedef value_r_f::list_auto_member_hook::
+typedef value_r_f::list_auto_member_hook_t::
value_traits list_auto_member_raw;
-typedef value_s_f::list_base_hook::
+typedef value_s_f::list_base_hook_t::
value_traits list_base_smart;
-typedef value_s_f::list_member_hook::
+typedef value_s_f::list_member_hook_t::
value_traits list_member_smart;
-typedef value_s_f::list_auto_base_hook::
+typedef value_s_f::list_auto_base_hook_t::
value_traits list_auto_base_smart;
-typedef value_s_f::list_auto_member_hook::
+typedef value_s_f::list_auto_member_hook_t::
value_traits list_auto_member_smart;
-typedef value_r_t::list_base_hook::
+typedef value_r_t::list_base_hook_t::
value_traits list_base_raw_t;
-typedef value_r_t::list_member_hook::
+typedef value_r_t::list_member_hook_t::
value_traits list_member_raw_t;
-typedef value_s_t::list_base_hook::
+typedef value_s_t::list_base_hook_t::
value_traits list_base_smart_t;
-typedef value_s_t::list_member_hook::
+typedef value_s_t::list_member_hook_t::
value_traits list_member_smart_t;
-typedef value_r_f::slist_base_hook::
+typedef value_r_f::slist_base_hook_t::
value_traits slist_base_raw;
-typedef value_r_f::slist_member_hook::
+typedef value_r_f::slist_member_hook_t::
value_traits slist_member_raw;
-typedef value_r_f::slist_auto_base_hook::
+typedef value_r_f::slist_auto_base_hook_t::
value_traits slist_auto_base_raw;
-typedef value_r_f::slist_auto_member_hook::
+typedef value_r_f::slist_auto_member_hook_t::
value_traits slist_auto_member_raw;
-typedef value_s_f::slist_base_hook::
+typedef value_s_f::slist_base_hook_t::
value_traits slist_base_smart;
-typedef value_s_f::slist_member_hook::
+typedef value_s_f::slist_member_hook_t::
value_traits slist_member_smart;
-typedef value_s_f::slist_auto_base_hook::
+typedef value_s_f::slist_auto_base_hook_t::
value_traits slist_auto_base_smart;
-typedef value_s_f::slist_auto_member_hook::
+typedef value_s_f::slist_auto_member_hook_t::
value_traits slist_auto_member_smart;
-typedef value_r_t::slist_base_hook::
+typedef value_r_t::slist_base_hook_t::
value_traits slist_base_raw_t;
-typedef value_r_t::slist_member_hook::
+typedef value_r_t::slist_member_hook_t::
value_traits slist_member_raw_t;
-typedef value_s_t::slist_base_hook::
+typedef value_s_t::slist_base_hook_t::
value_traits slist_base_smart_t;
-typedef value_s_t::slist_member_hook::
+typedef value_s_t::slist_member_hook_t::
value_traits slist_member_smart_t;
} //namespace boost{
diff --git a/test/list_test.cpp b/test/list_test.cpp
index 7e7ad03..096c0a1 100644
--- a/test/list_test.cpp
+++ b/test/list_test.cpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztaņaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2007.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -16,10 +16,8 @@
#include "smart_ptr.hpp"
#include "common_functors.hpp"
#include
-#include
-
-// Boost.Test
-#include "boost/test/included/test_exec_monitor.hpp"
+#include
+#include "test_macros.hpp"
using namespace boost::intrusive;
@@ -66,26 +64,26 @@ void test_list
, std::size_t
> list_type;
list_type testlist;
- BOOST_CHECK (testlist.empty());
+ BOOST_TEST (testlist.empty());
testlist.push_back (values[0]);
- BOOST_CHECK (testlist.size() == 1);
- BOOST_CHECK (&testlist.front() == &values[0]);
- BOOST_CHECK (&testlist.back() == &values[0]);
+ BOOST_TEST (testlist.size() == 1);
+ BOOST_TEST (&testlist.front() == &values[0]);
+ BOOST_TEST (&testlist.back() == &values[0]);
testlist.push_front (values[1]);
- BOOST_CHECK (testlist.size() == 2);
- BOOST_CHECK (&testlist.front() == &values[1]);
- BOOST_CHECK (&testlist.back() == &values[0]);
+ BOOST_TEST (testlist.size() == 2);
+ BOOST_TEST (&testlist.front() == &values[1]);
+ BOOST_TEST (&testlist.back() == &values[0]);
testlist.pop_back();
- BOOST_CHECK (testlist.size() == 1);
+ BOOST_TEST (testlist.size() == 1);
const list_type &const_testlist = testlist;
- BOOST_CHECK (&const_testlist.front() == &values[1]);
- BOOST_CHECK (&const_testlist.back() == &values[1]);
+ BOOST_TEST (&const_testlist.front() == &values[1]);
+ BOOST_TEST (&const_testlist.back() == &values[1]);
testlist.pop_front();
- BOOST_CHECK (testlist.empty());
+ BOOST_TEST (testlist.empty());
}
@@ -95,7 +93,7 @@ void test_list
::test_sort(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
+ std::vector expected;
typedef boost::intrusive::list
< ValueTraits
, ValueTraits::value_type::constant_time_size
@@ -103,22 +101,17 @@ void test_list
> list_type;
list_type testlist(values.begin(), values.end());
- std::copy (testlist.begin(), testlist.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("12345"));
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
testlist.sort (even_odd());
- std::copy (testlist.rbegin(), testlist.rend(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("53142"));
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.rbegin() ); }
testlist.reverse();
- //test postincrement:
- for (BOOST_DEDUCED_TYPENAME list_type::iterator i =
- testlist.begin(), e = testlist.end(); i != e; i++)
- test_seq << *i;
- BOOST_CHECK (test_seq.is_equal ("53142"));
-}
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
+}
//test: assign, insert, const_iterator, const_reverse_iterator, erase, iterator_to:
template
@@ -126,7 +119,7 @@ void test_list
::test_insert(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
+ std::vector expected;
typedef boost::intrusive::list
< ValueTraits
, ValueTraits::value_type::constant_time_size
@@ -136,29 +129,29 @@ void test_list
testlist.assign (&values[0] + 2, &values[0] + 5);
const list_type& const_testlist = testlist;
- std::copy (const_testlist.begin(), const_testlist.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("345"));
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
- BOOST_DEDUCED_TYPENAME list_type::iterator i = ++testlist.begin();
- BOOST_CHECK (i->value_ == 4);
+ typename list_type::iterator i = ++testlist.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ {
+ typename list_type::const_iterator ci = typename list_type::iterator();
+ //typename list_type::iterator i = typename list_type::const_iterator();
+ }
testlist.insert (i, values[0]);
- std::copy (const_testlist.rbegin(), const_testlist.rend(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("5413"));
+ { int init_values [] = { 5, 4, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.rbegin() ); }
i = testlist.iterator_to (values[4]);
- BOOST_CHECK (&*i == &values[4]);
+ BOOST_TEST (&*i == &values[4]);
i = testlist.erase (i);
- BOOST_CHECK (i == testlist.end());
+ BOOST_TEST (i == testlist.end());
- //test postincrement:
- for (BOOST_DEDUCED_TYPENAME list_type::const_iterator i =
- const_testlist.begin(), e = const_testlist.end(); i != e; i++)
- test_seq << *i;
- BOOST_CHECK (test_seq.is_equal ("314"));
+ { int init_values [] = { 3, 1, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
}
template
@@ -166,13 +159,13 @@ void test_list
::test_shift(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
typedef boost::intrusive::list
< ValueTraits
, ValueTraits::value_type::constant_time_size
, std::size_t
> list_type;
list_type testlist;
+ std::vector expected;
const int num_values = (int)values.size();
std::vector expected_values(num_values);
@@ -184,13 +177,7 @@ void test_list
for(int j = 0; j < num_values; ++j){
expected_values[(j + num_values - i%num_values) % num_values] = (j + 1);
}
- std::copy (testlist.begin(), testlist.end(),
- std::ostream_iterator (test_seq));
- std::stringstream stream;
- std::copy (expected_values.begin(), expected_values.end(),
- std::ostream_iterator (stream));
- stream << std::ends;
- BOOST_CHECK (test_seq.is_equal (stream.str().c_str()));
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
testlist.clear();
}
@@ -201,13 +188,7 @@ void test_list
for(int j = 0; j < num_values; ++j){
expected_values[(j + i) % num_values] = (j + 1);
}
- std::copy (testlist.begin(), testlist.end(),
- std::ostream_iterator (test_seq));
- std::stringstream stream;
- std::copy (expected_values.begin(), expected_values.end(),
- std::ostream_iterator (stream));
- stream << std::ends;
- BOOST_CHECK (test_seq.is_equal (stream.str().c_str()));
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
testlist.clear();
}
}
@@ -218,68 +199,59 @@ void test_list
::test_swap(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
typedef boost::intrusive::list
list_type;
-
+ std::vector expected;
{
list_type testlist1 (&values[0], &values[0] + 2);
list_type testlist2;
testlist2.insert (testlist2.end(), &values[0] + 2, &values[0] + 5);
testlist1.swap (testlist2);
- std::copy (testlist1.begin(), testlist1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("345"));
- std::copy (testlist2.begin(), testlist2.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("12"));
+
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
testlist2.splice (++testlist2.begin(), testlist1);
- std::copy (testlist2.begin(), testlist2.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("13452"));
- BOOST_CHECK (testlist1.empty());
+ { int init_values [] = { 1, 3, 4, 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+
+ BOOST_TEST (testlist1.empty());
testlist1.splice (testlist1.end(), testlist2, ++(++testlist2.begin()));
- std::copy (testlist1.begin(), testlist1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("4"));
- std::copy (testlist2.begin(), testlist2.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("1352"));
+ { int init_values [] = { 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ { int init_values [] = { 1, 3, 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
testlist1.splice (testlist1.end(), testlist2,
testlist2.begin(), ----testlist2.end());
- std::copy (testlist1.begin(), testlist1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("413"));
- std::copy (testlist2.begin(), testlist2.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("52"));
+ { int init_values [] = { 4, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
testlist1.erase (testlist1.iterator_to(values[0]), testlist1.end());
- BOOST_CHECK (testlist1.size() == 1);
- BOOST_CHECK (&testlist1.front() == &values[3]);
+ BOOST_TEST (testlist1.size() == 1);
+ BOOST_TEST (&testlist1.front() == &values[3]);
}
{
- boost::test_tools::output_test_stream test_seq;
list_type testlist1 (&values[0], &values[0] + 2);
list_type testlist2 (&values[0] + 3, &values[0] + 5);
values[0].swap_nodes(values[2]);
- std::copy (testlist1.begin(), testlist1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("32"));
+ { int init_values [] = { 3, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
values[2].swap_nodes(values[4]);
- std::copy (testlist1.begin(), testlist1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("52"));
- std::copy (testlist2.begin(), testlist2.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("43"));
+ { int init_values [] = { 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 4, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
}
}
@@ -288,7 +260,7 @@ void test_list
::test_clone(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
+ std::vector expected;
typedef boost::intrusive::list
list_type testlist2;
testlist2.clone_from(testlist1, test::new_cloner(), test::delete_destroyer());
- BOOST_CHECK (testlist2 == testlist1);
+ BOOST_TEST (testlist2 == testlist1);
testlist2.clear_and_destroy(test::delete_destroyer());
- BOOST_CHECK (testlist2.empty());
+ BOOST_TEST (testlist2.empty());
}
template
@@ -314,10 +286,10 @@ class test_main_template
for (int i = 0; i < 5; ++i)
data[i].value_ = i + 1;
- test_list >::test_all(data);
- test_list >::test_all(data);
return 0;
@@ -335,21 +307,21 @@ class test_main_template
for (int i = 0; i < 5; ++i)
data[i].value_ = i + 1;
- test_list >::test_all(data);
- test_list >::test_all(data);
- test_list >::test_all(data);
- test_list >::test_all(data);
return 0;
}
};
-
+/*
//Explicit instantiations of non-counted classes
template class boost::intrusive::list;
template class boost::intrusive::list;
@@ -365,12 +337,12 @@ template class boost::intrusive::list;
template class boost::intrusive::list;
template class boost::intrusive::list;
template class boost::intrusive::list;
-
-int test_main( int, char* [] )
+*/
+int main( int, char* [] )
{
test_main_template()();
test_main_template, false>()();
test_main_template()();
test_main_template, true>()();
- return 0;
+ return boost::report_errors();
}
diff --git a/test/multiset_test.cpp b/test/multiset_test.cpp
index ce4367f..517b672 100644
--- a/test/multiset_test.cpp
+++ b/test/multiset_test.cpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztaņaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2007.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -16,11 +16,9 @@
#include "itestvalue.hpp"
#include "smart_ptr.hpp"
#include "common_functors.hpp"
-
#include
-
-// Boost.Test
-#include "boost/test/included/test_exec_monitor.hpp"
+#include
+#include "test_macros.hpp"
using namespace boost::intrusive;
@@ -78,21 +76,17 @@ template
void test_multiset::test_sort(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
-
typedef multiset
,ValueTraits::value_type::constant_time_size, std::size_t
> multiset_type;
multiset_type testset1 (values.begin(), values.end());
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
- std::copy (testset1.begin(), testset1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("122345"));
-
testset1.clear();
- BOOST_CHECK (testset1.empty());
+ BOOST_TEST (testset1.empty());
typedef multiset
::test_sort(std::vector multiset_type2;
multiset_type2 testset2 (&values[0], &values[0] + 6);
- std::copy (testset2.rbegin(), testset2.rend(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("531422"));
- BOOST_CHECK (testset2.begin()->value_ == 2);
- BOOST_CHECK (testset2.rbegin()->value_ == 5);
+ { int init_values [] = { 5, 3, 1, 4, 2, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.rbegin() ); }
+
+ BOOST_TEST (testset2.begin()->value_ == 2);
+ BOOST_TEST (testset2.rbegin()->value_ == 5);
}
//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
@@ -112,8 +106,6 @@ template
void test_multiset::test_insert(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
-
typedef multiset
@@ -122,31 +114,24 @@ void test_multiset::test_insert(std::vector (test_seq));
- BOOST_CHECK (test_seq.is_equal ("145"));
-
- BOOST_DEDUCED_TYPENAME multiset_type::iterator i = testset.begin();
- BOOST_CHECK (i->value_ == 1);
+ typename multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
i = testset.insert (i, values[0]);
- BOOST_CHECK (&*i == &values[0]);
-
- std::copy (const_testset.rbegin(), const_testset.rend(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("5431"));
+ BOOST_TEST (&*i == &values[0]);
+
+ { int init_values [] = { 5, 4, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.rbegin() ); }
i = testset.iterator_to (values[2]);
- BOOST_CHECK (&*i == &values[2]);
+ BOOST_TEST (&*i == &values[2]);
testset.erase(i);
- //test post-increment:
- for (BOOST_DEDUCED_TYPENAME multiset_type::const_iterator i = const_testset.begin(),
- e = const_testset.end(); i != e; i++)
- test_seq << *i;
- BOOST_CHECK (test_seq.is_equal ("135"));
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.begin() ); }
}
//test: insert (seq-version), swap, erase (seq-version), size:
@@ -154,7 +139,6 @@ template
void test_multiset::test_swap(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
typedef multiset
@@ -164,19 +148,15 @@ void test_multiset::test_swap(std::vector (test_seq));
- BOOST_CHECK (test_seq.is_equal ("1245"));
- //test post-increment:
- for (BOOST_DEDUCED_TYPENAME multiset_type::iterator i = testset2.begin(),
- e = testset2.end(); i != e; i++)
- test_seq << *i;
- BOOST_CHECK (test_seq.is_equal ("23"));
+
+ { int init_values [] = { 1, 2, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
testset1.erase (testset1.iterator_to(values[5]), testset1.end());
- BOOST_CHECK (testset1.size() == 1);
- BOOST_CHECK (&*testset1.begin() == &values[3]);
+ BOOST_TEST (testset1.size() == 1);
+ BOOST_TEST (&*testset1.begin() == &values[3]);
}
//test: find, equal_range (lower_bound, upper_bound):
@@ -184,28 +164,27 @@ template
void test_multiset::test_find(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
typedef multiset
,ValueTraits::value_type::constant_time_size, std::size_t
> multiset_type;
multiset_type testset (values.begin(), values.end());
- typedef BOOST_DEDUCED_TYPENAME multiset_type::iterator iterator;
+ typedef typename multiset_type::iterator iterator;
testvalue_t cmp_val;
cmp_val.value_ = 2;
iterator i = testset.find (cmp_val);
- BOOST_CHECK (i->value_ == 2);
- BOOST_CHECK ((++i)->value_ == 2);
+ BOOST_TEST (i->value_ == 2);
+ BOOST_TEST ((++i)->value_ == 2);
std::pair range = testset.equal_range (cmp_val);
- BOOST_CHECK (range.first->value_ == 2);
- BOOST_CHECK (range.second->value_ == 3);
- BOOST_CHECK (std::distance (range.first, range.second) == 2);
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 2);
cmp_val.value_ = 7;
- BOOST_CHECK (testset.find (cmp_val) == testset.end());
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
}
template
@@ -223,9 +202,9 @@ void test_multiset
multiset_type testmultiset2;
testmultiset2.clone_from(testmultiset1, test::new_cloner(), test::delete_destroyer());
- BOOST_CHECK (testmultiset2 == testmultiset1);
+ BOOST_TEST (testmultiset2 == testmultiset1);
testmultiset2.clear_and_destroy(test::delete_destroyer());
- BOOST_CHECK (testmultiset2.empty());
+ BOOST_TEST (testmultiset2.empty());
}
template
@@ -240,10 +219,10 @@ class test_main_template
for (int i = 0; i < 6; ++i)
data[i].value_ = random_init[i];
- test_multiset >::test_all(data);
- test_multiset >::test_all(data);
return 0;
@@ -262,21 +241,21 @@ class test_main_template
for (int i = 0; i < 6; ++i)
data[i].value_ = random_init[i];
- test_multiset >::test_all(data);
- test_multiset >::test_all(data);
- test_multiset >::test_all(data);
- test_multiset >::test_all(data);
return 0;
}
};
-
+/*
//Explicit instantiations of non-counted classes
template class multiset
, false>;
@@ -304,14 +283,14 @@ template class multiset
, true>;
template class multiset
, true>;
-
-int test_main( int, char* [] )
+*/
+int main( int, char* [] )
{
test_main_template()();
test_main_template, false>()();
test_main_template()();
test_main_template, true>()();
- return 0;
+ return boost::report_errors();
}
diff --git a/test/set_test.cpp b/test/set_test.cpp
index cdea5df..f9d2393 100644
--- a/test/set_test.cpp
+++ b/test/set_test.cpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztaņaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2007.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -17,9 +17,8 @@
#include "smart_ptr.hpp"
#include "common_functors.hpp"
#include
-
-// Boost.Test
-#include "boost/test/included/test_exec_monitor.hpp"
+#include
+#include "test_macros.hpp"
using namespace boost::intrusive;
@@ -78,20 +77,17 @@ template
void test_set::test_sort(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
typedef boost::intrusive::set
,ValueTraits::value_type::constant_time_size, std::size_t
> set_type;
set_type testset1 (values.begin(), values.end());
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
- std::copy (testset1.begin(), testset1.end(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("12345"));
-
testset1.clear();
- BOOST_CHECK (testset1.empty());
+ BOOST_TEST (testset1.empty());
typedef boost::intrusive::set
::test_sort(std::vector set_type2;
set_type2 testset2 (&values[0], &values[0] + 6);
- std::copy (testset2.rbegin(), testset2.rend(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("53142"));
- BOOST_CHECK (testset2.begin()->value_ == 2);
- BOOST_CHECK (testset2.rbegin()->value_ == 5);
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.rbegin() ); }
+ BOOST_TEST (testset2.begin()->value_ == 2);
+ BOOST_TEST (testset2.rbegin()->value_ == 5);
}
//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
@@ -111,7 +106,6 @@ template
void test_set::test_insert(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
typedef boost::intrusive::set
@@ -121,29 +115,24 @@ void test_set::test_insert(std::vector (test_seq));
- BOOST_CHECK (test_seq.is_equal ("145"));
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
- BOOST_DEDUCED_TYPENAME set_type::iterator i = testset.begin();
- BOOST_CHECK (i->value_ == 1);
+ typename set_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
i = testset.insert (i, values[0]);
- BOOST_CHECK (&*i == &values[0]);
-
- std::copy (const_testset.rbegin(), const_testset.rend(),
- std::ostream_iterator (test_seq));
- BOOST_CHECK (test_seq.is_equal ("5431"));
+ BOOST_TEST (&*i == &values[0]);
+
+ { int init_values [] = { 5, 4, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.rbegin() ); }
i = testset.iterator_to (values[2]);
- BOOST_CHECK (&*i == &values[2]);
+ BOOST_TEST (&*i == &values[2]);
testset.erase (i);
- //test post-increment:
- for (BOOST_DEDUCED_TYPENAME set_type::const_iterator i = const_testset.begin(),
- e = const_testset.end(); i != e; i++)
- test_seq << *i;
- BOOST_CHECK (test_seq.is_equal ("135"));
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.begin() ); }
}
//test: insert (seq-version), swap, erase (seq-version), size:
@@ -151,8 +140,6 @@ template
void test_set::test_swap(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
-
typedef boost::intrusive::set
@@ -162,20 +149,17 @@ void test_set::test_swap(std::vector (test_seq));
- BOOST_CHECK (test_seq.is_equal ("1245"));
- //test post-increment:
- for (BOOST_DEDUCED_TYPENAME set_type::iterator i = testset2.begin(),
- e = testset2.end(); i != e; i++)
- test_seq << *i;
- BOOST_CHECK (test_seq.is_equal ("23"));
+
+ { int init_values [] = { 1, 2, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
testset1.erase (testset1.iterator_to(values[5]), testset1.end());
- BOOST_CHECK (testset1.size() == 1);
- // BOOST_CHECK (&testset1.front() == &values[3]);
- BOOST_CHECK (&*testset1.begin() == &values[3]);
+ BOOST_TEST (testset1.size() == 1);
+ // BOOST_TEST (&testset1.front() == &values[3]);
+ BOOST_TEST (&*testset1.begin() == &values[3]);
}
//test: find, equal_range (lower_bound, upper_bound):
@@ -183,29 +167,27 @@ template
void test_set::test_find(std::vector& values)
{
typedef typename ValueTraits::value_type testvalue_t;
- boost::test_tools::output_test_stream test_seq;
-
typedef boost::intrusive::set
,ValueTraits::value_type::constant_time_size, std::size_t
> set_type;
set_type testset (values.begin(), values.end());
- typedef BOOST_DEDUCED_TYPENAME set_type::iterator iterator;
+ typedef typename set_type::iterator iterator;
testvalue_t cmp_val;
cmp_val.value_ = 2;
iterator i = testset.find (cmp_val);
- BOOST_CHECK (i->value_ == 2);
- BOOST_CHECK ((++i)->value_ != 2);
+ BOOST_TEST (i->value_ == 2);
+ BOOST_TEST ((++i)->value_ != 2);
std::pair range = testset.equal_range (cmp_val);
- BOOST_CHECK (range.first->value_ == 2);
- BOOST_CHECK (range.second->value_ == 3);
- BOOST_CHECK (std::distance (range.first, range.second) == 1);
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 1);
cmp_val.value_ = 7;
- BOOST_CHECK (testset.find (cmp_val) == testset.end());
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
}
template
@@ -223,9 +205,9 @@ void test_set
set_type testset2;
testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer());
- BOOST_CHECK (testset2 == testset1);
+ BOOST_TEST (testset2 == testset1);
testset2.clear_and_destroy(test::delete_destroyer());
- BOOST_CHECK (testset2.empty());
+ BOOST_TEST (testset2.empty());
}
template
@@ -240,10 +222,10 @@ class test_main_template
for (int i = 0; i < 6; ++i)
data[i].value_ = random_init[i];
- test_set >::test_all(data);
- test_set >::test_all(data);
return 0;
@@ -262,21 +244,21 @@ class test_main_template
for (int i = 0; i < 6; ++i)
data[i].value_ = random_init[i];
- test_set >::test_all(data);
- test_set >::test_all(data);
- test_set >::test_all(data);
- test_set >::test_all(data);
return 0;
}
};
-
+/*
//Explicit instantiations of non-counted classes
template class boost::intrusive::set
, false>;
@@ -304,12 +286,12 @@ template class boost::intrusive::set
, true>;
template class boost::intrusive::set
, true>;
-
-int test_main( int, char* [] )
+*/
+int main( int, char* [] )
{
test_main_template()();
test_main_template, false>()();
test_main_template()();
test_main_template, true>()();
- return 0;
+ return boost::report_errors();
}
diff --git a/test/slist_test.cpp b/test/slist_test.cpp
index 5fae54d..440176d 100644
--- a/test/slist_test.cpp
+++ b/test/slist_test.cpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztaņaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2007.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -16,10 +16,8 @@
#include "smart_ptr.hpp"
#include "common_functors.hpp"
#include
-#include