mirror of
https://github.com/boostorg/unordered.git
synced 2025-10-19 10:55:29 +02:00
Add another random generation style.
This time for a more limited range of values so that equal values turn up more often. This is a bit shoddy, but seems like the best way to improve the existing tests without too much effort.
This commit is contained in:
@@ -23,7 +23,7 @@ namespace exception
|
||||
class hash;
|
||||
class equal_to;
|
||||
template <class T> class allocator;
|
||||
object generate(object const*);
|
||||
object generate(object const*, random_generator);
|
||||
|
||||
struct true_type
|
||||
{
|
||||
@@ -101,9 +101,9 @@ namespace exception
|
||||
(x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_);
|
||||
}
|
||||
|
||||
friend object generate(object const*) {
|
||||
friend object generate(object const*, random_generator g) {
|
||||
int* x = 0;
|
||||
return object(::test::generate(x), ::test::generate(x));
|
||||
return object(::test::generate(x, g), ::test::generate(x, g));
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& out, object const& o)
|
||||
@@ -590,8 +590,9 @@ namespace exception
|
||||
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
||||
namespace test
|
||||
{
|
||||
test::exception::object generate(test::exception::object const* x) {
|
||||
return test::exception::generate(x);
|
||||
test::exception::object generate(test::exception::object const* x,
|
||||
random_generator g) {
|
||||
return test::exception::generate(x, g);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user