diff --git a/test/helpers/invariants.hpp b/test/helpers/invariants.hpp index abb8fb1e..fec7ee65 100644 --- a/test/helpers/invariants.hpp +++ b/test/helpers/invariants.hpp @@ -82,16 +82,39 @@ namespace test } }; - // Finally, check that size matches up. + // Check that size matches up. + if(x1.size() != size) { BOOST_ERROR("x1.size() doesn't match actual size."); std::cout<(size) / static_cast(x1.bucket_count()); using namespace std; if(fabs(x1.load_factor() - load_factor) > x1.load_factor() / 64) BOOST_ERROR("x1.load_factor() doesn't match actual load_factor."); + + // Check that size in the buckets matches up. + + BOOST_DEDUCED_TYPENAME X::size_type bucket_size = 0; + + for (BOOST_DEDUCED_TYPENAME X::size_type + i = 0; i < x1.bucket_count(); ++i) + { + for (BOOST_DEDUCED_TYPENAME X::const_local_iterator + begin = x1.begin(i), end = x1.end(i); begin != end; ++begin) + { + ++bucket_size; + } + } + + if(x1.size() != bucket_size) { + BOOST_ERROR("x1.size() doesn't match bucket size."); + std::cout<