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

@ -10,11 +10,17 @@
namespace test namespace test
{ {
int generate(int const*); typedef enum {
char generate(char const*); default_generator,
signed char generate(signed char const*); generate_collisions,
std::string generate(std::string*); limited_range
float generate(float const*); } random_generator;
int generate(int const*, random_generator);
char generate(char const*, random_generator);
signed char generate(signed char const*, random_generator);
std::string generate(std::string const*, random_generator);
float generate(float const*, random_generator);
struct base_type {} base; struct base_type {} base;
struct derived_type : base_type {} derived; struct derived_type : base_type {} derived;

View File

@ -27,25 +27,32 @@ namespace test
} }
}; };
inline int generate(int const*) std::size_t random_value(std::size_t max) {
{
using namespace std; using namespace std;
return rand(); return static_cast<std::size_t>(rand()) % max;
} }
inline char generate(char const*) inline int generate(int const*, random_generator g)
{
using namespace std;
int value = rand();
if (g == limited_range) { value = value % 100; }
return value;
}
inline char generate(char const*, random_generator)
{ {
using namespace std; using namespace std;
return static_cast<char>((rand() >> 1) % (128-32) + 32); return static_cast<char>((rand() >> 1) % (128-32) + 32);
} }
inline signed char generate(signed char const*) inline signed char generate(signed char const*, random_generator)
{ {
using namespace std; using namespace std;
return static_cast<signed char>(rand()); return static_cast<signed char>(rand());
} }
inline std::string generate(std::string const*) inline std::string generate(std::string const*, random_generator g)
{ {
using namespace std; using namespace std;
@ -53,17 +60,30 @@ namespace test
std::string result; std::string result;
int length = rand() % 10; if (g == limited_range) {
for(int i = 0; i < length; ++i) std::size_t length = test::random_value(2) + 2;
result += generate(char_ptr);
char const* strings[] = { "'vZh(3~ms", "%m", "_Y%U", "N'Y", "4,J_J" };
for (std::size_t i = 0; i < length; ++i) {
result += strings[random_value(sizeof(strings) / sizeof(strings[0]))];
}
}
else {
std::size_t length = test::random_value(10) + 1;
for (std::size_t i = 0; i < length; ++i) {
result += generate(char_ptr, g);
}
}
return result; return result;
} }
float generate(float const*) float generate(float const*, random_generator g)
{ {
using namespace std; using namespace std;
return (float) rand() / (float) RAND_MAX; int x = 0;
int value = generate(&x, g);
return (float) value / (float) RAND_MAX;
} }
} }

View File

@ -14,11 +14,6 @@
namespace test namespace test
{ {
typedef enum {
default_generator,
generate_collisions
} random_generator;
template <class X> template <class X>
struct unordered_generator_set struct unordered_generator_set
{ {
@ -32,16 +27,15 @@ namespace test
template <class T> template <class T>
void fill(T& x, std::size_t len) { void fill(T& x, std::size_t len) {
value_type* value_ptr = 0; value_type* value_ptr = 0;
int* int_ptr = 0;
len += x.size(); len += x.size();
for (std::size_t i = 0; i < len; ++i) { for (std::size_t i = 0; i < len; ++i) {
value_type value = generate(value_ptr); value_type value = generate(value_ptr, type_);
int count = type_ == generate_collisions ? std::size_t count = type_ == generate_collisions ?
1 + (generate(int_ptr) % 5) : 1; random_value(5) + 1 : 1;
for(int j = 0; j < count; ++j) { for(std::size_t j = 0; j < count; ++j) {
x.push_back(value); x.push_back(value);
} }
} }
@ -63,17 +57,16 @@ namespace test
void fill(T& x, std::size_t len) { void fill(T& x, std::size_t len) {
key_type* key_ptr = 0; key_type* key_ptr = 0;
mapped_type* mapped_ptr = 0; mapped_type* mapped_ptr = 0;
int* int_ptr = 0;
for (std::size_t i = 0; i < len; ++i) { for (std::size_t i = 0; i < len; ++i) {
key_type key = generate(key_ptr); key_type key = generate(key_ptr, type_);
int count = type_ == generate_collisions ? std::size_t count = type_ == generate_collisions ?
1 + (generate(int_ptr) % 5) : 1; random_value(5) + 1 : 1;
for(int j = 0; j < count; ++j) { for(std::size_t j = 0; j < count; ++j) {
x.push_back(std::pair<key_type const, mapped_type>( x.push_back(std::pair<key_type const, mapped_type>(
key, generate(mapped_ptr))); key, generate(mapped_ptr, type_)));
} }
} }
} }

View File

@ -23,7 +23,7 @@ namespace exception
class hash; class hash;
class equal_to; class equal_to;
template <class T> class allocator; template <class T> class allocator;
object generate(object const*); object generate(object const*, random_generator);
struct true_type struct true_type
{ {
@ -101,9 +101,9 @@ namespace exception
(x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_); (x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_);
} }
friend object generate(object const*) { friend object generate(object const*, random_generator g) {
int* x = 0; 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) friend std::ostream& operator<<(std::ostream& out, object const& o)
@ -590,8 +590,9 @@ namespace exception
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
namespace test namespace test
{ {
test::exception::object generate(test::exception::object const* x) { test::exception::object generate(test::exception::object const* x,
return test::exception::generate(x); random_generator g) {
return test::exception::generate(x, g);
} }
} }
#endif #endif

View File

@ -25,9 +25,9 @@ namespace test
class equal_to; class equal_to;
template <class T> class allocator1; template <class T> class allocator1;
template <class T> class allocator2; template <class T> class allocator2;
object generate(object const*); object generate(object const*, random_generator);
movable generate(movable const*); movable generate(movable const*, random_generator);
implicitly_convertible generate(implicitly_convertible const*); implicitly_convertible generate(implicitly_convertible const*, random_generator);
inline void ignore_variable(void const*) {} inline void ignore_variable(void const*) {}
@ -58,9 +58,9 @@ namespace test
(x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_); (x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_);
} }
friend object generate(object const*) { friend object generate(object const*, random_generator g) {
int* x = 0; int* x = 0;
return object(generate(x), generate(x)); return object(generate(x, g), generate(x, g));
} }
friend std::ostream& operator<<(std::ostream& out, object const& o) friend std::ostream& operator<<(std::ostream& out, object const& o)
@ -133,9 +133,9 @@ namespace test
(x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_); (x1.tag1_ == x2.tag1_ && x1.tag2_ < x2.tag2_);
} }
friend movable generate(movable const*) { friend movable generate(movable const*, random_generator g) {
int* x = 0; int* x = 0;
return movable(generate(x), generate(x)); return movable(generate(x, g), generate(x, g));
} }
friend std::ostream& operator<<(std::ostream& out, movable const& o) friend std::ostream& operator<<(std::ostream& out, movable const& o)
@ -163,9 +163,9 @@ namespace test
return movable(tag1_, tag2_); return movable(tag1_, tag2_);
} }
friend implicitly_convertible generate(implicitly_convertible const*) { friend implicitly_convertible generate(implicitly_convertible const*, random_generator g) {
int* x = 0; int* x = 0;
return implicitly_convertible(generate(x), generate(x)); return implicitly_convertible(generate(x, g), generate(x, g));
} }
friend std::ostream& operator<<(std::ostream& out, implicitly_convertible const& o) friend std::ostream& operator<<(std::ostream& out, implicitly_convertible const& o)

View File

@ -236,6 +236,7 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
template <typename T> template <typename T>
bool is_propagate(T*) bool is_propagate(T*)
@ -256,7 +257,7 @@ UNORDERED_TEST(assign_tests1, (
(test_set_prop_assign)(test_multiset_prop_assign)(test_map_prop_assign)(test_multimap_prop_assign) (test_set_prop_assign)(test_multiset_prop_assign)(test_map_prop_assign)(test_multimap_prop_assign)
(test_set_no_prop_assign)(test_multiset_no_prop_assign)(test_map_no_prop_assign)(test_multimap_no_prop_assign) (test_set_no_prop_assign)(test_multiset_no_prop_assign)(test_map_no_prop_assign)(test_multimap_no_prop_assign)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(assign_tests2, ( UNORDERED_TEST(assign_tests2, (
@ -264,7 +265,7 @@ UNORDERED_TEST(assign_tests2, (
(test_set_prop_assign)(test_multiset_prop_assign)(test_map_prop_assign)(test_multimap_prop_assign) (test_set_prop_assign)(test_multiset_prop_assign)(test_map_prop_assign)(test_multimap_prop_assign)
(test_set_no_prop_assign)(test_multiset_no_prop_assign)(test_map_no_prop_assign)(test_multimap_no_prop_assign) (test_set_no_prop_assign)(test_multiset_no_prop_assign)(test_map_no_prop_assign)(test_multimap_no_prop_assign)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)

View File

@ -89,10 +89,11 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(tests, UNORDERED_TEST(tests,
((test_multimap_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)) ((test_multimap_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -418,20 +418,21 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(constructor_tests1, UNORDERED_TEST(constructor_tests1,
((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)) ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(constructor_tests2, UNORDERED_TEST(constructor_tests2,
((test_set)(test_multiset)(test_map)(test_multimap)) ((test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(map_constructor_test, UNORDERED_TEST(map_constructor_test,
((test_map_std_alloc)(test_map)(test_multimap)) ((test_map_std_alloc)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)

View File

@ -198,13 +198,14 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(copy_construct_tests1, ( UNORDERED_TEST(copy_construct_tests1, (
(test_set)(test_multiset)(test_map)(test_multimap) (test_set)(test_multiset)(test_map)(test_multimap)
(test_set_select_copy)(test_multiset_select_copy)(test_map_select_copy)(test_multimap_select_copy) (test_set_select_copy)(test_multiset_select_copy)(test_map_select_copy)(test_multimap_select_copy)
(test_set_no_select_copy)(test_multiset_no_select_copy)(test_map_no_select_copy)(test_multimap_no_select_copy) (test_set_no_select_copy)(test_multiset_no_select_copy)(test_map_no_select_copy)(test_multimap_no_select_copy)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(copy_construct_tests2, ( UNORDERED_TEST(copy_construct_tests2, (
@ -212,7 +213,7 @@ UNORDERED_TEST(copy_construct_tests2, (
(test_set_select_copy)(test_multiset_select_copy)(test_map_select_copy)(test_multimap_select_copy) (test_set_select_copy)(test_multiset_select_copy)(test_map_select_copy)(test_multimap_select_copy)
(test_set_no_select_copy)(test_multiset_no_select_copy)(test_map_no_select_copy)(test_multimap_no_select_copy) (test_set_no_select_copy)(test_multiset_no_select_copy)(test_map_no_select_copy)(test_multimap_no_select_copy)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -25,11 +25,6 @@ namespace erase_tests
test::seed_t initialize_seed(85638); test::seed_t initialize_seed(85638);
std::size_t random_value(std::size_t max) {
using namespace std;
return static_cast<std::size_t>(rand()) % max;
}
template <class Container> template <class Container>
void erase_tests1(Container*, test::random_generator generator) void erase_tests1(Container*, test::random_generator generator)
{ {
@ -90,7 +85,7 @@ void erase_tests1(Container*, test::random_generator generator)
int iterations = 0; int iterations = 0;
while(size > 0 && !x.empty()) while(size > 0 && !x.empty())
{ {
std::size_t index = random_value(x.size()); std::size_t index = test::random_value(x.size());
c_iterator prev, pos, next; c_iterator prev, pos, next;
if(index == 0) { if(index == 0) {
prev = pos = x.begin(); prev = pos = x.begin();
@ -163,8 +158,8 @@ void erase_tests1(Container*, test::random_generator generator)
iterators.push_back(x.cend()); iterators.push_back(x.cend());
while(iterators.size() > 1) { while(iterators.size() > 1) {
std::size_t start = random_value(iterators.size()); std::size_t start = test::random_value(iterators.size());
std::size_t length = random_value(iterators.size() - start); std::size_t length = test::random_value(iterators.size() - start);
x.erase(iterators[start], iterators[start + length]); x.erase(iterators[start], iterators[start + length]);
iterators.erase( iterators.erase(
boost::next(iterators.begin(), boost::next(iterators.begin(),
@ -219,7 +214,7 @@ void erase_tests1(Container*, test::random_generator generator)
int iterations = 0; int iterations = 0;
while(size > 0 && !x.empty()) while(size > 0 && !x.empty())
{ {
std::size_t index = random_value(x.size()); std::size_t index = test::random_value(x.size());
BOOST_DEDUCED_TYPENAME Container::const_iterator prev, pos, next; BOOST_DEDUCED_TYPENAME Container::const_iterator prev, pos, next;
if(index == 0) { if(index == 0) {
prev = pos = x.begin(); prev = pos = x.begin();
@ -278,10 +273,11 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(erase_tests1, UNORDERED_TEST(erase_tests1,
((test_set)(test_multiset)(test_map)(test_multimap)) ((test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -155,14 +155,15 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(find_tests1, UNORDERED_TEST(find_tests1,
((test_set)(test_multiset)(test_map)(test_multimap)) ((test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(find_compatible_keys_test, UNORDERED_TEST(find_compatible_keys_test,
((test_set)(test_multiset)(test_map)(test_multimap)) ((test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -24,11 +24,6 @@ namespace insert_tests {
test::seed_t initialize_seed(243432); test::seed_t initialize_seed(243432);
std::size_t random_value(std::size_t max) {
using namespace std;
return static_cast<std::size_t>(rand()) % max;
}
template <class X> template <class X>
void unique_insert_tests1(X*, test::random_generator generator) void unique_insert_tests1(X*, test::random_generator generator)
{ {
@ -319,7 +314,7 @@ void insert_tests2(X*, test::random_generator generator)
BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
next = it; next = it;
for (std::size_t j = random_value(20); j > 0; ++j) { for (std::size_t j = test::random_value(20); j > 0; ++j) {
++next; ++next;
if (next == v.end()) { break; } if (next == v.end()) { break; }
} }
@ -566,57 +561,58 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(unique_insert_tests1, UNORDERED_TEST(unique_insert_tests1,
((test_set_std_alloc)(test_set)(test_map)) ((test_set_std_alloc)(test_set)(test_map))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(equivalent_insert_tests1, UNORDERED_TEST(equivalent_insert_tests1,
((test_multimap_std_alloc)(test_multiset)(test_multimap)) ((test_multimap_std_alloc)(test_multiset)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(insert_tests2, UNORDERED_TEST(insert_tests2,
((test_multimap_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)) ((test_multimap_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(unique_emplace_tests1, UNORDERED_TEST(unique_emplace_tests1,
((test_set_std_alloc)(test_set)(test_map)) ((test_set_std_alloc)(test_set)(test_map))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(equivalent_emplace_tests1, UNORDERED_TEST(equivalent_emplace_tests1,
((test_multimap_std_alloc)(test_multiset)(test_multimap)) ((test_multimap_std_alloc)(test_multiset)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(move_emplace_tests, UNORDERED_TEST(move_emplace_tests,
((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map) ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)
(test_multiset)(test_multimap)) (test_multiset)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(default_emplace_tests, UNORDERED_TEST(default_emplace_tests,
((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map) ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)
(test_multiset)(test_multimap)) (test_multiset)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(map_tests, UNORDERED_TEST(map_tests,
((test_map)) ((test_map))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(map_insert_range_test1, UNORDERED_TEST(map_insert_range_test1,
((test_multimap_std_alloc)(test_map)(test_multimap)) ((test_multimap_std_alloc)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(map_insert_range_test2, UNORDERED_TEST(map_insert_range_test2,
((test_multimap_std_alloc)(test_map)(test_multimap)) ((test_multimap_std_alloc)(test_map)(test_multimap))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)

View File

@ -78,6 +78,7 @@ boost::unordered_multimap<int, int>* int_multimap_ptr;
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(set_load_factor_tests, UNORDERED_TEST(set_load_factor_tests,
((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
@ -85,7 +86,7 @@ UNORDERED_TEST(set_load_factor_tests,
UNORDERED_TEST(load_factor_insert_tests, UNORDERED_TEST(load_factor_insert_tests,
((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -369,6 +369,7 @@ boost::unordered_multimap<test::object, test::object,
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(move_construct_tests1, ( UNORDERED_TEST(move_construct_tests1, (
(test_map_std_alloc) (test_map_std_alloc)
@ -376,7 +377,7 @@ boost::unordered_multimap<test::object, test::object,
(test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move) (test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)
(test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move) (test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(move_assign_tests1, ( UNORDERED_TEST(move_assign_tests1, (
(test_map_std_alloc) (test_map_std_alloc)
@ -384,21 +385,21 @@ boost::unordered_multimap<test::object, test::object,
(test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move) (test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)
(test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move) (test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(move_construct_tests2, ( UNORDERED_TEST(move_construct_tests2, (
(test_set)(test_multiset)(test_map)(test_multimap) (test_set)(test_multiset)(test_map)(test_multimap)
(test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move) (test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)
(test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move) (test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(move_assign_tests2, ( UNORDERED_TEST(move_assign_tests2, (
(test_set)(test_multiset)(test_map)(test_multimap) (test_set)(test_multiset)(test_map)(test_multimap)
(test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move) (test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)
(test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move) (test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)(test_multimap_no_prop_move)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -208,21 +208,22 @@ boost::unordered_multimap<int, int>* int_multimap_ptr;
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_TEST(rehash_empty_test1, UNORDERED_TEST(rehash_empty_test1,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
) )
UNORDERED_TEST(rehash_empty_test2, UNORDERED_TEST(rehash_empty_test2,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(rehash_empty_test3, UNORDERED_TEST(rehash_empty_test3,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(rehash_test1, UNORDERED_TEST(rehash_test1,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(reserve_empty_test1, UNORDERED_TEST(reserve_empty_test1,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
@ -232,11 +233,11 @@ UNORDERED_TEST(reserve_empty_test2,
) )
UNORDERED_TEST(reserve_test1, UNORDERED_TEST(reserve_test1,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(reserve_test2, UNORDERED_TEST(reserve_test2,
((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr)) ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }

View File

@ -206,6 +206,7 @@ bool is_propagate(T*)
using test::default_generator; using test::default_generator;
using test::generate_collisions; using test::generate_collisions;
using test::limited_range;
UNORDERED_AUTO_TEST(check_traits) UNORDERED_AUTO_TEST(check_traits)
{ {
@ -220,7 +221,7 @@ UNORDERED_TEST(swap_tests1, (
(test_set_prop_swap)(test_multiset_prop_swap)(test_map_prop_swap)(test_multimap_prop_swap) (test_set_prop_swap)(test_multiset_prop_swap)(test_map_prop_swap)(test_multimap_prop_swap)
(test_set_no_prop_swap)(test_multiset_no_prop_swap)(test_map_no_prop_swap)(test_multimap_no_prop_swap) (test_set_no_prop_swap)(test_multiset_no_prop_swap)(test_map_no_prop_swap)(test_multimap_no_prop_swap)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
UNORDERED_TEST(swap_tests2, ( UNORDERED_TEST(swap_tests2, (
@ -228,7 +229,7 @@ UNORDERED_TEST(swap_tests2, (
(test_set_prop_swap)(test_multiset_prop_swap)(test_map_prop_swap)(test_multimap_prop_swap) (test_set_prop_swap)(test_multiset_prop_swap)(test_map_prop_swap)(test_multimap_prop_swap)
(test_set_no_prop_swap)(test_multiset_no_prop_swap)(test_map_no_prop_swap)(test_multimap_no_prop_swap) (test_set_no_prop_swap)(test_multiset_no_prop_swap)(test_map_no_prop_swap)(test_multimap_no_prop_swap)
) )
((default_generator)(generate_collisions)) ((default_generator)(generate_collisions)(limited_range))
) )
} }