]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/test/is_signed_test.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / type_traits / test / is_signed_test.cpp
CommitLineData
7c673cae
FG
1
2// (C) Copyright John Maddock 2005.
3// Use, modification and distribution are subject to the
4// Boost Software License, Version 1.0. (See accompanying file
5// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7c673cae
FG
7#ifdef TEST_STD
8# include <type_traits>
9#else
10# include <boost/type_traits/is_signed.hpp>
11#endif
11fdf7f2
TL
12#include "test.hpp"
13#include "check_integral_constant.hpp"
7c673cae
FG
14
15#include <climits>
16
17TT_TEST_BEGIN(is_signed)
18
19BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int>::value, true);
20BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<long>::value, true);
21BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<short>::value, true);
22BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<signed char>::value, true);
23BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<unsigned int>::value, false);
24BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<unsigned long>::value, false);
25BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<unsigned short>::value, false);
26BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<unsigned char>::value, false);
27
28BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<UDT>::value, false);
29BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int&>::value, false);
30#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
31BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int&&>::value, false);
32#endif
33BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int*>::value, false);
34BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int[2]>::value, false);
35
36#ifdef BOOST_HAS_INT128
37BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<boost::int128_type>::value, true);
38BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<boost::uint128_type>::value, false);
39#endif
40
41#if defined(CHAR_MIN)
42#if CHAR_MIN != 0
43BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<char>::value, true);
44#else
45BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<char>::value, false);
46#endif
47#endif
48
49
50#if defined(WCHAR_MIN)
51#if WCHAR_MIN != 0
52BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<wchar_t>::value, true);
53#else
54BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<wchar_t>::value, false);
55#endif
56#endif
57
58TT_TEST_END
59
60
61
62
63
64
65
66