Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / icu / source / test / intltest / nmfmtrt.cpp
index c2c962a..e4d8d38 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2010, International Business Machines Corporation
+ * Copyright (c) 1997-2011, International Business Machines Corporation
  * and others. All Rights Reserved.
  ***********************************************************************/
 
@@ -146,7 +146,7 @@ NumberFormatRoundTripTest::start()
 void 
 NumberFormatRoundTripTest::test(NumberFormat *fmt)
 {
-#if IEEE_754 && !defined(OS400)
+#if IEEE_754 && U_PLATFORM != U_PF_OS400
     test(fmt, uprv_getNaN());
     test(fmt, uprv_getInfinity());
     test(fmt, -uprv_getInfinity());
@@ -167,10 +167,10 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt)
         test(fmt, uprv_floor((randomDouble(10000))));
         test(fmt, randomDouble(1e50));
         test(fmt, randomDouble(1e-50));
-#if !defined(OS390) && !defined(OS400)
+#if !(U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400)
         test(fmt, randomDouble(1e100));
 #elif IEEE_754
-        test(fmt, randomDouble(1e75));    /*OS390 and OS400*/
+        test(fmt, randomDouble(1e75));
 #endif /* OS390 and OS400 */
         // {sfb} When formatting with a percent instance, numbers very close to
         // DBL_MAX will fail the round trip.  This is because:
@@ -185,13 +185,13 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt)
         DecimalFormat *df = dynamic_cast<DecimalFormat *>(fmt);
         if(df != NULL)
         {
-#if !defined(OS390) && !defined(OS400)
+#if !(U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400)
             /* DBL_MAX/2 is here because randomDouble does a *2 in the math */
             test(fmt, randomDouble(DBL_MAX/2.0) / df->getMultiplier());
 #elif IEEE_754
-            test(fmt, randomDouble(1e75) / df->getMultiplier());   
+            test(fmt, randomDouble(1e75) / df->getMultiplier());
 #else
-            test(fmt, randomDouble(1e65) / df->getMultiplier());   /*OS390*/
+            test(fmt, randomDouble(1e65) / df->getMultiplier());
 #endif
         }
 
@@ -199,8 +199,8 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt)
         // 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
+#elif U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400
+        // i5/OS (OS/400) throws exceptions on denormalized numbers
 #   if IEEE_754
         test(fmt, randomDouble(1e-78));
         test(fmt, randomDouble(1e-78));