X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/9d88c94317aeac5dd26c1dbe8c2112dbe855d2b5..73c04bcfe1096173b00431f0cdc742894b15eef0:/icuSources/test/cintltst/cdtdptst.c diff --git a/icuSources/test/cintltst/cdtdptst.c b/icuSources/test/cintltst/cdtdptst.c index 11b47351..d19b7eed 100644 --- a/icuSources/test/cintltst/cdtdptst.c +++ b/icuSources/test/cintltst/cdtdptst.c @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2003, International Business Machines Corporation and + * Copyright (c) 1997-2006, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /******************************************************************************** @@ -233,9 +233,11 @@ void TestCzechMonths459() UErrorCode status = U_ZERO_ERROR; UChar *date; + ctest_setTimeZone(NULL, &status); fmt = udat_open(UDAT_FULL, UDAT_FULL, "cs", NULL, 0, NULL, 0, &status); if(U_FAILURE(status)){ log_err("Error in constructing the date format\n"); + ctest_resetTimeZone(); return; } lneed=0; @@ -256,7 +258,6 @@ void TestCzechMonths459() ucal_setDate(cal, 1997, UCAL_JULY, 15, &status); july=ucal_getMillis(cal, &status); - juneStr = myDateFormat(fmt, june); julyStr = myDateFormat(fmt, july); pos=0; @@ -266,10 +267,17 @@ void TestCzechMonths459() } d = udat_parse(fmt, juneStr, u_strlen(juneStr), &pos, &status); date = myDateFormat(fmt, d); - if(u_strcmp(myDateFormat(fmt, june), myDateFormat(fmt, d) ) !=0) - log_err("Error in handling the czech month june\n"); - else - log_verbose("Pass: Date = %s (czech month June)\n", aescstrdup(date, -1)); + + if(U_SUCCESS(status)){ + UChar* out1 = myDateFormat(fmt, june); + UChar* out2 = myDateFormat(fmt, d); + if(u_strcmp(out1, out2) !=0) + log_err("Error in handling the czech month june\n"); + else + log_verbose("Pass: Date = %s (czech month June)\n", aescstrdup(date, -1)); + }else{ + log_err("udat_parse failed. Error. %s\n",u_errorName(status)); + } pos=0; d = udat_parse(fmt, julyStr, u_strlen(julyStr), &pos, &status); date = myDateFormat(fmt, d); @@ -278,6 +286,7 @@ void TestCzechMonths459() else log_verbose("Pass: Date = %s (czech month July)\n", aescstrdup(date, -1)); + ctest_resetTimeZone(); udat_close(fmt); ucal_close(cal); free(pattern);