mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Add node-based foa containers to insert_hint_tests
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
|
||||
// Copyright 2016 Daniel James.
|
||||
// Copyright 2022 Christian Mazakas.
|
||||
// Copyright 2022-2023 Christian Mazakas.
|
||||
// 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)
|
||||
|
||||
@ -88,12 +88,11 @@ namespace insert_hint {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
UNORDERED_AUTO_TEST (insert_hint_unique) {
|
||||
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||
typedef boost::unordered_flat_set<int> container;
|
||||
#else
|
||||
typedef boost::unordered_set<int> container;
|
||||
#endif
|
||||
|
||||
template <class X> static void insert_hint_unique_impl()
|
||||
{
|
||||
typedef X container;
|
||||
|
||||
container x;
|
||||
x.insert(x.cbegin(), 10);
|
||||
BOOST_TEST_EQ(x.size(), 1u);
|
||||
@ -101,12 +100,19 @@ namespace insert_hint {
|
||||
test::check_equivalent_keys(x);
|
||||
}
|
||||
|
||||
UNORDERED_AUTO_TEST (insert_hint_unique_single) {
|
||||
UNORDERED_AUTO_TEST (insert_hint_unique) {
|
||||
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||
typedef boost::unordered_flat_set<int> container;
|
||||
insert_hint_unique_impl<boost::unordered_flat_set<int> >();
|
||||
insert_hint_unique_impl<boost::unordered_node_set<int> >();
|
||||
#else
|
||||
typedef boost::unordered_set<int> container;
|
||||
insert_hint_unique_impl<boost::unordered_set<int> >();
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class X> static void insert_hint_unique_single_impl()
|
||||
{
|
||||
typedef X container;
|
||||
|
||||
container x;
|
||||
x.insert(10);
|
||||
|
||||
@ -121,6 +127,15 @@ namespace insert_hint {
|
||||
BOOST_TEST_EQ(x.count(20), 1u);
|
||||
test::check_equivalent_keys(x);
|
||||
}
|
||||
}
|
||||
|
||||
UNORDERED_AUTO_TEST (insert_hint_unique_single) {
|
||||
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||
insert_hint_unique_single_impl<boost::unordered_flat_set<int> >();
|
||||
insert_hint_unique_single_impl<boost::unordered_node_set<int> >();
|
||||
#else
|
||||
insert_hint_unique_single_impl<boost::unordered_set<int> >();
|
||||
#endif
|
||||
}
|
||||
} // namespace insert_hint
|
||||
|
||||
RUN_TESTS()
|
||||
|
Reference in New Issue
Block a user