Fix the insert tests when there is a small number of buckets.

[SVN r55099]
This commit is contained in:
Daniel James
2009-07-22 22:37:52 +00:00
parent 6d1aece43a
commit 7bc588d8df

View File

@ -195,7 +195,7 @@ struct insert_test_rehash3 : public insert_test_base<T>
rehash_bucket_count = static_cast<size_type>(
ceil(original_bucket_count * (double) x.max_load_factor())) - 1;
size_type initial_elements = rehash_bucket_count - 5;
size_type initial_elements = rehash_bucket_count > 5 ? rehash_bucket_count - 5 : 1;
BOOST_TEST(initial_elements < this->values.size());
x.insert(this->values.begin(),