mirror of
https://github.com/boostorg/core.git
synced 2025-05-10 07:13:54 +00:00
Update unit tests
This commit is contained in:
parent
c8479b4eca
commit
6da7958281
@ -15,20 +15,16 @@ struct A1 {
|
||||
typedef int* const_pointer;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
|
||||
boost::allocator_const_pointer<A1<char> >::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<const int*,
|
||||
boost::allocator_const_pointer<A2<int> >::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -20,20 +20,16 @@ struct A1 {
|
||||
};
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
|
||||
boost::allocator_const_void_pointer<A1<char> >::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<const void*,
|
||||
boost::allocator_const_void_pointer<A2<int> >::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,20 +15,16 @@ struct A1 {
|
||||
typedef short difference_type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<short,
|
||||
boost::allocator_difference_type<A1<char> >::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
|
||||
boost::allocator_difference_type<A2<int> >::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ struct A1 {
|
||||
int value;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
@ -24,24 +23,25 @@ struct A2 {
|
||||
template<class T>
|
||||
struct A3 {
|
||||
typedef T value_type;
|
||||
typedef std::false_type is_always_equal;
|
||||
struct is_always_equal {
|
||||
static const bool value = false;
|
||||
};
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct A4 {
|
||||
typedef T value_type;
|
||||
typedef std::true_type is_always_equal;
|
||||
struct is_always_equal {
|
||||
static const bool value = true;
|
||||
};
|
||||
int value;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_FALSE((boost::allocator_is_always_equal<A1<int> >::type));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::allocator_is_always_equal<A2<int> >::type));
|
||||
BOOST_TEST_TRAIT_FALSE((boost::allocator_is_always_equal<A3<int> >::type));
|
||||
BOOST_TEST_TRAIT_TRUE((boost::allocator_is_always_equal<A4<int> >::type));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -19,21 +19,17 @@ struct A1 {
|
||||
}
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
typedef short size_type;
|
||||
A2() { }
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_EQ(boost::allocator_max_size(A1<int>()), 1);
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_LE(boost::allocator_max_size(A2<int>()),
|
||||
(std::numeric_limits<short>::max)());
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,21 +14,19 @@ struct A1 {
|
||||
typedef T value_type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
typedef std::true_type propagate_on_container_copy_assignment;
|
||||
struct propagate_on_container_copy_assignment {
|
||||
static const bool value = true;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_FALSE((boost::
|
||||
allocator_propagate_on_container_copy_assignment<A1<int> >::type));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::
|
||||
allocator_propagate_on_container_copy_assignment<A2<int> >::type));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,21 +14,19 @@ struct A1 {
|
||||
typedef T value_type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
typedef std::true_type propagate_on_container_move_assignment;
|
||||
struct propagate_on_container_move_assignment {
|
||||
static const bool value = true;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_FALSE((boost::
|
||||
allocator_propagate_on_container_move_assignment<A1<int> >::type));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::
|
||||
allocator_propagate_on_container_move_assignment<A2<int> >::type));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -14,21 +14,19 @@ struct A1 {
|
||||
typedef T value_type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
typedef std::true_type propagate_on_container_swap;
|
||||
struct propagate_on_container_swap {
|
||||
static const bool value = true;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_FALSE((boost::
|
||||
allocator_propagate_on_container_swap<A1<int> >::type));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::
|
||||
allocator_propagate_on_container_swap<A2<int> >::type));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -15,20 +15,16 @@ struct A1 {
|
||||
typedef int* pointer;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
|
||||
boost::allocator_pointer<A1<char> >::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
|
||||
boost::allocator_pointer<A2<int> >::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -18,20 +18,16 @@ struct A1 {
|
||||
};
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<A1<int>,
|
||||
boost::allocator_rebind<A1<char>, bool>::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<A2<int>,
|
||||
boost::allocator_rebind<A2<char>, int>::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ struct A1 {
|
||||
int value;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
@ -27,15 +26,12 @@ struct A2 {
|
||||
}
|
||||
int value;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_EQ(1, boost::
|
||||
allocator_select_on_container_copy_construction(A1<int>(1)).value);
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_EQ(2, boost::
|
||||
allocator_select_on_container_copy_construction(A2<int>(1)).value);
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -20,20 +20,16 @@ struct A1 {
|
||||
};
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class T>
|
||||
struct A2 {
|
||||
typedef T value_type;
|
||||
};
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
|
||||
boost::allocator_void_pointer<A1<char> >::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void*,
|
||||
boost::allocator_void_pointer<A2<int> >::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user