Fix exception handling in rehash_impl

And improve tests so they will catch the error, and other similar errors.
This commit is contained in:
Daniel James
2017-05-04 19:30:18 +01:00
parent d49d0e90a8
commit 47a8c3fc67
10 changed files with 268 additions and 36 deletions

View File

@@ -6,6 +6,8 @@
#include "./containers.hpp"
#include "../helpers/random_values.hpp"
#include "../helpers/invariants.hpp"
#include "../helpers/tracker.hpp"
template <typename T> inline void avoid_unused_warning(T const&) {}
@@ -18,7 +20,8 @@ template <class T> struct copy_test1 : public test::exception_base
void run() const
{
T y(x);
avoid_unused_warning(y);
BOOST_TEST(y.empty());
test::check_equivalent_keys(y);
}
};
@@ -32,7 +35,8 @@ template <class T> struct copy_test2 : public test::exception_base
void run() const
{
T y(x);
avoid_unused_warning(y);
test::check_container(y, this->values);
test::check_equivalent_keys(y);
}
};
@@ -46,7 +50,8 @@ template <class T> struct copy_test3 : public test::exception_base
void run() const
{
T y(x);
avoid_unused_warning(y);
test::check_container(y, this->values);
test::check_equivalent_keys(y);
}
};
@@ -61,7 +66,8 @@ template <class T> struct copy_with_allocator_test : public test::exception_base
void run() const
{
T y(x, allocator);
avoid_unused_warning(y);
test::check_container(y, this->values);
test::check_equivalent_keys(y);
}
};