]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/test/make_unsigned_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / type_traits / test / make_unsigned_test.cpp
CommitLineData
7c673cae
FG
1
2// (C) Copyright John Maddock 2007.
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.tt.org/LICENSE_1_0.txt)
6
7c673cae
FG
7#ifdef TEST_STD
8# include <type_traits>
9#else
10# include <boost/type_traits/make_unsigned.hpp>
11#endif
11fdf7f2
TL
12#include "test.hpp"
13#include "check_type.hpp"
14#include "check_integral_constant.hpp"
7c673cae
FG
15
16TT_TEST_BEGIN(make_unsigned)
17// signed types:
18BOOST_CHECK_TYPE(::tt::make_unsigned<signed char>::type, unsigned char);
19BOOST_CHECK_TYPE(::tt::make_unsigned<short>::type, unsigned short);
20BOOST_CHECK_TYPE(::tt::make_unsigned<int>::type, unsigned int);
21BOOST_CHECK_TYPE(::tt::make_unsigned<long>::type, unsigned long);
22#ifdef BOOST_HAS_LONG_LONG
23BOOST_CHECK_TYPE(::tt::make_unsigned<boost::long_long_type>::type, boost::ulong_long_type);
24#elif defined(BOOST_HAS_MS_INT64)
25BOOST_CHECK_TYPE(::tt::make_unsigned<__int64>::type, unsigned __int64);
26#endif
27// const signed types:
28BOOST_CHECK_TYPE(::tt::make_unsigned<const signed char>::type, const unsigned char);
29BOOST_CHECK_TYPE(::tt::make_unsigned<const short>::type, const unsigned short);
30BOOST_CHECK_TYPE(::tt::make_unsigned<const int>::type, const unsigned int);
31BOOST_CHECK_TYPE(::tt::make_unsigned<const long>::type, const unsigned long);
32#ifdef BOOST_HAS_LONG_LONG
33BOOST_CHECK_TYPE(::tt::make_unsigned<const boost::long_long_type>::type, const boost::ulong_long_type);
34#elif defined(BOOST_HAS_MS_INT64)
35BOOST_CHECK_TYPE(::tt::make_unsigned<const __int64>::type, const unsigned __int64);
36#endif
37// volatile signed types:
38BOOST_CHECK_TYPE(::tt::make_unsigned<volatile signed char>::type, volatile unsigned char);
39BOOST_CHECK_TYPE(::tt::make_unsigned<volatile short>::type, volatile unsigned short);
40BOOST_CHECK_TYPE(::tt::make_unsigned<volatile int>::type, volatile unsigned int);
41BOOST_CHECK_TYPE(::tt::make_unsigned<volatile long>::type, volatile unsigned long);
42#ifdef BOOST_HAS_LONG_LONG
43BOOST_CHECK_TYPE(::tt::make_unsigned<volatile boost::long_long_type>::type, volatile boost::ulong_long_type);
44#elif defined(BOOST_HAS_MS_INT64)
45BOOST_CHECK_TYPE(::tt::make_unsigned<volatile __int64>::type, volatile unsigned __int64);
46#endif
47// const volatile signed types:
48BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile signed char>::type, const volatile unsigned char);
49BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile short>::type, const volatile unsigned short);
50BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile int>::type, const volatile unsigned int);
51BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile long>::type, const volatile unsigned long);
52#ifdef BOOST_HAS_LONG_LONG
53BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile boost::long_long_type>::type, const volatile boost::ulong_long_type);
54#elif defined(BOOST_HAS_MS_INT64)
55BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile __int64>::type, const volatile unsigned __int64);
56#endif
57
58// unsigned types:
59BOOST_CHECK_TYPE(::tt::make_unsigned<unsigned char>::type, unsigned char);
60BOOST_CHECK_TYPE(::tt::make_unsigned<unsigned short>::type, unsigned short);
61BOOST_CHECK_TYPE(::tt::make_unsigned<unsigned int>::type, unsigned int);
62BOOST_CHECK_TYPE(::tt::make_unsigned<unsigned long>::type, unsigned long);
63#ifdef BOOST_HAS_LONG_LONG
64BOOST_CHECK_TYPE(::tt::make_unsigned<boost::ulong_long_type>::type, boost::ulong_long_type);
65#elif defined(BOOST_HAS_MS_INT64)
66BOOST_CHECK_TYPE(::tt::make_unsigned<unsigned __int64>::type, unsigned __int64);
67#endif
68// const unsigned types:
69BOOST_CHECK_TYPE(::tt::make_unsigned<const unsigned char>::type, const unsigned char);
70BOOST_CHECK_TYPE(::tt::make_unsigned<const unsigned short>::type, const unsigned short);
71BOOST_CHECK_TYPE(::tt::make_unsigned<const unsigned int>::type, const unsigned int);
72BOOST_CHECK_TYPE(::tt::make_unsigned<const unsigned long>::type, const unsigned long);
73#ifdef BOOST_HAS_LONG_LONG
74BOOST_CHECK_TYPE(::tt::make_unsigned<const boost::ulong_long_type>::type, const boost::ulong_long_type);
75#elif defined(BOOST_HAS_MS_INT64)
76BOOST_CHECK_TYPE(::tt::make_unsigned<const unsigned __int64>::type, const unsigned __int64);
77#endif
78// volatile unsigned types:
79BOOST_CHECK_TYPE(::tt::make_unsigned<volatile unsigned char>::type, volatile unsigned char);
80BOOST_CHECK_TYPE(::tt::make_unsigned<volatile unsigned short>::type, volatile unsigned short);
81BOOST_CHECK_TYPE(::tt::make_unsigned<volatile unsigned int>::type, volatile unsigned int);
82BOOST_CHECK_TYPE(::tt::make_unsigned<volatile unsigned long>::type, volatile unsigned long);
83#ifdef BOOST_HAS_LONG_LONG
84BOOST_CHECK_TYPE(::tt::make_unsigned<volatile boost::ulong_long_type>::type, volatile boost::ulong_long_type);
85#elif defined(BOOST_HAS_MS_INT64)
86BOOST_CHECK_TYPE(::tt::make_unsigned<volatile unsigned __int64>::type, volatile unsigned __int64);
87#endif
88// const volatile unsigned types:
89BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile unsigned char>::type, const volatile unsigned char);
90BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile unsigned short>::type, const volatile unsigned short);
91BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile unsigned int>::type, const volatile unsigned int);
92BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile unsigned long>::type, const volatile unsigned long);
93#ifdef BOOST_HAS_LONG_LONG
94BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile boost::ulong_long_type>::type, const volatile boost::ulong_long_type);
95#elif defined(BOOST_HAS_MS_INT64)
96BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile unsigned __int64>::type, const volatile unsigned __int64);
97#endif
98#ifdef BOOST_HAS_INT128
99BOOST_CHECK_TYPE(::tt::make_unsigned<boost::int128_type>::type, boost::uint128_type);
100BOOST_CHECK_TYPE(::tt::make_unsigned<boost::uint128_type>::type, boost::uint128_type);
101#endif
102
103// character types:
104BOOST_CHECK_TYPE(::tt::make_unsigned<char>::type, unsigned char);
105BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_unsigned<wchar_t>::type>::value, true);
106BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned< ::tt::make_unsigned<wchar_t>::type>::value, true);
107BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_unsigned<enum_UDT>::type>::value, true);
108BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned< ::tt::make_unsigned<enum_UDT>::type>::value, true);
109TT_TEST_END
110
111