mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Add copy_tests
This commit is contained in:
@ -79,6 +79,16 @@ namespace boost {
|
|||||||
this->insert(first, last);
|
this->insert(first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unordered_flat_map(unordered_flat_map const& other) : table_(other.table_)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
unordered_flat_map(
|
||||||
|
unordered_flat_map const& other, allocator_type const& a)
|
||||||
|
: table_(other.table_, a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
unordered_flat_map(std::initializer_list<value_type> ilist,
|
unordered_flat_map(std::initializer_list<value_type> ilist,
|
||||||
size_type n = 0, hasher const& h = hasher(),
|
size_type n = 0, hasher const& h = hasher(),
|
||||||
key_equal const& pred = key_equal(),
|
key_equal const& pred = key_equal(),
|
||||||
|
@ -78,6 +78,16 @@ namespace boost {
|
|||||||
this->insert(first, last);
|
this->insert(first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unordered_flat_set(unordered_flat_set const& other) : table_(other.table_)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
unordered_flat_set(
|
||||||
|
unordered_flat_set const& other, allocator_type const& a)
|
||||||
|
: table_(other.table_, a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
unordered_flat_set(std::initializer_list<value_type> ilist,
|
unordered_flat_set(std::initializer_list<value_type> ilist,
|
||||||
size_type n = 0, hasher const& h = hasher(),
|
size_type n = 0, hasher const& h = hasher(),
|
||||||
key_equal const& pred = key_equal(),
|
key_equal const& pred = key_equal(),
|
||||||
|
@ -50,6 +50,7 @@ run unordered/equivalent_keys_tests.cpp ;
|
|||||||
run unordered/constructor_tests.cpp ;
|
run unordered/constructor_tests.cpp ;
|
||||||
run unordered/constructor_tests.cpp : : : $(CPP14) <define>BOOST_UNORDERED_FOA_TESTS : foa_constructor_tests ;
|
run unordered/constructor_tests.cpp : : : $(CPP14) <define>BOOST_UNORDERED_FOA_TESTS : foa_constructor_tests ;
|
||||||
run unordered/copy_tests.cpp ;
|
run unordered/copy_tests.cpp ;
|
||||||
|
run unordered/copy_tests.cpp : : : $(CPP14) <define>BOOST_UNORDERED_FOA_TESTS : foa_copy_tests ;
|
||||||
run unordered/move_tests.cpp ;
|
run unordered/move_tests.cpp ;
|
||||||
run unordered/assign_tests.cpp ;
|
run unordered/assign_tests.cpp ;
|
||||||
run unordered/insert_tests.cpp ;
|
run unordered/insert_tests.cpp ;
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
|
|
||||||
// Copyright 2006-2009 Daniel James.
|
// Copyright 2006-2009 Daniel James.
|
||||||
|
// Copyright (C) 2022 Christian Mazakas
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
#include "../helpers/prefix.hpp"
|
#include "../helpers/prefix.hpp"
|
||||||
|
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||||
|
#include <boost/unordered_flat_set.hpp>
|
||||||
|
#include <boost/unordered_flat_map.hpp>
|
||||||
|
#else
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
#endif
|
||||||
#include "../helpers/postfix.hpp"
|
#include "../helpers/postfix.hpp"
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
#include "../helpers/test.hpp"
|
#include "../helpers/test.hpp"
|
||||||
#include "../objects/test.hpp"
|
#include "../objects/test.hpp"
|
||||||
@ -229,6 +233,38 @@ namespace copy_tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using test::default_generator;
|
||||||
|
using test::generate_collisions;
|
||||||
|
using test::limited_range;
|
||||||
|
|
||||||
|
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||||
|
boost::unordered_flat_set<test::object, test::hash, test::equal_to,
|
||||||
|
test::allocator1<test::object> >* test_set;
|
||||||
|
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||||
|
test::equal_to, test::allocator1<test::object> >* test_map;
|
||||||
|
|
||||||
|
boost::unordered_flat_set<test::object, test::hash, test::equal_to,
|
||||||
|
test::cxx11_allocator<test::object, test::select_copy> >*
|
||||||
|
test_set_select_copy;
|
||||||
|
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||||
|
test::equal_to, test::cxx11_allocator<test::object, test::select_copy> >*
|
||||||
|
test_map_select_copy;
|
||||||
|
|
||||||
|
boost::unordered_flat_set<test::object, test::hash, test::equal_to,
|
||||||
|
test::cxx11_allocator<test::object, test::no_select_copy> >*
|
||||||
|
test_set_no_select_copy;
|
||||||
|
boost::unordered_flat_map<test::object, test::object, test::hash,
|
||||||
|
test::equal_to, test::cxx11_allocator<test::object, test::no_select_copy> >*
|
||||||
|
test_map_no_select_copy;
|
||||||
|
|
||||||
|
UNORDERED_TEST(copy_construct_tests1,
|
||||||
|
((test_set)(test_map)(test_set_select_copy)(test_map_select_copy)(test_set_no_select_copy)(test_map_no_select_copy))(
|
||||||
|
(default_generator)(generate_collisions)(limited_range)))
|
||||||
|
|
||||||
|
UNORDERED_TEST(copy_construct_tests2,
|
||||||
|
((test_set)(test_map)(test_set_select_copy)(test_map_select_copy)(test_set_no_select_copy)(test_map_no_select_copy))(
|
||||||
|
(default_generator)(generate_collisions)(limited_range)))
|
||||||
|
#else
|
||||||
boost::unordered_set<test::object, test::hash, test::equal_to,
|
boost::unordered_set<test::object, test::hash, test::equal_to,
|
||||||
test::allocator1<test::object> >* test_set;
|
test::allocator1<test::object> >* test_set;
|
||||||
boost::unordered_multiset<test::object, test::hash, test::equal_to,
|
boost::unordered_multiset<test::object, test::hash, test::equal_to,
|
||||||
@ -264,25 +300,14 @@ namespace copy_tests {
|
|||||||
test::equal_to, test::cxx11_allocator<test::object, test::no_select_copy> >*
|
test::equal_to, test::cxx11_allocator<test::object, test::no_select_copy> >*
|
||||||
test_multimap_no_select_copy;
|
test_multimap_no_select_copy;
|
||||||
|
|
||||||
using test::default_generator;
|
|
||||||
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_select_copy)(
|
((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_no_select_copy)(test_multiset_no_select_copy)(test_map_no_select_copy)(test_multimap_no_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))(
|
|
||||||
(default_generator)(generate_collisions)(limited_range)))
|
(default_generator)(generate_collisions)(limited_range)))
|
||||||
|
|
||||||
UNORDERED_TEST(copy_construct_tests2,
|
UNORDERED_TEST(copy_construct_tests2,
|
||||||
((test_set)(test_multiset)(test_map)(test_multimap)(test_set_select_copy)(
|
((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_no_select_copy)(test_multiset_no_select_copy)(test_map_no_select_copy)(test_multimap_no_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))(
|
|
||||||
(default_generator)(generate_collisions)(limited_range)))
|
(default_generator)(generate_collisions)(limited_range)))
|
||||||
}
|
#endif
|
||||||
|
} // namespace copy_tests
|
||||||
|
|
||||||
RUN_TESTS()
|
RUN_TESTS()
|
||||||
|
Reference in New Issue
Block a user