Disable immovable test for libstdc++ versions below 6.0 as their std::pair implementation doesn't support immovable types

This commit is contained in:
Christian Mazakas
2023-02-01 09:02:05 -08:00
parent dc548a1a9e
commit e1b394d5b2

View File

@ -7,9 +7,16 @@
#error "This test is only for the FOA-style conatiners" #error "This test is only for the FOA-style conatiners"
#endif #endif
#include "../helpers/test.hpp"
#include "../helpers/unordered.hpp" #include "../helpers/unordered.hpp"
#include "../helpers/test.hpp" #include <boost/config.hpp>
#if defined(BOOST_LIBSTDCXX_VERSION)
#if BOOST_LIBSTDCXX_VERSION < 60000
#define BOOST_UNORDERED_NO_INIT_TYPE_TESTS
#endif
#endif
struct move_only struct move_only
{ {
@ -38,6 +45,8 @@ namespace std {
} // namespace std } // namespace std
#ifndef BOOST_UNORDERED_NO_INIT_TYPE_TESTS
struct immovable struct immovable
{ {
int x_ = -1; int x_ = -1;
@ -65,6 +74,8 @@ namespace std {
} // namespace std } // namespace std
#endif
struct raii_tracker struct raii_tracker
{ {
static unsigned move_constructs; static unsigned move_constructs;
@ -262,6 +273,7 @@ static void test_insert_hint_tracking()
static void test_immovable() static void test_immovable()
{ {
#ifndef BOOST_UNORDERED_NO_INIT_TYPE_TESTS
int const v = 128; int const v = 128;
boost::unordered_node_map<immovable, int, std::hash<immovable> > map; boost::unordered_node_map<immovable, int, std::hash<immovable> > map;
@ -276,6 +288,7 @@ static void test_immovable()
map.rehash(1024); map.rehash(1024);
BOOST_TEST_GE(map.bucket_count(), 1024u); BOOST_TEST_GE(map.bucket_count(), 1024u);
#endif
} }
static void test_insert_node_tracking() static void test_insert_node_tracking()