Fix more warnings

This commit is contained in:
Daniel James
2016-10-11 10:07:07 +01:00
parent ade302f0a0
commit a316d3fa46
5 changed files with 26 additions and 20 deletions

View File

@@ -17,7 +17,7 @@ template <class T>
struct insert_test_base : public test::exception_base
{
test::random_values<T> values;
insert_test_base(unsigned int count = 5) : values(count) {}
insert_test_base(unsigned int count = 5) : values(count, test::limited_range) {}
typedef T data_type;
typedef test::strong<T> strong_type;
@@ -136,7 +136,7 @@ struct insert_test_rehash1 : public insert_test_base<T>
ceil((double) bucket_count * (double) x.max_load_factor()) - 1);
BOOST_TEST(initial_elements < this->values.size());
x.insert(this->values.begin(),
boost::next(this->values.begin(), initial_elements));
this->values.begin() + initial_elements);
BOOST_TEST(bucket_count == x.bucket_count());
return x;
}
@@ -147,8 +147,7 @@ struct insert_test_rehash1 : public insert_test_base<T>
BOOST_DEDUCED_TYPENAME T::const_iterator pos = x.cbegin();
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = boost::next(this->values.begin(), x.size()),
end = this->values.end();
it = this->values.begin() + x.size(), end = this->values.end();
it != end && count < 10; ++it, ++count)
{
strong.store(x, test::detail::tracker.count_allocations);
@@ -171,7 +170,7 @@ struct insert_test_rehash2 : public insert_test_rehash1<T>
int count = 0;
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
it = boost::next(this->values.begin(), x.size()),
it = this->values.begin(), x.size()),
end = this->values.end();
it != end && count < 10; ++it, ++count)
{
@@ -208,8 +207,7 @@ struct insert_test_rehash3 : public insert_test_base<T>
rehash_bucket_count > 5 ? rehash_bucket_count - 5 : 1;
BOOST_TEST(initial_elements < this->values.size());
x.insert(this->values.begin(),
boost::next(this->values.begin(), initial_elements));
x.insert(this->values.begin(), this->values.begin() + initial_elements);
BOOST_TEST(original_bucket_count == x.bucket_count());
return x;
}
@@ -217,8 +215,8 @@ struct insert_test_rehash3 : public insert_test_base<T>
void run(T& x) const {
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));
x.insert(this->values.begin() + x.size(),
this->values.begin() + x.size() + 20);
// This isn't actually a failure, but it means the test isn't doing its
// job.