From 7bc588d8df44d79c91f62e203abb33781a1a3004 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 22 Jul 2009 22:37:52 +0000 Subject: [PATCH] Fix the insert tests when there is a small number of buckets. [SVN r55099] --- test/exception/insert_exception_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/exception/insert_exception_tests.cpp b/test/exception/insert_exception_tests.cpp index c44d56ba..acb47b48 100644 --- a/test/exception/insert_exception_tests.cpp +++ b/test/exception/insert_exception_tests.cpp @@ -195,7 +195,7 @@ struct insert_test_rehash3 : public insert_test_base rehash_bucket_count = static_cast( 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(),