]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/unordered/test/exception/copy_exception_tests.cpp
2 // Copyright 2006-2009 Daniel James.
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include "./containers.hpp"
8 #include "../helpers/invariants.hpp"
9 #include "../helpers/random_values.hpp"
10 #include "../helpers/tracker.hpp"
12 template <typename T
> inline void avoid_unused_warning(T
const&) {}
14 test::seed_t
initialize_seed(73041);
16 template <class T
> struct copy_test1
: public test::exception_base
25 BOOST_TEST(y
.empty());
26 test::check_equivalent_keys(y
);
30 template <class T
> struct copy_test2
: public test::exception_base
32 test::random_values
<T
> values
;
35 copy_test2() : values(5, test::limited_range
), x(values
.begin(), values
.end())
44 test::check_container(y
, this->values
);
45 test::check_equivalent_keys(y
);
49 template <class T
> struct copy_test3
: public test::exception_base
51 test::random_values
<T
> values
;
54 copy_test3() : values(100), x(values
.begin(), values
.end()) {}
61 test::check_container(y
, this->values
);
62 test::check_equivalent_keys(y
);
66 template <class T
> struct copy_test3a
: public test::exception_base
68 test::random_values
<T
> values
;
72 : values(100, test::limited_range
), x(values
.begin(), values
.end())
81 test::check_container(y
, this->values
);
82 test::check_equivalent_keys(y
);
86 template <class T
> struct copy_with_allocator_test
: public test::exception_base
88 test::random_values
<T
> values
;
90 test::exception::allocator
<test::exception::object
> allocator
;
92 copy_with_allocator_test() : values(100), x(values
.begin(), values
.end()) {}
99 test::check_container(y
, this->values
);
100 test::check_equivalent_keys(y
);
106 (copy_test1
)(copy_test2
)(copy_test3
)(copy_test3a
)(copy_with_allocator_test
),