forked from boostorg/unordered
Fix exception handling in rehash_impl
And improve tests so they will catch the error, and other similar errors.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user