mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 20:04:29 +02:00
Unordered: Count instances in some tests.
[SVN r73754]
This commit is contained in:
@@ -75,6 +75,13 @@ namespace test {
|
||||
namespace {
|
||||
object_count& global_object_count = globally_counted_object::count_;
|
||||
}
|
||||
|
||||
struct check_instances {
|
||||
int instances;
|
||||
|
||||
check_instances() : instances(global_object_count.instances) {}
|
||||
~check_instances() { BOOST_TEST(global_object_count.instances == instances); }
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -28,6 +28,8 @@ void assign_tests1(T*,
|
||||
|
||||
std::cerr<<"assign_tests1.1\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x;
|
||||
x = x;
|
||||
BOOST_TEST(x.empty());
|
||||
@@ -37,6 +39,8 @@ void assign_tests1(T*,
|
||||
|
||||
std::cerr<<"assign_tests1.2\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
T x(v.begin(), v.end());
|
||||
|
||||
@@ -67,6 +71,8 @@ void assign_tests2(T*,
|
||||
|
||||
std::cerr<<"assign_tests2.1\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
T x1(v.begin(), v.end(), 0, hf1, eq1);
|
||||
T x2(0, hf2, eq2);
|
||||
@@ -78,6 +84,8 @@ void assign_tests2(T*,
|
||||
|
||||
std::cerr<<"assign_tests2.2\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v1(100, generator), v2(100, generator);
|
||||
T x1(v1.begin(), v1.end(), 0, hf1, eq1, al1);
|
||||
T x2(v2.begin(), v2.end(), 0, hf2, eq2, al2);
|
||||
|
@@ -25,6 +25,8 @@ test::seed_t seed(54635);
|
||||
template <class X>
|
||||
void tests(X* = 0, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
|
||||
test::random_values<X> v(1000, generator);
|
||||
|
@@ -31,6 +31,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 1\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(0, hf, eq);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf));
|
||||
@@ -41,6 +43,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 2\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(100, hf);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 100);
|
||||
@@ -52,6 +56,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 3\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(2000);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 2000);
|
||||
@@ -63,6 +69,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 4\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x;
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf));
|
||||
@@ -73,6 +81,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 5\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
T x(v.begin(), v.end(), 10000, hf, eq);
|
||||
BOOST_TEST(x.bucket_count() >= 10000);
|
||||
@@ -85,6 +95,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 6\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(10, generator);
|
||||
T x(v.begin(), v.end(), 10000, hf);
|
||||
BOOST_TEST(x.bucket_count() >= 10000);
|
||||
@@ -97,6 +109,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 7\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(v.begin(), v.end(), 100);
|
||||
BOOST_TEST(x.bucket_count() >= 100);
|
||||
@@ -109,6 +123,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 8\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1, generator);
|
||||
T x(v.begin(), v.end());
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf));
|
||||
@@ -120,6 +136,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 9\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(0, hf, eq, al);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf));
|
||||
@@ -130,6 +148,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 10\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
T x(v.begin(), v.end(), 10000, hf, eq, al);
|
||||
BOOST_TEST(x.bucket_count() >= 10000);
|
||||
@@ -142,6 +162,8 @@ void constructor_tests1(T*,
|
||||
|
||||
std::cerr<<"Construct 11\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(al);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf));
|
||||
@@ -167,6 +189,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 1\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
T x(10000, hf1, eq1);
|
||||
BOOST_TEST(x.bucket_count() >= 10000);
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf1));
|
||||
@@ -177,6 +200,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 2\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
T x(100, hf1);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 100);
|
||||
@@ -188,6 +212,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 3\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(v.begin(), v.end(), 0, hf1, eq1);
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf1));
|
||||
@@ -199,6 +224,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 4\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(5, generator);
|
||||
T x(v.begin(), v.end(), 1000, hf1);
|
||||
BOOST_TEST(x.bucket_count() >= 1000);
|
||||
@@ -212,6 +238,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 5\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(v.begin(), v.end(), 0, hf, eq, al1);
|
||||
T y(x.begin(), x.end(), 0, hf1, eq1, al2);
|
||||
@@ -223,6 +250,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 6\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(v.begin(), v.end(), 0, hf1, eq1);
|
||||
T y(x.begin(), x.end(), 0, hf, eq);
|
||||
@@ -234,6 +262,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 7\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(v.begin(), v.end(), 0, hf1, eq1);
|
||||
T y(x.begin(), x.end(), 0, hf2, eq2);
|
||||
@@ -245,6 +274,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 8 - from input iterator\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
|
||||
v_begin = v.begin(), v_end = v.end();
|
||||
@@ -262,6 +292,7 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 8.5 - from copy iterator\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(test::copy_iterator(v.begin()),
|
||||
test::copy_iterator(v.end()), 0, hf1, eq1);
|
||||
@@ -275,6 +306,8 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Construct 9\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(100, generator);
|
||||
T x(50);
|
||||
BOOST_TEST(x.bucket_count() >= 50);
|
||||
@@ -291,6 +324,8 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Initializer list construct 1\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(list);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(test::equivalent(x.hash_function(), hf));
|
||||
@@ -300,6 +335,8 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Initializer list construct 2\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(list, 1000);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 1000);
|
||||
@@ -310,6 +347,8 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Initializer list construct 3\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(list, 10, hf1);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 10);
|
||||
@@ -320,6 +359,8 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Initializer list construct 4\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(list, 10, hf1, eq1);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 10);
|
||||
@@ -330,6 +371,8 @@ void constructor_tests2(T*,
|
||||
|
||||
std::cerr<<"Initializer list construct 5\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(list, 10, hf1, eq1, al1);
|
||||
BOOST_TEST(x.empty());
|
||||
BOOST_TEST(x.bucket_count() >= 10);
|
||||
|
@@ -28,6 +28,8 @@ void copy_construct_tests1(T*,
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x;
|
||||
T y(x);
|
||||
BOOST_TEST(y.empty());
|
||||
@@ -39,6 +41,8 @@ void copy_construct_tests1(T*,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
|
||||
T x(v.begin(), v.end());
|
||||
@@ -49,6 +53,8 @@ void copy_construct_tests1(T*,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
// In this test I drop the original containers max load factor, so it
|
||||
// is much lower than the load factor. The hash table is not allowed
|
||||
// to rehash, but the destination container should probably allocate
|
||||
@@ -77,6 +83,8 @@ void copy_construct_tests2(T* ptr,
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al2(2);
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(10000, hf, eq, al);
|
||||
T y(x);
|
||||
BOOST_TEST(y.empty());
|
||||
@@ -88,6 +96,8 @@ void copy_construct_tests2(T* ptr,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T x(1000, hf, eq, al);
|
||||
T y(x, al2);
|
||||
BOOST_TEST(y.empty());
|
||||
@@ -99,6 +109,8 @@ void copy_construct_tests2(T* ptr,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
|
||||
T x(v.begin(), v.end(), 0, hf, eq, al);
|
||||
@@ -110,6 +122,8 @@ void copy_construct_tests2(T* ptr,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(500, generator);
|
||||
|
||||
T x(v.begin(), v.end(), 0, hf, eq, al);
|
||||
|
@@ -28,6 +28,8 @@ void erase_tests1(Container*,
|
||||
{
|
||||
std::cerr<<"Erase by key.\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
for(BOOST_DEDUCED_TYPENAME test::random_values<Container>::iterator
|
||||
@@ -44,6 +46,8 @@ void erase_tests1(Container*,
|
||||
|
||||
std::cerr<<"erase(begin()).\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
std::size_t size = x.size();
|
||||
@@ -64,6 +68,8 @@ void erase_tests1(Container*,
|
||||
|
||||
std::cerr<<"erase(random position).\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
std::size_t size = x.size();
|
||||
@@ -96,6 +102,8 @@ void erase_tests1(Container*,
|
||||
|
||||
std::cerr<<"erase(ranges).\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(500, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
|
||||
@@ -118,6 +126,8 @@ void erase_tests1(Container*,
|
||||
|
||||
std::cerr<<"quick_erase(begin()).\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
std::size_t size = x.size();
|
||||
@@ -136,6 +146,8 @@ void erase_tests1(Container*,
|
||||
|
||||
std::cerr<<"quick_erase(random position).\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(1000, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
std::size_t size = x.size();
|
||||
@@ -169,6 +181,8 @@ void erase_tests1(Container*,
|
||||
|
||||
std::cerr<<"clear().\n";
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<Container> v(500, generator);
|
||||
Container x(v.begin(), v.end());
|
||||
x.clear();
|
||||
|
@@ -24,6 +24,8 @@ void find_tests1(X*, test::random_generator generator = test::default_generator)
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> v(500, generator);
|
||||
X x(v.begin(), v.end());
|
||||
X const& x_const = x;
|
||||
@@ -69,6 +71,8 @@ void find_tests1(X*, test::random_generator generator = test::default_generator)
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
|
||||
test::random_values<X> v2(5, generator);
|
||||
|
@@ -26,6 +26,8 @@ template <class X>
|
||||
void unique_insert_tests1(X*,
|
||||
test::random_generator generator = test::default_generator)
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
|
||||
typedef test::ordered<X> ordered;
|
||||
|
||||
@@ -65,6 +67,9 @@ void equivalent_insert_tests1(X*,
|
||||
{
|
||||
std::cerr<<"insert(value) tests for containers with equivalent keys.\n";
|
||||
|
||||
test::check_instances check_;
|
||||
|
||||
|
||||
X x;
|
||||
test::ordered<X> tracker = test::create_ordered(x);
|
||||
|
||||
@@ -102,6 +107,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert(begin(), value) tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
@@ -128,6 +135,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert(end(), value) tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
X const& x_const = x;
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
@@ -155,6 +164,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert(pos, value) tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
const_iterator pos = x.begin();
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
@@ -182,6 +193,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert single item range tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
tracker_type tracker = test::create_ordered(x);
|
||||
|
||||
@@ -207,6 +220,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert range tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
@@ -219,6 +234,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert input iterator range tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
@@ -233,6 +250,8 @@ void insert_tests2(X*,
|
||||
std::cerr<<"insert copy iterator range tests.\n";
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
@@ -351,6 +370,8 @@ void map_insert_range_test1(X*,
|
||||
{
|
||||
std::cerr<<"map_insert_range_test1\n";
|
||||
|
||||
test::check_instances check_;
|
||||
|
||||
typedef test::list<
|
||||
std::pair<
|
||||
BOOST_DEDUCED_TYPENAME X::key_type,
|
||||
@@ -371,6 +392,8 @@ void map_insert_range_test2(X*,
|
||||
{
|
||||
std::cerr<<"map_insert_range_test2\n";
|
||||
|
||||
test::check_instances check_;
|
||||
|
||||
typedef test::list<
|
||||
std::pair<BOOST_DEDUCED_TYPENAME X::key_type const, test::implicitly_convertible>
|
||||
> list;
|
||||
|
@@ -54,6 +54,8 @@ namespace move_tests
|
||||
BOOST_DEDUCED_TYPENAME T::allocator_type al;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
T y(empty(ptr));
|
||||
BOOST_TEST(y.empty());
|
||||
BOOST_TEST(test::equivalent(y.hash_function(), hf));
|
||||
@@ -64,6 +66,8 @@ namespace move_tests
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(1000, generator);
|
||||
test::object_count count;
|
||||
T y(create(v, count));
|
||||
@@ -80,6 +84,8 @@ namespace move_tests
|
||||
test::random_generator const& generator = test::default_generator)
|
||||
{
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(500, generator);
|
||||
test::object_count count;
|
||||
T y;
|
||||
@@ -104,6 +110,8 @@ namespace move_tests
|
||||
test::object_count count;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(500, generator);
|
||||
T y(create(v, count, hf, eq, al, 0.5));
|
||||
#if defined(BOOST_HAS_NRVO)
|
||||
@@ -118,6 +126,8 @@ namespace move_tests
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
// TODO: To do this correctly requires the fancy new allocator
|
||||
// stuff.
|
||||
test::random_values<T> v(500, generator);
|
||||
@@ -132,6 +142,8 @@ namespace move_tests
|
||||
}
|
||||
/*
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<T> v(25, generator);
|
||||
T y(create(v, count, hf, eq, al, 1.0), al);
|
||||
#if !defined(BOOST_NO_RVALUE_REFERENCES)
|
||||
|
@@ -37,16 +37,22 @@ template <class X>
|
||||
void swap_tests1(X*, test::random_generator generator = test::default_generator)
|
||||
{
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x;
|
||||
swap_test_impl(x, x);
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x,y;
|
||||
swap_test_impl(x, y);
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
X x, y(v.begin(), v.end());
|
||||
swap_test_impl(x, y);
|
||||
@@ -54,6 +60,8 @@ void swap_tests1(X*, test::random_generator generator = test::default_generator)
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> vx(1000, generator), vy(1000, generator);
|
||||
X x(vx.begin(), vx.end()), y(vy.begin(), vy.end());
|
||||
swap_test_impl(x, y);
|
||||
@@ -72,12 +80,16 @@ void swap_tests2(X* ptr = 0,
|
||||
typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
X x(0, hasher(1), key_equal(1));
|
||||
X y(0, hasher(2), key_equal(2));
|
||||
swap_test_impl(x, y);
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> v(1000, generator);
|
||||
X x(v.begin(), v.end(), 0, hasher(1), key_equal(1));
|
||||
X y(0, hasher(2), key_equal(2));
|
||||
@@ -85,6 +97,8 @@ void swap_tests2(X* ptr = 0,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> vx(100, generator), vy(50, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1));
|
||||
X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2));
|
||||
@@ -93,6 +107,8 @@ void swap_tests2(X* ptr = 0,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> vx(50, generator), vy(100, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(), key_equal(), allocator_type(1));
|
||||
X y(vy.begin(), vy.end(), 0, hasher(), key_equal(), allocator_type(2));
|
||||
@@ -100,6 +116,8 @@ void swap_tests2(X* ptr = 0,
|
||||
}
|
||||
|
||||
{
|
||||
test::check_instances check_;
|
||||
|
||||
test::random_values<X> vx(100, generator), vy(100, generator);
|
||||
X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1),
|
||||
allocator_type(1));
|
||||
|
Reference in New Issue
Block a user