X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/fd0068a84e9996f225edba706498f6ed413d0673..46f4442e9a5a4f3b98b7c1083586332f6a8a99a4:/icuSources/test/intltest/nmfmtrt.cpp diff --git a/icuSources/test/intltest/nmfmtrt.cpp b/icuSources/test/intltest/nmfmtrt.cpp index 0a6e9e81..580918ae 100644 --- a/icuSources/test/intltest/nmfmtrt.cpp +++ b/icuSources/test/intltest/nmfmtrt.cpp @@ -1,6 +1,6 @@ /*********************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2006, International Business Machines Corporation + * Copyright (c) 1997-2007, International Business Machines Corporation * and others. All Rights Reserved. ***********************************************************************/ @@ -190,22 +190,22 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt) #endif } -#if defined XP_MAC || defined __alpha__ || defined U_OSF -// These machines don't support denormalized doubles, -// so the low-end range doesn't match Windows +#if (defined(_MSC_VER) && _MSC_VER < 1400) || defined(__alpha__) || defined(U_OSF) + // These machines and compilers don't fully support denormalized doubles, test(fmt, randomDouble(1e-292)); + test(fmt, randomDouble(1e-100)); #elif defined(OS390) || defined(OS400) + // i5/OS (OS400) throws exceptions on denormalized numbers # if IEEE_754 - test(fmt, randomDouble(1e-78)); /*OS390 and OS400*/ + test(fmt, randomDouble(1e-78)); + test(fmt, randomDouble(1e-78)); + // #else we're using something like the old z/OS floating point. # endif #else - test(fmt, randomDouble(1e-323)); -#endif /* OS390 and OS400*/ -#if !defined(OS390) && !defined(OS400) + // This is a normal machine that can support IEEE754 denormalized doubles without throwing an error. + test(fmt, randomDouble(DBL_MIN)); /* Usually 2.2250738585072014e-308 */ test(fmt, randomDouble(1e-100)); -#elif IEEE_754 - test(fmt, randomDouble(1e-78)); /*OS390 and OS400*/ -#endif /* OS390 and OS400*/ +#endif } } @@ -283,8 +283,8 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt, const Formattable& value) if (show) { errln(/*value.getString(temp) +*/ typeOf(value, temp) + " F> " + - escape(s) + " P> " + - /*n.getString(temp) +*/ typeOf(n, temp) + " F> " + + escape(s) + " P> " + (n.getType() == Formattable::kDouble ? n.getDouble() : (double)n.getLong()) + /*n.getString(temp) */ + typeOf(n, temp) + " F> " + escape(s2)); } }