]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/is_unsigned_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / test / is_unsigned_test.cpp
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
7 #include "test.hpp"
8 #include "check_integral_constant.hpp"
9 #ifdef TEST_STD
10 # include <type_traits>
11 #else
12 # include <boost/type_traits/is_unsigned.hpp>
13 #endif
14
15 #include <climits>
16
17 TT_TEST_BEGIN(is_signed)
18
19 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<int>::value, false);
20 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<long>::value, false);
21 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<short>::value, false);
22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<signed char>::value, false);
23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned int>::value, true);
24 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned long>::value, true);
25 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned short>::value, true);
26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned char>::value, true);
27
28 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<UDT>::value, false);
29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned&>::value, false);
30 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned&&>::value, false);
32 #endif
33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned*>::value, false);
34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned[2]>::value, false);
35
36 #ifdef BOOST_HAS_INT128
37 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<boost::int128_type>::value, false);
38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<boost::uint128_type>::value, true);
39 #endif
40
41 #if defined(CHAR_MIN)
42 #if CHAR_MIN != 0
43 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<char>::value, false);
44 #else
45 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<char>::value, true);
46 #endif
47 #endif
48
49
50 #if defined(WCHAR_MIN)
51 #if WCHAR_MIN != 0
52 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<wchar_t>::value, false);
53 #else
54 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<wchar_t>::value, true);
55 #endif
56 #endif
57
58 TT_TEST_END
59
60
61
62
63
64
65
66