|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2008-06-01 14:00:55
Author: danieljames
Date: 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
New Revision: 46031
URL: http://svn.boost.org/trac/boost/changeset/46031
Log:
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.
........
................
Added:
trunk/libs/unordered/doc/diagrams/buckets.svg
- copied unchanged from r46030, /branches/unordered/trunk/libs/unordered/doc/diagrams/buckets.svg
Removed:
trunk/libs/unordered/doc/diagrams/buckets.dia
Properties modified:
trunk/ (props changed)
Binary files modified:
trunk/libs/unordered/doc/diagrams/buckets.png
Text files modified:
trunk/boost/unordered/detail/hash_table_impl.hpp | 19 +++++---
trunk/libs/unordered/doc/Jamfile.v2 | 33 +++++++++++++++
trunk/libs/unordered/doc/bibliography.xml | 4
trunk/libs/unordered/doc/buckets.qbk | 88 +++++++++++++++++++++++----------------
trunk/libs/unordered/doc/hash_equality.qbk | 4
trunk/libs/unordered/doc/unordered.qbk | 10 ++++
trunk/libs/unordered/test/exception/Jamfile.v2 | 2
trunk/libs/unordered/test/helpers/exception_test.hpp | 2
trunk/libs/unordered/test/objects/memory.hpp | 4
trunk/libs/unordered/test/unordered/Jamfile.v2 | 2
trunk/libs/unordered/test/unordered/bucket_tests.cpp | 4
trunk/libs/unordered/test/unordered/compile_tests.hpp | 2
trunk/libs/unordered/test/unordered/constructor_tests.cpp | 4
trunk/libs/unordered/test/unordered/copy_tests.cpp | 8 +-
trunk/libs/unordered/test/unordered/load_factor_tests.cpp | 4
trunk/libs/unordered/test/unordered/move_tests.cpp | 18 +++----
trunk/libs/unordered/test/unordered/rehash_tests.cpp | 4
trunk/libs/unordered/test/unordered/swap_tests.cpp | 18 ++++----
18 files changed, 146 insertions(+), 84 deletions(-)
Modified: trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ trunk/boost/unordered/detail/hash_table_impl.hpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -1648,6 +1648,7 @@
#if BOOST_UNORDERED_EQUIVALENT_KEYS
+#if !(defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL))
// Insert (equivalent key containers)
// if hash function throws, basic exception safety
@@ -1676,7 +1677,8 @@
return insert_hint_impl(it, a);
}
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#else
+
// Insert (equivalent key containers)
// (I'm using an overloaded insert for both 'insert' and 'emplace')
@@ -1850,6 +1852,8 @@
}
}
+#if !(defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL))
+
// Insert (unique keys)
// if hash function throws, basic exception safety
@@ -1902,7 +1906,8 @@
return insert(v).first;
}
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+#else
+
// Insert (unique keys)
// (I'm using an overloaded insert for both 'insert' and 'emplace')
//
@@ -1949,10 +1954,8 @@
// Nothing after this point can throw.
- link_ptr n = data_.link_node_in_bucket(a, bucket);
-
- return std::pair<iterator_base, bool>(
- iterator_base(bucket, n), true);
+ return std::pair<iterator_base, bool>(iterator_base(bucket,
+ data_.link_node_in_bucket(a, bucket)), true);
}
}
@@ -1993,7 +1996,7 @@
// if hash function throws, basic exception safety
// strong otherwise
template<typename... Args>
- iterator_base insert_hint(iterator_base const& it, Args&&... args)
+ iterator_base insert_hint(iterator_base const&, Args&&... args)
{
// Life is complicated - just call the normal implementation.
return insert(std::forward<Args>(args)...).first;
@@ -2148,7 +2151,7 @@
return it1 == end1 && it2 == end2;
}
#else
- static inline bool group_equals(link_ptr it1, link_ptr it2,
+ static inline bool group_equals(link_ptr, link_ptr,
type_wrapper<key_type>*)
{
return true;
Modified: trunk/libs/unordered/doc/Jamfile.v2
==============================================================================
--- trunk/libs/unordered/doc/Jamfile.v2 (original)
+++ trunk/libs/unordered/doc/Jamfile.v2 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -3,6 +3,9 @@
# 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)
+path-constant images_location : ../ ;
+path-constant admonishment_location : ../../../../doc/src/images ;
+
xml unordered : unordered.qbk ;
boostbook standalone : unordered :
<xsl:param>admon.graphics.path=images/
@@ -16,8 +19,38 @@
<xsl:param>toc.section.depth=1
<xsl:param>toc.max.depth=1
+ <xsl:param>boost.compact.typedef=0
+ <xsl:param>boost.compact.function=0
+ <xsl:param>boost.compact.enum=0
+
<dependency>css
<dependency>images
+
+ # PDF Options:
+ # TOC Generation: this is needed for FOP-0.9 and later:
+ <xsl:param>fop1.extensions=0
+ <format>pdf:<xsl:param>xep.extensions=1
+ # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
+ <format>pdf:<xsl:param>fop.extensions=0
+ # No indent on body text:
+ <format>pdf:<xsl:param>body.start.indent=0pt
+ # Margin size:
+ <format>pdf:<xsl:param>page.margin.inner=0.5in
+ # Margin size:
+ <format>pdf:<xsl:param>page.margin.outer=0.5in
+ # Paper type = A4
+ <format>pdf:<xsl:param>paper.type=A4
+ # Yes, we want graphics for admonishments:
+ <xsl:param>admon.graphics=1
+ # Set this one for PDF generation *only*:
+ # default png graphics are awful in PDF form,
+ # better use SVG's instead:
+ <format>pdf:<xsl:param>admon.graphics.extension=".svg"
+ <format>pdf:<xsl:param>use.role.for.mediaobject=1
+ <format>pdf:<xsl:param>preferred.mediaobject.role=print
+ <format>pdf:<xsl:param>img.src.path=$(images_location)/
+ #<format>pdf:<xsl:param>admon.graphics.path=$(admonishment_location)
+ <format>pdf:<xsl:param>draft.mode="no"
;
install css : [ glob $(BOOST_ROOT)/doc/src/*.css ]
Modified: trunk/libs/unordered/doc/bibliography.xml
==============================================================================
--- trunk/libs/unordered/doc/bibliography.xml (original)
+++ trunk/libs/unordered/doc/bibliography.xml 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -1,6 +1,6 @@
-<section id="unordered.bibliography" label="Bibliography">
+<section id="unordered.bibliography">
+<title>Bibliography</title>
<bibliography>
- <title>Bibliography</title>
<biblioentry>
<biblioset relation="journal">
<title>C/C++ Users Journal</title>
Modified: trunk/libs/unordered/doc/buckets.qbk
==============================================================================
--- trunk/libs/unordered/doc/buckets.qbk (original)
+++ trunk/libs/unordered/doc/buckets.qbk 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -10,7 +10,7 @@
`B`, `C`, `D` and `E` (this is just for illustration, containers will typically
have more buckets).
-[$../../libs/unordered/doc/diagrams/buckets.png]
+[diagram buckets]
In order to decide which bucket to place an element in, the container applies
the hash function, `Hash`, to the element's key (for `unordered_set` and
@@ -35,37 +35,53 @@
the search slower. This is known as a collision. To keep things fast we try to
keep collisions to a minimum.
-[table Methods for Accessing Buckets
- [[Method] [Description]]
-
- [
- [``size_type bucket_count() const``]
- [The number of buckets.]
- ]
- [
- [``size_type max_bucket_count() const``]
- [An upper bound on the number of buckets.]
- ]
- [
- [``size_type bucket_size(size_type n) const``]
- [The number of elements in bucket `n`.]
- ]
- [
- [``size_type bucket(key_type const& k) const``]
- [Returns the index of the bucket which would contain k]
- ]
- [
- [``
- local_iterator begin(size_type n);
- local_iterator end(size_type n);
- const_local_iterator begin(size_type n) const;
- const_local_iterator end(size_type n) const;
- const_local_iterator cbegin(size_type n) const;
- const_local_iterator cend(size_type n) const;
- ``]
- [Return begin and end iterators for bucket `n`.]
- ]
-]
+'''
+<table frame="all"><title>Methods for Accessing Buckets</title>
+ <tgroup cols="2">
+ <thead><row>
+ <entry><para>Method</para></entry>
+ <entry><para>Description</para></entry>
+ </row></thead>
+ <tbody>
+ <row>
+ <entry>'''`size_type bucket_count() const`'''</entry>
+ <entry>'''The number of buckets.'''</entry>
+ </row>
+ <row>
+ <entry>'''`size_type max_bucket_count() const`'''</entry>
+ <entry>'''An upper bound on the number of buckets.'''</entry>
+ </row>
+ <row>
+ <entry>'''`size_type bucket_size(size_type n) const`'''</entry>
+ <entry>'''The number of elements in bucket `n`.'''</entry>
+ </row>
+ <row>
+ <entry>'''`size_type bucket(key_type const& k) const`'''</entry>
+ <entry>'''Returns the index of the bucket which would contain k'''</entry>
+ </row>
+ <row>
+ <entry>'''`local_iterator begin(size_type n);`'''</entry>
+ <entry morerows='5'>'''Return begin and end iterators for bucket `n`.'''</entry>
+ </row>
+ <row>
+ <entry>'''`local_iterator end(size_type n);`'''</entry>
+ </row>
+ <row>
+ <entry>'''`const_local_iterator begin(size_type n) const;`'''</entry>
+ </row>
+ <row>
+ <entry>'''`const_local_iterator end(size_type n) const;`'''</entry>
+ </row>
+ <row>
+ <entry>'''`const_local_iterator cbegin(size_type n) const;`'''</entry>
+ </row>
+ <row>
+ <entry>'''`const_local_iterator cend(size_type n) const;`'''</entry>
+ </row>
+ </tbody>
+ </tgroup>
+</table>
+'''
[h2 Controlling the number of buckets]
@@ -100,19 +116,19 @@
[[Method] [Description]]
[
- [``float load_factor() const``]
+ [`float load_factor() const`]
[The average number of elements per bucket.]
]
[
- [``float max_load_factor() const``]
+ [`float max_load_factor() const`]
[Returns the current maximum load factor.]
]
[
- [``float max_load_factor(float z)``]
+ [`float max_load_factor(float z)`]
[Changes the container's maximum load factor, using `z` as a hint.]
]
[
- [``void rehash(size_type n)``]
+ [`void rehash(size_type n)`]
[Changes the number of buckets so that there at least n buckets, and
so that the load factor is less than the maximum load factor.]
]
Deleted: trunk/libs/unordered/doc/diagrams/buckets.dia
==============================================================================
Binary file. No diff available.
Modified: trunk/libs/unordered/doc/diagrams/buckets.png
==============================================================================
Binary files. No diff available.
Modified: trunk/libs/unordered/doc/hash_equality.qbk
==============================================================================
--- trunk/libs/unordered/doc/hash_equality.qbk (original)
+++ trunk/libs/unordered/doc/hash_equality.qbk 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -63,11 +63,11 @@
[[Method] [Description]]
[
- [``hasher hash_function() const``]
+ [`hasher hash_function() const`]
[Returns the container's hash function.]
]
[
- [``key_equal key_eq() const``]
+ [`key_equal key_eq() const`]
[Returns the container's key equality function.]
]
]
Modified: trunk/libs/unordered/doc/unordered.qbk
==============================================================================
--- trunk/libs/unordered/doc/unordered.qbk (original)
+++ trunk/libs/unordered/doc/unordered.qbk 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -17,6 +17,16 @@
]
]
+[template diagram[name] '''<inlinemediaobject>
+<imageobject role="html">
+<imagedata align = "center" fileref="../../libs/unordered/doc/diagrams/'''[name]'''.png"></imagedata>
+</imageobject>
+<imageobject role="print">
+<imagedata align = "center" fileref="../../libs/unordered/doc/diagrams/'''[name]'''.svg"></imagedata>
+</imageobject>
+</inlinemediaobject>''']
+
+
[include:unordered intro.qbk]
[include:unordered buckets.qbk]
[include:unordered hash_equality.qbk]
Modified: trunk/libs/unordered/test/exception/Jamfile.v2
==============================================================================
--- trunk/libs/unordered/test/exception/Jamfile.v2 (original)
+++ trunk/libs/unordered/test/exception/Jamfile.v2 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -11,7 +11,7 @@
project unordered-test/exception-tests
: requirements
<toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
- <toolset>gcc:<cxxflags>-Wsign-promo
+ <toolset>gcc:<cxxflags>"-Wsign-promo -Wunused-parameter"
;
test-suite unordered-exception
Modified: trunk/libs/unordered/test/helpers/exception_test.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/exception_test.hpp (original)
+++ trunk/libs/unordered/test/helpers/exception_test.hpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -210,7 +210,7 @@
}
template <class Test>
- void exception_safety(Test const& f, char const* name) {
+ void exception_safety(Test const& f, char const* /*name*/) {
test_runner<Test> runner(f);
iteration = 0;
Modified: trunk/libs/unordered/test/objects/memory.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/memory.hpp (original)
+++ trunk/libs/unordered/test/objects/memory.hpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -153,12 +153,12 @@
if(count_allocations > 0) --count_allocations;
}
- void track_construct(void* ptr, std::size_t /*size*/, int tag)
+ void track_construct(void* /*ptr*/, std::size_t /*size*/, int /*tag*/)
{
++count_constructions;
}
- void track_destroy(void* ptr, std::size_t /*size*/, int tag)
+ void track_destroy(void* /*ptr*/, std::size_t /*size*/, int /*tag*/)
{
BOOST_CHECK(count_constructions > 0);
if(count_constructions > 0) --count_constructions;
Modified: trunk/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- trunk/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ trunk/libs/unordered/test/unordered/Jamfile.v2 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -8,7 +8,7 @@
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
;
Modified: trunk/libs/unordered/test/unordered/bucket_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/bucket_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/bucket_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -16,11 +16,11 @@
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());
Modified: trunk/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- trunk/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ trunk/libs/unordered/test/unordered/compile_tests.hpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -149,6 +149,8 @@
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);
Modified: trunk/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/constructor_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -253,12 +253,12 @@
}
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());
Modified: trunk/libs/unordered/test/unordered/copy_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/copy_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/copy_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -36,7 +36,7 @@
}
{
- 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 @@
// 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 @@
}
{
- 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 @@
}
{
- 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);
Modified: trunk/libs/unordered/test/unordered/load_factor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/load_factor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/load_factor_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -34,13 +34,13 @@
}
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)
Modified: trunk/libs/unordered/test/unordered/move_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/move_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/move_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -17,7 +17,7 @@
test::seed_t seed(98624);
template<class T>
- T empty(T* ptr) {
+ T empty(T*) {
return T();
}
@@ -61,7 +61,7 @@
}
{
- 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 @@
}
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 @@
}
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 @@
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 @@
{
// 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 @@
}
{
- 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);
Modified: trunk/libs/unordered/test/unordered/rehash_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/rehash_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/rehash_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -33,9 +33,9 @@
}
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());
Modified: trunk/libs/unordered/test/unordered/swap_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/swap_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/swap_tests.cpp 2008-06-01 14:00:53 EDT (Sun, 01 Jun 2008)
@@ -32,7 +32,7 @@
}
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 @@
}
{
- 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 @@
}
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 @@
}
{
- 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 @@
#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 @@
}
#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);
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