From 818670ad28603f7b5fe9182ad43965f54fe94c88 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 1 Dec 2003 12:00:26 +0000 Subject: [PATCH] Allow testing of both __int64 and long long at the same time. [SVN r21039] --- test/limits_test.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/limits_test.cpp b/test/limits_test.cpp index 8593e645..cc1bdfa4 100644 --- a/test/limits_test.cpp +++ b/test/limits_test.cpp @@ -64,7 +64,7 @@ void test_integral_limits(const T &, const char * msg) { typedef std::numeric_limits lim; std::cout << "Testing " << msg - << " (size " << sizeof(T) << ")" + << " (size " << sizeof(T) << ")" << " min: " << make_char_numeric_for_streaming(lim::min()) << ", max: " << make_char_numeric_for_streaming(lim::max()) << std::endl; @@ -98,7 +98,7 @@ void test_float_limits(const T &, const char * msg) BOOST_TEST(!lim::is_modulo); BOOST_TEST(!lim::is_integer); BOOST_TEST(lim::is_signed); - + const T infinity = lim::infinity(); const T qnan = lim::quiet_NaN(); const T snan = lim::signaling_NaN(); @@ -135,8 +135,8 @@ void test_float_limits(const T &, const char * msg) } else { std::cout << "Does not have infinity" << std::endl; } - - if(lim::has_quiet_NaN) { + + if(lim::has_quiet_NaN) { // NaNs shall always compare "false" when compared for equality // If one of these fail, your compiler may be optimizing incorrectly, // or the standard library is incorrectly configured. @@ -144,7 +144,7 @@ void test_float_limits(const T &, const char * msg) BOOST_TEST(! (qnan == qnan)); BOOST_TEST(qnan != 42); BOOST_TEST(qnan != qnan); - + // The following tests may cause arithmetic traps. // BOOST_TEST(! (qnan < 42)); // BOOST_TEST(! (qnan > 42)); @@ -181,10 +181,10 @@ int test_main(int, char*[]) test_integral_limits(unsigned_long_long(), "unsigned long long"); #endif #ifdef BOOST_HAS_MS_INT64 - typedef __int64 long_long; - test_integral_limits(long_long(), "__int64"); - typedef unsigned __int64 unsigned_long_long; - test_integral_limits(unsigned_long_long(), "unsigned __int64"); + typedef __int64 long_long2; + test_integral_limits(long_long2(), "__int64"); + typedef unsigned __int64 unsigned_long_long2; + test_integral_limits(unsigned_long_long2(), "unsigned __int64"); #endif test_float_limits(float(), "float"); @@ -196,3 +196,4 @@ int test_main(int, char*[]) return 0; } +