Add incomplete_test

This commit is contained in:
Christian Mazakas
2022-10-12 14:30:07 -07:00
parent fc7b5573c1
commit d4f7939aae
2 changed files with 46 additions and 2 deletions

View File

@ -108,6 +108,7 @@ build_foa compile_set ;
build_foa compile_map ;
build_foa noexcept_tests ;
run unordered/link_test_1.cpp unordered/link_test_2.cpp : : : <cxxstd>98:<build>no <cxxstd>03:<build>no <cxxstd>0x:<build>no <define>BOOST_UNORDERED_FOA_TESTS : foa_link_test ;
build_foa incomplete_test ;
build_foa constructor_tests ;
build_foa copy_tests ;
build_foa move_tests ;

View File

@ -5,8 +5,14 @@
// clang-format off
#include "../helpers/prefix.hpp"
#ifdef BOOST_UNORDERED_FOA_TESTS
#include <boost/unordered_flat_map.hpp>
#include <boost/unordered_flat_set.hpp>
#include <boost/unordered/detail/implementation.hpp>
#else
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
#endif
#include "../helpers/postfix.hpp"
// clang-format on
@ -15,7 +21,11 @@
namespace x {
struct D
{
#ifdef BOOST_UNORDERED_FOA_TESTS
boost::unordered_flat_map<D, D> x;
#else
boost::unordered_map<D, D> x;
#endif
};
}
@ -29,6 +39,17 @@ namespace incomplete_test {
// Declare some instances
#ifdef BOOST_UNORDERED_FOA_TESTS
typedef boost::unordered_flat_map<value, value, hash, equals,
allocator<std::pair<value const, value> > >
map;
typedef boost::unordered_flat_map<value, value, hash, equals,
allocator<std::pair<value const, value> > >
multimap;
typedef boost::unordered_flat_set<value, hash, equals, allocator<value> > set;
typedef boost::unordered_flat_set<value, hash, equals, allocator<value> >
multiset;
#else
typedef boost::unordered_map<value, value, hash, equals,
allocator<std::pair<value const, value> > >
map;
@ -38,6 +59,7 @@ namespace incomplete_test {
typedef boost::unordered_set<value, hash, equals, allocator<value> > set;
typedef boost::unordered_multiset<value, hash, equals, allocator<value> >
multiset;
#endif
// Now define the types which are stored as members, as they are needed for
// declaring struct members.
@ -76,7 +98,28 @@ namespace incomplete_test {
//
// Incomplete hash, equals and allocator aren't here supported at the
// moment.
#ifdef BOOST_UNORDERED_FOA_TESTS
struct struct1
{
boost::unordered_flat_map<struct1, struct1, hash, equals,
allocator<std::pair<struct1 const, struct1> > >
x;
};
struct struct2
{
boost::unordered_flat_map<struct2, struct2, hash, equals,
allocator<std::pair<struct2 const, struct2> > >
x;
};
struct struct3
{
boost::unordered_flat_set<struct3, hash, equals, allocator<struct3> > x;
};
struct struct4
{
boost::unordered_flat_set<struct4, hash, equals, allocator<struct4> > x;
};
#else
struct struct1
{
boost::unordered_map<struct1, struct1, hash, equals,
@ -97,7 +140,7 @@ namespace incomplete_test {
{
boost::unordered_multiset<struct4, hash, equals, allocator<struct4> > x;
};
#endif
// Now define the value type.
struct value