/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2003, International Business Machines Corporation and
+ * Copyright (c) 1997-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
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;
ucal_setDate(cal, 1997, UCAL_JULY, 15, &status);
july=ucal_getMillis(cal, &status);
-
juneStr = myDateFormat(fmt, june);
julyStr = myDateFormat(fmt, july);
pos=0;
}
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);
else
log_verbose("Pass: Date = %s (czech month July)\n", aescstrdup(date, -1));
+ ctest_resetTimeZone();
udat_close(fmt);
ucal_close(cal);
free(pattern);