Fix preprocessor logic, and add missing #include.

This commit is contained in:
jzmaddock committed 2015-02-26 19:11:18 +00:00
1 parent 90fca0f64b
commit 13c3530448
4 files changed
+52 -6

No files matched your search

+20
View File
@@ -12,6 +12,8 @@
# include <boost/type_traits/is_signed.hpp>
#endif
#include <climits>
TT_TEST_BEGIN(is_signed)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int>::value, true);
@@ -35,6 +37,24 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<boost::int128_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<boost::uint128_type>::value, false);
#endif
#if defined(CHAR_MIN)
#if CHAR_MIN != 0
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<char>::value, true);
#else
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<char>::value, false);
#endif
#endif
#if defined(WCHAR_MIN)
#if WCHAR_MIN != 0
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<wchar_t>::value, true);
#else
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<wchar_t>::value, false);
#endif
#endif
TT_TEST_END
+19
View File
@@ -12,6 +12,8 @@
# include <boost/type_traits/is_unsigned.hpp>
#endif
#include <climits>
TT_TEST_BEGIN(is_signed)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<int>::value, false);
@@ -36,6 +38,23 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<boost::int128_type>::value, fals
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<boost::uint128_type>::value, true);
#endif
#if defined(CHAR_MIN)
#if CHAR_MIN != 0
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<char>::value, false);
#else
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<char>::value, true);
#endif
#endif
#if defined(WCHAR_MIN)
#if WCHAR_MIN != 0
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<wchar_t>::value, false);
#else
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<wchar_t>::value, true);
#endif
#endif
TT_TEST_END