forked from boostorg/unordered
Add foa-based node containers to at_tests
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
|
||||
// Copyright 2007-2009 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)
|
||||
|
||||
@ -11,16 +11,12 @@
|
||||
|
||||
namespace at_tests {
|
||||
|
||||
UNORDERED_AUTO_TEST (at_tests) {
|
||||
template <class X> static void at_tests(X*)
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Create Map" << std::endl;
|
||||
|
||||
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||
boost::unordered_flat_map<std::string, int> x;
|
||||
boost::unordered_flat_map<std::string, int> const& x_const(x);
|
||||
#else
|
||||
boost::unordered_map<std::string, int> x;
|
||||
boost::unordered_map<std::string, int> const& x_const(x);
|
||||
#endif
|
||||
X x;
|
||||
X const& x_const(x);
|
||||
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Check empty container" << std::endl;
|
||||
|
||||
@ -64,6 +60,21 @@ namespace at_tests {
|
||||
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Finished" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOOST_UNORDERED_FOA_TESTS
|
||||
static boost::unordered_flat_map<std::string, int>* test_map;
|
||||
static boost::unordered_node_map<std::string, int>* test_node_map;
|
||||
|
||||
// clang-format off
|
||||
UNORDERED_TEST(at_tests, ((test_map)(test_node_map)))
|
||||
// clang-format on
|
||||
#else
|
||||
static boost::unordered_map<std::string, int>* test_map;
|
||||
|
||||
// clang-format off
|
||||
UNORDERED_TEST(at_tests, ((test_map)))
|
||||
// clang-format on
|
||||
#endif
|
||||
} // namespace at_tests
|
||||
|
||||
RUN_TESTS()
|
||||
|
Reference in New Issue
Block a user