]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/tsdate.cpp
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / test / intltest / tsdate.cpp
index c4dd672da147c8802752da1e9f4d069e31a32c20..00f740ec0a13bf6a869a5116e1ff6fa3ce381be0 100644 (file)
@@ -1,8 +1,7 @@
-/********************************************************************
- * COPYRIGHT: 
- * Copyright (c) 1997-2001, International Business Machines Corporation and
- * others. All Rights Reserved.
- ********************************************************************/
+/***********************************************************************
+ * Copyright (c) 1997-2006, International Business Machines Corporation
+ * and others. All Rights Reserved.
+ ***********************************************************************/
 
 #include "unicode/utypes.h"
 
 #include "unicode/datefmt.h"
 #include "unicode/smpdtfmt.h"
 #include "tsdate.h"
+#include "putilimp.h"
 
 #include <float.h>
 #include <stdlib.h>
+#include <math.h>
 
 const double IntlTestDateFormat::ONEYEAR = 365.25 * ONEDAY; // Approximate
 
+IntlTestDateFormat::~IntlTestDateFormat() {}
+
 /**
  * This test does round-trip testing (format -> parse -> format -> parse -> etc.) of
  * DateFormat.
@@ -150,6 +153,9 @@ void IntlTestDateFormat::tryDate(UDate theDate)
     int32_t dateMatch = 0;
     int32_t stringMatch = 0;
     UBool dump = FALSE;
+#if defined (U_CAL_DEBUG)
+    dump = TRUE;
+#endif
     int32_t i;
 
     date[0] = theDate;
@@ -208,7 +214,7 @@ void IntlTestDateFormat::tryDate(UDate theDate)
         }
     }
 }
-    
+
 // Return a random double from 0.01 to 1, inclusive
 double IntlTestDateFormat::randDouble()
 {
@@ -229,7 +235,7 @@ double IntlTestDateFormat::randDouble()
             d = -d;
         if (d > 0.0)
         {
-            double e = uprv_floor(uprv_log10(d));
+            double e = uprv_floor(log10(d));
             if (e < -2.0)
                 d *= uprv_pow10((int32_t)(-e-2));
             else if (e > -1.0)