diff --git a/test/unordered/at_tests.cpp b/test/unordered/at_tests.cpp index b06dfddb..eddf1789 100644 --- a/test/unordered/at_tests.cpp +++ b/test/unordered/at_tests.cpp @@ -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 static void at_tests(X*) + { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Create Map" << std::endl; -#ifdef BOOST_UNORDERED_FOA_TESTS - boost::unordered_flat_map x; - boost::unordered_flat_map const& x_const(x); -#else - boost::unordered_map x; - boost::unordered_map 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* test_map; + static boost::unordered_node_map* test_node_map; + + // clang-format off + UNORDERED_TEST(at_tests, ((test_map)(test_node_map))) + // clang-format on +#else + static boost::unordered_map* test_map; + + // clang-format off + UNORDERED_TEST(at_tests, ((test_map))) + // clang-format on +#endif +} // namespace at_tests RUN_TESTS()