mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Add node-based foa containers to assign_tests
This commit is contained in:
@ -67,6 +67,21 @@ namespace boost {
|
||||
x = nullptr;
|
||||
}
|
||||
|
||||
template <class A>
|
||||
static void construct(A& al, storage_type* p, storage_type const& copy)
|
||||
{
|
||||
*p = boost::to_address(boost::allocator_allocate(al, 1));
|
||||
try {
|
||||
boost::allocator_construct(al, *p, *copy);
|
||||
} catch (...) {
|
||||
boost::allocator_deallocate(al,
|
||||
boost::pointer_traits<
|
||||
typename boost::allocator_pointer<A>::type>::pointer_to(**p),
|
||||
1);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
template <class A, class... Args>
|
||||
static void construct(A& al, storage_type* p, Args&&... args)
|
||||
{
|
||||
|
@ -53,6 +53,21 @@ namespace boost {
|
||||
x = nullptr;
|
||||
}
|
||||
|
||||
template <class A, class... Args>
|
||||
static void construct(A& al, storage_type* p, storage_type const& copy)
|
||||
{
|
||||
*p = boost::to_address(boost::allocator_allocate(al, 1));
|
||||
try {
|
||||
boost::allocator_construct(al, *p, *copy);
|
||||
} catch (...) {
|
||||
boost::allocator_deallocate(al,
|
||||
boost::pointer_traits<
|
||||
typename boost::allocator_pointer<A>::type>::pointer_to(**p),
|
||||
1);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
template <class A, class... Args>
|
||||
static void construct(A& al, storage_type* p, Args&&... args)
|
||||
{
|
||||
|
@ -209,40 +209,75 @@ namespace assign_tests {
|
||||
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||
test::equal_to, std::allocator<test::object> >* test_map_std_alloc;
|
||||
boost::unordered_node_map<test::object, test::object, test::hash,
|
||||
test::equal_to, std::allocator<test::object> >* test_node_map_std_alloc;
|
||||
|
||||
boost::unordered_flat_set<test::object, test::hash, test::equal_to,
|
||||
test::allocator1<test::object> >* test_set;
|
||||
boost::unordered_node_set<test::object, test::hash, test::equal_to,
|
||||
test::allocator1<test::object> >* test_node_set;
|
||||
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||
test::equal_to, test::allocator2<test::object> >* test_map;
|
||||
boost::unordered_node_map<test::object, test::object, test::hash,
|
||||
test::equal_to, test::allocator2<test::object> >* test_node_map;
|
||||
|
||||
boost::unordered_flat_set<test::object, test::hash, test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::propagate_assign> >*
|
||||
test_set_prop_assign;
|
||||
boost::unordered_node_set<test::object, test::hash, test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::propagate_assign> >*
|
||||
test_node_set_prop_assign;
|
||||
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||
test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::propagate_assign> >*
|
||||
test_map_prop_assign;
|
||||
boost::unordered_node_map<test::object, test::object, test::hash,
|
||||
test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::propagate_assign> >*
|
||||
test_node_map_prop_assign;
|
||||
|
||||
boost::unordered_flat_set<test::object, test::hash, test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::no_propagate_assign> >*
|
||||
test_set_no_prop_assign;
|
||||
boost::unordered_node_set<test::object, test::hash, test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::no_propagate_assign> >*
|
||||
test_node_set_no_prop_assign;
|
||||
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||
test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::no_propagate_assign> >*
|
||||
test_map_no_prop_assign;
|
||||
boost::unordered_node_map<test::object, test::object, test::hash,
|
||||
test::equal_to,
|
||||
test::cxx11_allocator<test::object, test::no_propagate_assign> >*
|
||||
test_node_map_no_prop_assign;
|
||||
|
||||
UNORDERED_AUTO_TEST (check_traits) {
|
||||
BOOST_TEST(!is_propagate(test_set));
|
||||
BOOST_TEST(is_propagate(test_set_prop_assign));
|
||||
BOOST_TEST(!is_propagate(test_set_no_prop_assign));
|
||||
|
||||
BOOST_TEST(!is_propagate(test_node_set));
|
||||
BOOST_TEST(is_propagate(test_node_set_prop_assign));
|
||||
BOOST_TEST(!is_propagate(test_node_set_no_prop_assign));
|
||||
}
|
||||
|
||||
UNORDERED_TEST(assign_tests1,
|
||||
((test_map_std_alloc)(test_set)(test_map)(test_set_prop_assign)(test_map_prop_assign)(test_set_no_prop_assign)(test_map_no_prop_assign))(
|
||||
((test_map_std_alloc)(test_node_map_std_alloc)
|
||||
(test_set)(test_node_set)
|
||||
(test_map)(test_node_map)
|
||||
(test_set_prop_assign)(test_node_set_prop_assign)
|
||||
(test_map_prop_assign)(test_node_map_prop_assign)
|
||||
(test_set_no_prop_assign)(test_node_set_no_prop_assign)
|
||||
(test_map_no_prop_assign)(test_node_map_no_prop_assign))(
|
||||
(default_generator)(generate_collisions)(limited_range)))
|
||||
|
||||
UNORDERED_TEST(assign_tests2,
|
||||
((test_set)(test_map)(test_set_prop_assign)(test_map_prop_assign)(test_set_no_prop_assign)(test_map_no_prop_assign))(
|
||||
((test_set)(test_node_set)
|
||||
(test_map)(test_node_map)
|
||||
(test_set_prop_assign)(test_node_set_prop_assign)
|
||||
(test_map_prop_assign)(test_node_map_prop_assign)
|
||||
(test_set_no_prop_assign)(test_node_set_no_prop_assign)
|
||||
(test_map_no_prop_assign)(test_node_map_no_prop_assign))(
|
||||
(default_generator)(generate_collisions)(limited_range)))
|
||||
#else
|
||||
boost::unordered_map<test::object, test::object, test::hash, test::equal_to,
|
||||
|
Reference in New Issue
Block a user