Add scoped_allocator tests

This commit is contained in:
Christian Mazakas
2022-10-14 11:02:05 -07:00
parent e3c91ad812
commit 14c190223c
2 changed files with 14 additions and 1 deletions

View File

@ -126,6 +126,7 @@ build_foa load_factor_tests ;
build_foa rehash_tests ;
build_foa equality_tests ;
build_foa swap_tests ;
run unordered/scoped_allocator.cpp : : : <cxxstd>98:<build>no <cxxstd>03:<build>no <cxxstd>0x:<build>no <toolset>msvc-14.0:<build>no <define>BOOST_UNORDERED_FOA_TESTS : foa_scoped_allocator ;
build_foa transparent_tests ;
build_foa reserve_tests ;
build_foa contains_tests ;

View File

@ -21,8 +21,14 @@ int main() {}
// clang-format off
#include "../helpers/prefix.hpp"
#ifdef BOOST_UNORDERED_FOA_TESTS
#include <boost/unordered_flat_set.hpp>
#include <boost/unordered_flat_map.hpp>
#include <boost/unordered/detail/implementation.hpp>
#else
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#endif
#include "../helpers/postfix.hpp"
// clang-format on
@ -32,10 +38,10 @@ int main() {}
#include <boost/core/ignore_unused.hpp>
#include <scoped_allocator>
#include <string>
#include <utility>
#include <vector>
#include <scoped_allocator>
namespace test {
template <class T> struct allocator
@ -70,9 +76,15 @@ typedef std::scoped_allocator_adaptor<test::allocator<pair_type>,
test::allocator<boost::uint64_t> >
allocator_type;
#ifdef BOOST_UNORDERED_FOA_TESTS
typedef boost::unordered_flat_map<const boost::uint64_t, vector_type,
boost::hash<boost::uint64_t>, std::equal_to<boost::uint64_t>, allocator_type>
map_type;
#else
typedef boost::unordered_map<const boost::uint64_t, vector_type,
boost::hash<boost::uint64_t>, std::equal_to<boost::uint64_t>, allocator_type>
map_type;
#endif
UNORDERED_AUTO_TEST (scoped_allocator) {
allocator_type alloc(