forked from boostorg/unordered
Merge test improvements, pdf documentation improvements, some implementation
tweaks. Merged revisions 45747-46030 via svnmerge from https://svn.boost.org/svn/boost/branches/unordered/trunk ................ r45747 | danieljames | 2008-05-25 18:03:30 +0100 (Sun, 25 May 2008) | 1 line Remove /branches/unordered/dev from svnmerge tracking. ................ r45874 | danieljames | 2008-05-28 18:54:53 +0100 (Wed, 28 May 2008) | 1 line Merge from trunk. ................ r45881 | danieljames | 2008-05-29 00:10:37 +0100 (Thu, 29 May 2008) | 2 lines Make it possible to use a custom generator in more places. ................ r45882 | danieljames | 2008-05-29 00:10:56 +0100 (Thu, 29 May 2008) | 2 lines Remove several unused parameters. ................ r45883 | danieljames | 2008-05-29 00:11:06 +0100 (Thu, 29 May 2008) | 2 lines No need to run move_construct_tests1 from move_construct_tests2, already calling it directly. ................ r45884 | danieljames | 2008-05-29 00:11:15 +0100 (Thu, 29 May 2008) | 2 lines Remove unused 'construct' as in trunk. ................ r45885 | danieljames | 2008-05-29 00:11:25 +0100 (Thu, 29 May 2008) | 2 lines More consistent implementations of insert_impl. ................ r45886 | danieljames | 2008-05-29 00:11:34 +0100 (Thu, 29 May 2008) | 2 lines No need to use the single argument version of methods when the variadic version is available. Frees up the non-variadic version for overloading to emulate variadic methods. ................ r45887 | danieljames | 2008-05-29 00:11:44 +0100 (Thu, 29 May 2008) | 2 lines Add another test, mainly to avoid an unused parameter warning. ................ r45888 | danieljames | 2008-05-29 00:11:54 +0100 (Thu, 29 May 2008) | 2 lines Adjust the pixels per inch of the buckets diagram so it'll fit on the page. ................ r45889 | danieljames | 2008-05-29 00:15:49 +0100 (Thu, 29 May 2008) | 1 line Improve pdf output, thanks to John Maddock. ................ r45890 | danieljames | 2008-05-29 00:17:45 +0100 (Thu, 29 May 2008) | 1 line Add an svg version of the bucket diagram. ................ r45891 | danieljames | 2008-05-29 00:18:11 +0100 (Thu, 29 May 2008) | 1 line Remove the original dia buckets diagram, I'm not using it anymore. ................ r46025 | danieljames | 2008-06-01 18:39:51 +0100 (Sun, 01 Jun 2008) | 1 line Initialise merging from doc. ................ r46030 | danieljames | 2008-06-01 18:54:36 +0100 (Sun, 01 Jun 2008) | 29 lines Merge in documentation improvements from the doc branch. Merged revisions 45892-46020 via svnmerge from https://svn.boost.org/svn/boost/branches/doc ........ r45892 | danieljames | 2008-05-29 00:30:07 +0100 (Thu, 29 May 2008) | 1 line Merge latest changes from unordered. ........ r46017 | danieljames | 2008-06-01 18:18:15 +0100 (Sun, 01 Jun 2008) | 2 lines Use both PNG and SVG versions of the buckets diagram. ........ r46018 | danieljames | 2008-06-01 18:18:27 +0100 (Sun, 01 Jun 2008) | 2 lines Improved function summary tables in unordered documenations. ........ r46019 | danieljames | 2008-06-01 18:18:39 +0100 (Sun, 01 Jun 2008) | 3 lines I'd hacked the bibliography to avoid showing the title twice, but this was causing problems when generating PDFs, so show the title twice. ........ r46020 | danieljames | 2008-06-01 18:18:52 +0100 (Sun, 01 Jun 2008) | 3 lines Don't use the compact boostbook refernce style in the standalone documentation as it is too wide for printing out. ........ ................ [SVN r46031]
This commit is contained in:
@@ -8,7 +8,7 @@ import testing ;
|
||||
project unordered-test/unordered
|
||||
: requirements
|
||||
<toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
|
||||
<toolset>gcc:<cxxflags>-Wsign-promo
|
||||
<toolset>gcc:<cxxflags>"-Wsign-promo -Wunused-parameter"
|
||||
#<toolset>msvc:<cxxflags>/W4
|
||||
;
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace bucket_tests {
|
||||
test::seed_t seed(54635);
|
||||
|
||||
template <class X>
|
||||
void tests(X* = 0)
|
||||
void tests(X* = 0, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
|
||||
test::random_values<X> v(1000);
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
||||
X x(v.begin(), v.end());
|
||||
|
||||
|
||||
@@ -149,6 +149,8 @@ void unordered_map_test(X& r, Key const& k, T const& v)
|
||||
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
|
||||
BOOST_MPL_ASSERT((boost::is_same<value_type, std::pair<key_type const, T> >));
|
||||
|
||||
r.insert(std::pair<Key const, T>(k, v));
|
||||
|
||||
#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
|
||||
Key k_lvalue(k);
|
||||
T v_lvalue(v);
|
||||
|
||||
@@ -253,12 +253,12 @@ void constructor_tests2(T*, test::random_generator const& generator = test::defa
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void map_constructor_test(T* = 0)
|
||||
void map_constructor_test(T* = 0, test::random_generator const& generator = test::default_generator)
|
||||
{
|
||||
std::cerr<<"map_constructor_test\n";
|
||||
|
||||
typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME T::key_type, BOOST_DEDUCED_TYPENAME T::mapped_type> > list;
|
||||
test::random_values<T> v(1000);
|
||||
test::random_values<T> v(1000, generator);
|
||||
list l(v.begin(), v.end());
|
||||
T x(l.begin(), l.end());
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void copy_construct_tests1(T*, test::random_generator const& generator = test::d
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<T> v(1000);
|
||||
test::random_values<T> v(1000, generator);
|
||||
|
||||
T x(v.begin(), v.end());
|
||||
T y(x);
|
||||
@@ -50,7 +50,7 @@ void copy_construct_tests1(T*, test::random_generator const& generator = test::d
|
||||
// is much lower than the load factor. The hash table is not allowed
|
||||
// to rehash, but the destination container should probably allocate
|
||||
// enough buckets to decrease the load factor appropriately.
|
||||
test::random_values<T> v(1000);
|
||||
test::random_values<T> v(1000, generator);
|
||||
T x(v.begin(), v.end());
|
||||
x.max_load_factor(x.load_factor() / 4);
|
||||
T y(x);
|
||||
@@ -95,7 +95,7 @@ void copy_construct_tests2(T* ptr, test::random_generator const& generator = tes
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<T> v(1000);
|
||||
test::random_values<T> v(1000, generator);
|
||||
|
||||
T x(v.begin(), v.end(), 0, hf, eq, al);
|
||||
T y(x);
|
||||
@@ -106,7 +106,7 @@ void copy_construct_tests2(T* ptr, test::random_generator const& generator = tes
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<T> v(500);
|
||||
test::random_values<T> v(500, generator);
|
||||
|
||||
T x(v.begin(), v.end(), 0, hf, eq, al);
|
||||
T y(x, al2);
|
||||
|
||||
@@ -34,13 +34,13 @@ void set_load_factor_tests(X* = 0)
|
||||
}
|
||||
|
||||
template <class X>
|
||||
void insert_test(X*, float mlf)
|
||||
void insert_test(X*, float mlf, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
X x;
|
||||
x.max_load_factor(mlf);
|
||||
float b = x.max_load_factor();
|
||||
|
||||
test::random_values<X> values(1000);
|
||||
test::random_values<X> values(1000, generator);
|
||||
|
||||
for(BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator
|
||||
it = values.begin(), end = values.end(); it != end; ++it)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace move_tests
|
||||
test::seed_t seed(98624);
|
||||
|
||||
template<class T>
|
||||
T empty(T* ptr) {
|
||||
T empty(T*) {
|
||||
return T();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace move_tests
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<T> v(1000);
|
||||
test::random_values<T> v(1000, generator);
|
||||
test::object_count count;
|
||||
T y(create(v, count));
|
||||
BOOST_CHECK(count == test::global_object_count);
|
||||
@@ -71,10 +71,10 @@ namespace move_tests
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void move_assign_tests1(T* ptr, test::random_generator const& generator = test::default_generator)
|
||||
void move_assign_tests1(T*, test::random_generator const& generator = test::default_generator)
|
||||
{
|
||||
{
|
||||
test::random_values<T> v(500);
|
||||
test::random_values<T> v(500, generator);
|
||||
test::object_count count;
|
||||
T y;
|
||||
y = create(v, count);
|
||||
@@ -85,11 +85,9 @@ namespace move_tests
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void move_construct_tests2(T* ptr,
|
||||
void move_construct_tests2(T*,
|
||||
test::random_generator const& generator = test::default_generator)
|
||||
{
|
||||
move_construct_tests1(ptr);
|
||||
|
||||
BOOST_DEDUCED_TYPENAME T::hasher hf(1);
|
||||
BOOST_DEDUCED_TYPENAME T::key_equal eq(1);
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al(1);
|
||||
@@ -98,7 +96,7 @@ namespace move_tests
|
||||
test::object_count count;
|
||||
|
||||
{
|
||||
test::random_values<T> v(500);
|
||||
test::random_values<T> v(500, generator);
|
||||
T y(create(v, count, hf, eq, al, 0.5));
|
||||
BOOST_CHECK(count == test::global_object_count);
|
||||
test::check_container(y, v);
|
||||
@@ -111,7 +109,7 @@ namespace move_tests
|
||||
|
||||
{
|
||||
// TODO: To do this correctly requires the fancy new allocator stuff.
|
||||
test::random_values<T> v(500);
|
||||
test::random_values<T> v(500, generator);
|
||||
T y(create(v, count, hf, eq, al, 2.0), al2);
|
||||
BOOST_CHECK(count != test::global_object_count);
|
||||
test::check_container(y, v);
|
||||
@@ -123,7 +121,7 @@ namespace move_tests
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<T> v(25);
|
||||
test::random_values<T> v(25, generator);
|
||||
T y(create(v, count, hf, eq, al, 1.0), al);
|
||||
#if defined(BOOST_HAS_RVALUE_REFS)
|
||||
BOOST_CHECK(count == test::global_object_count);
|
||||
|
||||
@@ -33,9 +33,9 @@ void rehash_empty_test1(X* = 0)
|
||||
}
|
||||
|
||||
template <class X>
|
||||
void rehash_test1(X* = 0)
|
||||
void rehash_test1(X* = 0, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
test::random_values<X> v(1000);
|
||||
test::random_values<X> v(1000, generator);
|
||||
test::ordered<X> tracker;
|
||||
tracker.insert_range(v.begin(), v.end());
|
||||
X x(v.begin(), v.end());
|
||||
|
||||
@@ -32,7 +32,7 @@ void swap_test_impl(X& x1, X& x2)
|
||||
}
|
||||
|
||||
template <class X>
|
||||
void swap_tests1(X* = 0)
|
||||
void swap_tests1(X*, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
{
|
||||
X x;
|
||||
@@ -45,14 +45,14 @@ void swap_tests1(X* = 0)
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<X> v(1000);
|
||||
test::random_values<X> v(1000, generator);
|
||||
X x, y(v.begin(), v.end());
|
||||
swap_test_impl(x, y);
|
||||
swap_test_impl(x, y);
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<X> vx(1000), vy(1000);
|
||||
test::random_values<X> vx(1000, generator), vy(1000, generator);
|
||||
X x(vx.begin(), vx.end()), y(vy.begin(), vy.end());
|
||||
swap_test_impl(x, y);
|
||||
swap_test_impl(x, y);
|
||||
@@ -60,7 +60,7 @@ void swap_tests1(X* = 0)
|
||||
}
|
||||
|
||||
template <class X>
|
||||
void swap_tests2(X* ptr = 0)
|
||||
void swap_tests2(X* ptr = 0, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
swap_tests1(ptr);
|
||||
|
||||
@@ -75,14 +75,14 @@ void swap_tests2(X* ptr = 0)
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<X> v(1000);
|
||||
test::random_values<X> v(1000, generator);
|
||||
X x(v.begin(), v.end(), 0, hasher(1), key_equal(1));
|
||||
X y(0, hasher(2), key_equal(2));
|
||||
swap_test_impl(x, y);
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<X> vx(100), vy(50);
|
||||
test::random_values<X> vx(100, generator), vy(50, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1));
|
||||
X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2));
|
||||
swap_test_impl(x, y);
|
||||
@@ -91,7 +91,7 @@ void swap_tests2(X* ptr = 0)
|
||||
|
||||
#if BOOST_UNORDERED_SWAP_METHOD == 1
|
||||
{
|
||||
test::random_values<X> vx(100), vy(50);
|
||||
test::random_values<X> vx(100, generator), vy(50, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(), key_equal(), allocator_type(1));
|
||||
X y(vy.begin(), vy.end(), 0, hasher(), key_equal(), allocator_type(2));
|
||||
try {
|
||||
@@ -101,14 +101,14 @@ void swap_tests2(X* ptr = 0)
|
||||
}
|
||||
#else
|
||||
{
|
||||
test::random_values<X> vx(50), vy(100);
|
||||
test::random_values<X> vx(50, generator), vy(100, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(), key_equal(), allocator_type(1));
|
||||
X y(vy.begin(), vy.end(), 0, hasher(), key_equal(), allocator_type(2));
|
||||
swap_test_impl(x, y);
|
||||
}
|
||||
|
||||
{
|
||||
test::random_values<X> vx(100), vy(100);
|
||||
test::random_values<X> vx(100, generator), vy(100, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1), allocator_type(1));
|
||||
X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2), allocator_type(2));
|
||||
swap_test_impl(x, y);
|
||||
|
||||
Reference in New Issue
Block a user