|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2008-04-02 07:50:29
Author: danieljames
Date: 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
New Revision: 43995
URL: http://svn.boost.org/trac/boost/changeset/43995
Log:
Try using the interprocess containers for testing. Compilation is a bit slower but hopefully I'll run into less cross-platform problems.
Text files modified:
branches/unordered/trunk/libs/unordered/test/helpers/equivalent.hpp | 6 +++---
branches/unordered/trunk/libs/unordered/test/helpers/invariants.hpp | 6 +++---
branches/unordered/trunk/libs/unordered/test/helpers/random_values.hpp | 4 ++--
branches/unordered/trunk/libs/unordered/test/helpers/strong.hpp | 4 ++--
branches/unordered/trunk/libs/unordered/test/helpers/tracker.hpp | 18 +++++++++---------
branches/unordered/trunk/libs/unordered/test/objects/memory.hpp | 6 +++---
branches/unordered/trunk/libs/unordered/test/unordered/constructor_tests.cpp | 2 +-
branches/unordered/trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp | 5 ++---
branches/unordered/trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp | 7 +++----
branches/unordered/trunk/libs/unordered/test/unordered/insert_tests.cpp | 2 +-
10 files changed, 29 insertions(+), 31 deletions(-)
Modified: branches/unordered/trunk/libs/unordered/test/helpers/equivalent.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/helpers/equivalent.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/helpers/equivalent.hpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -8,7 +8,7 @@
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
-#include <vector>
+#include <boost/interprocess/containers/vector.hpp>
#include <algorithm>
#include "./metafunctions.hpp"
#include "./fwd.hpp"
@@ -57,7 +57,7 @@
float max_load_factor_;
typedef BOOST_DEDUCED_TYPENAME non_const_value_type<Container>::type value_type;
- std::vector<value_type> values_;
+ boost::interprocess::vector<value_type> values_;
public:
unordered_equivalence_tester(Container const &x)
: size_(x.size()),
@@ -80,7 +80,7 @@
(max_load_factor_ == x.max_load_factor()) &&
(values_.size() == x.size()))) return false;
- std::vector<value_type> copy;
+ boost::interprocess::vector<value_type> copy;
copy.reserve(x.size());
std::copy(x.begin(), x.end(), std::back_inserter(copy));
std::sort(copy.begin(), copy.end());
Modified: branches/unordered/trunk/libs/unordered/test/helpers/invariants.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/helpers/invariants.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/helpers/invariants.hpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -9,7 +9,7 @@
#if !defined(BOOST_UNORDERED_TEST_HELPERS_INVARIANT_HEADER)
#define BOOST_UNORDERED_TEST_HELPERS_INVARIANT_HEADER
-#include <set>
+#include <boost/interprocess/containers/set.hpp>
#include <cmath>
#include "./metafunctions.hpp"
#include "./helpers.hpp"
@@ -27,9 +27,9 @@
{
BOOST_DEDUCED_TYPENAME X::key_equal eq = x1.key_eq();
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
- // Boost.Test was reporting memory leaks for std::set on g++-3.3.
+ // TODO: Boost.Test was reporting memory leaks for std::set on g++-3.3.
// So I work around it by using malloc.
- std::set<key_type, std::less<key_type>, test::malloc_allocator<key_type> > found_;
+ boost::interprocess::set<key_type, std::less<key_type>, test::malloc_allocator<key_type> > found_;
BOOST_DEDUCED_TYPENAME X::const_iterator it = x1.begin(), end = x1.end();
BOOST_DEDUCED_TYPENAME X::size_type size = 0;
Modified: branches/unordered/trunk/libs/unordered/test/helpers/random_values.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/helpers/random_values.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/helpers/random_values.hpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -6,7 +6,7 @@
#if !defined(BOOST_UNORDERED_TEST_HELPERS_RANDOM_VALUES_HEADER)
#define BOOST_UNORDERED_TEST_HELPERS_RANDOM_VALUES_HEADER
-#include <list>
+#include <boost/interprocess/containers/list.hpp>
#include <algorithm>
#include <boost/mpl/if.hpp>
#include "./generators.hpp"
@@ -97,7 +97,7 @@
template <class X>
struct random_values
- : public std::list<BOOST_DEDUCED_TYPENAME X::value_type>
+ : public boost::interprocess::list<BOOST_DEDUCED_TYPENAME X::value_type>
{
random_values(int count, test::random_generator const& generator =
test::default_generator)
Modified: branches/unordered/trunk/libs/unordered/test/helpers/strong.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/helpers/strong.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/helpers/strong.hpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -7,7 +7,7 @@
#define BOOST_UNORDERED_TEST_HELPERS_STRONG_HEADER
#include <boost/config.hpp>
-#include <vector>
+#include <boost/interprocess/containers/vector.hpp>
#include <iterator>
#include "./metafunctions.hpp"
#include "./equivalent.hpp"
@@ -18,7 +18,7 @@
template <class X>
class strong
{
- typedef std::vector<BOOST_DEDUCED_TYPENAME non_const_value_type<X>::type> values_type;
+ typedef boost::interprocess::vector<BOOST_DEDUCED_TYPENAME non_const_value_type<X>::type> values_type;
values_type values_;
public:
void store(X const& x) {
Modified: branches/unordered/trunk/libs/unordered/test/helpers/tracker.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/helpers/tracker.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/helpers/tracker.hpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -9,9 +9,9 @@
#if !defined(BOOST_UNORDERED_TEST_HELPERS_TRACKER_HEADER)
#define BOOST_UNORDERED_TEST_HELPERS_TRACKER_HEADER
-#include <set>
-#include <map>
-#include <vector>
+#include <boost/interprocess/containers/set.hpp>
+#include <boost/interprocess/containers/map.hpp>
+#include <boost/interprocess/containers/vector.hpp>
#include <iterator>
#include <algorithm>
#include <boost/mpl/if.hpp>
@@ -44,7 +44,7 @@
template <class X1, class X2>
void compare_range(X1 const& x1, X2 const& x2)
{
- std::vector<BOOST_DEDUCED_TYPENAME non_const_value_type<X1>::type> values1, values2;
+ boost::interprocess::vector<BOOST_DEDUCED_TYPENAME non_const_value_type<X1>::type> values1, values2;
values1.reserve(x1.size());
values2.reserve(x2.size());
std::copy(x1.begin(), x1.end(), std::back_inserter(values1));
@@ -58,7 +58,7 @@
template <class X1, class X2, class T>
void compare_pairs(X1 const& x1, X2 const& x2, T*)
{
- std::vector<T> values1, values2;
+ boost::interprocess::vector<T> values1, values2;
values1.reserve(std::distance(x1.first, x1.second));
values2.reserve(std::distance(x2.first, x2.second));
std::copy(x1.first, x1.second, std::back_inserter(values1));
@@ -73,9 +73,9 @@
struct ordered_set
: public boost::mpl::if_<
test::has_unique_keys<X>,
- std::set<BOOST_DEDUCED_TYPENAME X::value_type,
+ boost::interprocess::set<BOOST_DEDUCED_TYPENAME X::value_type,
BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>,
- std::multiset<BOOST_DEDUCED_TYPENAME X::value_type,
+ boost::interprocess::multiset<BOOST_DEDUCED_TYPENAME X::value_type,
BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
> {};
@@ -83,9 +83,9 @@
struct ordered_map
: public boost::mpl::if_<
test::has_unique_keys<X>,
- std::map<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type,
+ boost::interprocess::map<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type,
BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>,
- std::multimap<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type,
+ boost::interprocess::multimap<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type,
BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
> {};
Modified: branches/unordered/trunk/libs/unordered/test/objects/memory.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/objects/memory.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/objects/memory.hpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -7,7 +7,7 @@
#define BOOST_UNORDERED_TEST_MEMORY_HEADER
#include <memory>
-#include <map>
+#include <boost/interprocess/containers/map.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/assert.hpp>
#include <boost/unordered/detail/allocator.hpp>
@@ -60,14 +60,14 @@
template <class Alloc>
struct allocator_memory_type_gen {
- typedef std::map<memory_area, memory_track, memory_area_compare,
+ typedef boost::interprocess::map<memory_area, memory_track, memory_area_compare,
Alloc> type;
};
#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
template <>
struct allocator_memory_type_gen<int> {
- typedef std::map<memory_area, memory_track, memory_area_compare> type;
+ typedef boost::interprocess::map<memory_area, memory_track, memory_area_compare> type;
};
#endif
Modified: branches/unordered/trunk/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/constructor_tests.cpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -246,7 +246,7 @@
{
std::cerr<<"map_constructor_test\n";
- typedef std::list<std::pair<BOOST_DEDUCED_TYPENAME T::key_type, BOOST_DEDUCED_TYPENAME T::mapped_type> > list;
+ typedef boost::interprocess::list<std::pair<BOOST_DEDUCED_TYPENAME T::key_type, BOOST_DEDUCED_TYPENAME T::mapped_type> > list;
test::random_values<T> v(1000);
list l;
std::copy(v.begin(), v.end(), std::back_inserter(l));
Modified: branches/unordered/trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -7,8 +7,7 @@
#include <boost/unordered_map.hpp>
#include "../helpers/test.hpp"
#include <algorithm>
-#include <map>
-#include <list>
+#include <boost/interprocess/containers/list.hpp>
#include "../helpers/tracker.hpp"
#include "../helpers/invariants.hpp"
@@ -57,7 +56,7 @@
UNORDERED_AUTO_TEST(map_tests)
{
- typedef std::list<std::pair<int const, int> > values_type;
+ typedef boost::interprocess::list<std::pair<int const, int> > values_type;
values_type v[5];
v[0].push_back(std::pair<int const, int>(1,1));
v[1].push_back(std::pair<int const, int>(28,34));
Modified: branches/unordered/trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -8,8 +8,7 @@
#include <boost/unordered_map.hpp>
#include "../helpers/test.hpp"
-#include <list>
-#include <set>
+#include <boost/interprocess/containers/list.hpp>
#include <iostream>
#include <iterator>
#include <boost/next_prior.hpp>
@@ -50,7 +49,7 @@
collision2_hash, std::equal_to<int>,
test::allocator<std::pair<int const, int> > > collide_map2;
typedef collide_map::value_type collide_value;
-typedef std::list<collide_value> collide_list;
+typedef boost::interprocess::list<collide_value> collide_list;
UNORDERED_AUTO_TEST(empty_range_tests)
{
@@ -124,7 +123,7 @@
std::copy(x.begin(), x.end(), std::back_inserter(l));
l.erase(boost::next(l.begin(), start), boost::next(l.begin(), end));
x.erase(boost::next(x.begin(), start), boost::next(x.begin(), end));
- return compare(l, x);
+ return ::compare(l, x);
}
template <class Container>
Modified: branches/unordered/trunk/libs/unordered/test/unordered/insert_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/insert_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/insert_tests.cpp 2008-04-02 07:50:27 EDT (Wed, 02 Apr 2008)
@@ -248,7 +248,7 @@
{
std::cerr<<"associative_insert_range_test\n";
- typedef std::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type> > list;
+ typedef boost::interprocess::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type> > list;
test::random_values<X> v(1000, generator);
list l;
std::copy(v.begin(), v.end(), std::back_inserter(l));
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