X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..151279e3792e85d0417b499c229886b3af724f55:/icuSources/test/intltest/tsdate.cpp diff --git a/icuSources/test/intltest/tsdate.cpp b/icuSources/test/intltest/tsdate.cpp index c4dd672d..bdff3d19 100644 --- a/icuSources/test/intltest/tsdate.cpp +++ b/icuSources/test/intltest/tsdate.cpp @@ -1,8 +1,7 @@ -/******************************************************************** - * COPYRIGHT: - * Copyright (c) 1997-2001, International Business Machines Corporation and - * others. All Rights Reserved. - ********************************************************************/ +/*********************************************************************** + * Copyright (c) 1997-2009, International Business Machines Corporation + * and others. All Rights Reserved. + ***********************************************************************/ #include "unicode/utypes.h" @@ -11,12 +10,16 @@ #include "unicode/datefmt.h" #include "unicode/smpdtfmt.h" #include "tsdate.h" +#include "putilimp.h" #include #include +#include const double IntlTestDateFormat::ONEYEAR = 365.25 * ONEDAY; // Approximate +IntlTestDateFormat::~IntlTestDateFormat() {} + /** * This test does round-trip testing (format -> parse -> format -> parse -> etc.) of * DateFormat. @@ -109,7 +112,7 @@ void IntlTestDateFormat::testFormat(/* char* par */) { if (fFormat == 0) { - errln("FAIL: DateFormat creation failed"); + dataerrln("FAIL: DateFormat creation failed"); return; } @@ -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) @@ -257,7 +263,7 @@ void IntlTestDateFormat::testAvailableLocales(/* char* par */) } logln(all); } - else errln((UnicodeString)"**** FAIL: Zero available locales or null array pointer"); + else dataerrln((UnicodeString)"**** FAIL: Zero available locales or null array pointer"); } void IntlTestDateFormat::monsterTest(/*char *par*/)