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:
Daniel James
2016-10-06 17:06:32 +01:00
parent 65aaf27380
commit 147885fec4
16 changed files with 115 additions and 94 deletions

View File

@@ -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