// (C) Copyright John Maddock 2007. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt) #ifdef TEST_STD # include #else # include #endif #include "test.hpp" #include "check_type.hpp" #include "check_integral_constant.hpp" TT_TEST_BEGIN(make_unsigned) // signed types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned<__int64>::type, unsigned __int64); #endif // const signed types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, const boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned __int64); #endif // volatile signed types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned __int64); #endif // const volatile signed types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned __int64); #endif // unsigned types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned __int64); #endif // const unsigned types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, const boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned __int64); #endif // volatile unsigned types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned __int64); #endif // const volatile unsigned types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned char); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned short); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned int); BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile boost::ulong_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned __int64); #endif #ifdef BOOST_HAS_INT128 BOOST_CHECK_TYPE(::tt::make_unsigned::type, boost::uint128_type); BOOST_CHECK_TYPE(::tt::make_unsigned::type, boost::uint128_type); #endif // character types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_unsigned::type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned< ::tt::make_unsigned::type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_unsigned::type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned< ::tt::make_unsigned::type>::value, true); TT_TEST_END