Add foa-based node containers to at_tests

This commit is contained in:
Christian Mazakas
2023-02-14 09:22:11 -08:00
parent 66ffbdb881
commit f1e1733c06

View File

@ -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()