// (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_signed) // signed types: BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, short); BOOST_CHECK_TYPE(::tt::make_signed::type, int); BOOST_CHECK_TYPE(::tt::make_signed::type, long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed<__int64>::type, __int64); #endif // const signed types: BOOST_CHECK_TYPE(::tt::make_signed::type, const signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, const short); BOOST_CHECK_TYPE(::tt::make_signed::type, const int); BOOST_CHECK_TYPE(::tt::make_signed::type, const long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, const boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, const __int64); #endif // volatile signed types: BOOST_CHECK_TYPE(::tt::make_signed::type, volatile signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, volatile short); BOOST_CHECK_TYPE(::tt::make_signed::type, volatile int); BOOST_CHECK_TYPE(::tt::make_signed::type, volatile long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, volatile boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, volatile __int64); #endif // const volatile signed types: BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile short); BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile int); BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile __int64); #endif // unsigned types: BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, short); BOOST_CHECK_TYPE(::tt::make_signed::type, int); BOOST_CHECK_TYPE(::tt::make_signed::type, long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, __int64); #endif // const unsigned types: BOOST_CHECK_TYPE(::tt::make_signed::type, const signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, const short); BOOST_CHECK_TYPE(::tt::make_signed::type, const int); BOOST_CHECK_TYPE(::tt::make_signed::type, const long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, const boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, const __int64); #endif // volatile unsigned types: BOOST_CHECK_TYPE(::tt::make_signed::type, volatile signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, volatile short); BOOST_CHECK_TYPE(::tt::make_signed::type, volatile int); BOOST_CHECK_TYPE(::tt::make_signed::type, volatile long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, volatile boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, volatile __int64); #endif // const volatile unsigned types: BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile signed char); BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile short); BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile int); BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile long); #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile boost::long_long_type); #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile __int64); #endif #ifdef BOOST_HAS_INT128 BOOST_CHECK_TYPE(::tt::make_signed::type, boost::int128_type); BOOST_CHECK_TYPE(::tt::make_signed::type, boost::int128_type); #endif // character types: BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_signed::type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed< ::tt::make_signed::type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_signed::type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed< ::tt::make_signed::type>::value, true); TT_TEST_END