Merge latest unordered developments:

Make simple_test test a little more.
Use doubles for calculating max load factor.
Some workarounds, mostly for Borland and running the tests.


[SVN r42666]
This commit is contained in:
Daniel James committed 2008-01-10 22:30:46 +00:00
1 parent 488bce194c
commit 9d7411840e
31 files changed
+458 -508

No files matched your search

+2 -2
View File
@@ -42,8 +42,8 @@ struct assign_base : public test::exception_base
assign_base(unsigned int count1, unsigned int count2, int tag1, int tag2)
: x_values(count1), y_values(count2),
x(x_values.begin(), x_values.end(), 0, typename T::hasher(tag1), typename T::key_equal(tag1), typename T::allocator_type(tag1)),
y(y_values.begin(), y_values.end(), 0, typename T::hasher(tag2), typename T::key_equal(tag2), typename T::allocator_type(tag2)) {}
x(x_values.begin(), x_values.end(), 0, BOOST_DEDUCED_TYPENAME T::hasher(tag1), BOOST_DEDUCED_TYPENAME T::key_equal(tag1), BOOST_DEDUCED_TYPENAME T::allocator_type(tag1)),
y(y_values.begin(), y_values.end(), 0, BOOST_DEDUCED_TYPENAME T::hasher(tag2), BOOST_DEDUCED_TYPENAME T::key_equal(tag2), BOOST_DEDUCED_TYPENAME T::allocator_type(tag2)) {}
typedef T data_type;
T init() const { return T(x); }
+1 -1
View File
@@ -42,7 +42,7 @@ struct erase_by_key_test1 : public erase_test_base<T>
{
void run(T& x) const
{
typedef typename test::random_values<T>::const_iterator iterator;
typedef BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator iterator;
for(iterator it = this->values.begin(), end = this->values.end();
it != end; ++it)
+17 -17
View File
@@ -43,10 +43,10 @@ struct insert_test_base : public test::exception_base
template <class T>
struct insert_test1 : public insert_test_base<T>
{
typedef typename insert_test_base<T>::strong_type strong_type;
typedef BOOST_DEDUCED_TYPENAME insert_test_base<T>::strong_type strong_type;
void run(T& x, strong_type& strong) const {
for(typename test::random_values<T>::const_iterator
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = this->values.begin(), end = this->values.end(); it != end; ++it)
{
strong.store(x);
@@ -58,10 +58,10 @@ struct insert_test1 : public insert_test_base<T>
template <class T>
struct insert_test2 : public insert_test_base<T>
{
typedef typename insert_test_base<T>::strong_type strong_type;
typedef BOOST_DEDUCED_TYPENAME insert_test_base<T>::strong_type strong_type;
void run(T& x, strong_type& strong) const {
for(typename test::random_values<T>::const_iterator
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = this->values.begin(), end = this->values.end(); it != end; ++it)
{
strong.store(x);
@@ -85,10 +85,10 @@ struct insert_test3 : public insert_test_base<T>
template <class T>
struct insert_test4 : public insert_test_base<T>
{
typedef typename insert_test_base<T>::strong_type strong_type;
typedef BOOST_DEDUCED_TYPENAME insert_test_base<T>::strong_type strong_type;
void run(T& x, strong_type& strong) const {
for(typename test::random_values<T>::const_iterator
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = this->values.begin(), end = this->values.end(); it != end; ++it)
{
strong.store(x);
@@ -100,12 +100,12 @@ struct insert_test4 : public insert_test_base<T>
template <class T>
struct insert_test_rehash1 : public insert_test_base<T>
{
typedef typename insert_test_base<T>::strong_type strong_type;
typedef BOOST_DEDUCED_TYPENAME insert_test_base<T>::strong_type strong_type;
insert_test_rehash1() : insert_test_base<T>(1000) {}
T init() const {
typedef typename T::size_type size_type;
typedef BOOST_DEDUCED_TYPENAME T::size_type size_type;
T x;
x.max_load_factor(0.25);
@@ -120,11 +120,11 @@ struct insert_test_rehash1 : public insert_test_base<T>
}
void run(T& x, strong_type& strong) const {
typename T::size_type bucket_count = x.bucket_count();
BOOST_DEDUCED_TYPENAME T::size_type bucket_count = x.bucket_count();
int count = 0;
typename T::const_iterator pos = x.cbegin();
BOOST_DEDUCED_TYPENAME T::const_iterator pos = x.cbegin();
for(typename test::random_values<T>::const_iterator
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = boost::next(this->values.begin(), x.size()), end = this->values.end();
it != end && count < 10; ++it, ++count)
{
@@ -141,13 +141,13 @@ struct insert_test_rehash1 : public insert_test_base<T>
template <class T>
struct insert_test_rehash2 : public insert_test_rehash1<T>
{
typedef typename insert_test_base<T>::strong_type strong_type;
typedef BOOST_DEDUCED_TYPENAME insert_test_base<T>::strong_type strong_type;
void run(T& x, strong_type& strong) const {
typename T::size_type bucket_count = x.bucket_count();
BOOST_DEDUCED_TYPENAME T::size_type bucket_count = x.bucket_count();
int count = 0;
for(typename test::random_values<T>::const_iterator
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = boost::next(this->values.begin(), x.size()), end = this->values.end();
it != end && count < 10; ++it, ++count)
{
@@ -164,12 +164,12 @@ struct insert_test_rehash2 : public insert_test_rehash1<T>
template <class T>
struct insert_test_rehash3 : public insert_test_base<T>
{
typename T::size_type mutable rehash_bucket_count, original_bucket_count;
BOOST_DEDUCED_TYPENAME T::size_type mutable rehash_bucket_count, original_bucket_count;
insert_test_rehash3() : insert_test_base<T>(1000) {}
T init() const {
typedef typename T::size_type size_type;
typedef BOOST_DEDUCED_TYPENAME T::size_type size_type;
T x;
x.max_load_factor(0.25);
@@ -188,7 +188,7 @@ struct insert_test_rehash3 : public insert_test_base<T>
}
void run(T& x) const {
typename T::size_type bucket_count = x.bucket_count();
BOOST_DEDUCED_TYPENAME T::size_type bucket_count = x.bucket_count();
x.insert(boost::next(this->values.begin(), x.size()),
boost::next(this->values.begin(), x.size() + 20));
+4 -4
View File
@@ -54,10 +54,10 @@ struct swap_base : public test::exception_base
swap_base(unsigned int count1, unsigned int count2, int tag1, int tag2)
: x_values(count1), y_values(count2),
initial_x(x_values.begin(), x_values.end(), 0, typename T::hasher(tag1),
typename T::key_equal(tag1), typename T::allocator_type(tag1)),
initial_y(y_values.begin(), y_values.end(), 0, typename T::hasher(tag2),
typename T::key_equal(tag2), typename T::allocator_type(tag2))
initial_x(x_values.begin(), x_values.end(), 0, BOOST_DEDUCED_TYPENAME T::hasher(tag1),
BOOST_DEDUCED_TYPENAME T::key_equal(tag1), BOOST_DEDUCED_TYPENAME T::allocator_type(tag1)),
initial_y(y_values.begin(), y_values.end(), 0, BOOST_DEDUCED_TYPENAME T::hasher(tag2),
BOOST_DEDUCED_TYPENAME T::key_equal(tag2), BOOST_DEDUCED_TYPENAME T::allocator_type(tag2))
{}
struct data_type {