ICU-8716 Update intltest and cintltst to pass without data in 49M2

X-SVN-Rev: 31101
This commit is contained in:
Michael Ow 2011-12-12 23:28:25 +00:00
parent 91da1d37df
commit 9f1867ce35
11 changed files with 51 additions and 29 deletions

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation and
* Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
@ -163,7 +163,7 @@ void Test4056591()
def = udat_open(UDAT_IGNORE,UDAT_IGNORE,NULL, NULL, 0, pat, u_strlen(pat), &status);
if(U_FAILURE(status))
{
log_err_status(status, "FAIL: error in creating the dateformat using u_openPattern(): %s\n", myErrorName(status));
log_data_err("FAIL: error in creating the dateformat using u_openPattern(): %s - (Are you missing data?)\n", myErrorName(status));
return;
}
start = 1800;

View File

@ -59,7 +59,7 @@ void addNumForTest(TestNode** root)
TESTCASE(TestInt64Parse);
TESTCASE(TestParseZero);
TESTCASE(TestParseCurrency);
TESTCASE(TestCloneWithRBNF);
TESTCASE(TestCloneWithRBNF);
}
/** copy src to dst with unicode-escapes for values < 0x20 and > 0x7e, null terminate if possible */
@ -2026,7 +2026,7 @@ static void TestCloneWithRBNF(void) {
unum_close(pform_cloned);
if (u_strcmp(buffer,buffer_cloned)) {
log_err("Result from cloned formatter not identical to the original. Original: %s Cloned: %s",u_austrcpy(temp1, buffer),u_austrcpy(temp2,buffer_cloned));
log_data_err("Result from cloned formatter not identical to the original. Original: %s Cloned: %s - (Are you missing data?)",u_austrcpy(temp1, buffer),u_austrcpy(temp2,buffer_cloned));
}
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -1409,7 +1409,11 @@ void CalendarRegressionTest::test4125881()
return;
}
DateFormat *fmt = new SimpleDateFormat(UnicodeString("MMMM d, yyyy G"),status);
if(!assertSuccess("trying to construct", status))return;
if(U_FAILURE(status)) {
dataerrln("Error creating SimpleDateFormat - %s", u_errorName(status));
delete cal;
return;
}
cal->clear();
for (int32_t y=-20; y<=10; ++y) {
cal->set(UCAL_ERA, y < 1 ? GregorianCalendar::BC : GregorianCalendar::AD);
@ -1439,7 +1443,11 @@ void CalendarRegressionTest::test4125892() {
return;
}
DateFormat *fmt = new SimpleDateFormat(UnicodeString("MMMM d, yyyy G"),status);
if(!assertSuccess("trying to construct", status))return;
if(U_FAILURE(status)) {
dataerrln("Error creating SimpleDateFormat - %s", u_errorName(status));
delete cal;
return;
}
cal->clear();
cal->set(UCAL_ERA, GregorianCalendar::BC);
cal->set(UCAL_YEAR, 81); // 81 BC is a leap year (proleptically)
@ -2233,7 +2241,7 @@ void CalendarRegressionTest::TestJ438(void) {
SimpleDateFormat fmt(UnicodeString("MMM dd yyyy",""), ec);
fmt.setCalendar(cal);
UnicodeString s, t, u;
if (!failure(ec, "setup")) {
if (U_SUCCESS(ec)) {
for (i=0; i<DATA_length; i+=6) {
int32_t y1 = DATA[i];
int32_t m1 = DATA[i+1];
@ -2310,6 +2318,8 @@ void CalendarRegressionTest::TestJ438(void) {
fmt.format(date22, t.remove()));
}
}
} else {
dataerrln("Error creating SimpleDateFormat - %s", u_errorName(ec));
}
delete pcal;
}

View File

@ -1373,7 +1373,7 @@ CalendarTest::TestDOW_LOCALandYEAR_WOY()
Calendar *cal=Calendar::createInstance(Locale::getGermany(), status);
if (failure(status, "Calendar::createInstance", TRUE)) return;
SimpleDateFormat *sdf=new SimpleDateFormat(UnicodeString("YYYY'-W'ww-ee"), Locale::getGermany(), status);
if (U_FAILURE(status)) { errcheckln(status, "Couldn't create SimpleDateFormat - %s", u_errorName(status)); return; }
if (U_FAILURE(status)) { dataerrln("Couldn't create SimpleDateFormat - %s", u_errorName(status)); return; }
// ICU no longer use localized date-time pattern characters by default.
// So we set pattern chars using 'J' instead of 'Y'.

View 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.
***********************************************************************/
@ -306,15 +306,19 @@ IntlTestDateFormatAPI::TestNameHiding(void) {
logln("SimpleDateFormat");
status = U_ZERO_ERROR;
SimpleDateFormat sdf(status);
// Format API
sdf.format(dateObj, str, status);
sdf.format(dateObj, str, fpos, status);
// DateFormat API
sdf.format((UDate)0, str, fpos);
sdf.format((UDate)0, str);
sdf.parse(str, status);
sdf.parse(str, ppos);
sdf.getNumberFormat();
if (U_SUCCESS(status)) {
// Format API
sdf.format(dateObj, str, status);
sdf.format(dateObj, str, fpos, status);
// DateFormat API
sdf.format((UDate)0, str, fpos);
sdf.format((UDate)0, str);
sdf.parse(str, status);
sdf.parse(str, ppos);
sdf.getNumberFormat();
} else {
dataerrln("FAIL: Can't create SimpleDateFormat() - %s", u_errorName(status));
}
}
// NumberFormat calling Format API

View File

@ -353,8 +353,8 @@ void DateFormatTest::TestFieldPosition() {
// Verify data
DateFormatSymbols rootSyms(Locale(""), ec);
assertSuccess("DateFormatSymbols", ec);
if (U_FAILURE(ec)) {
dataerrln("Unable to create DateFormatSymbols - %s", u_errorName(ec));
return;
}
@ -1108,7 +1108,10 @@ DateFormatTest::TestDateFormatZone146()
for (int32_t i=0; i<DATA_length; i+=3) {
DateFormat *fmt = new SimpleDateFormat(DATA[i+2], Locale::getEnglish(), status);
if(failure(status, "new SimpleDateFormat")) break;
if (U_FAILURE(status)) {
dataerrln("Unable to create SimpleDateFormat - %s", u_errorName(status));
break;
}
fmt->setCalendar(*greenwichcalendar);
UnicodeString result;
result = fmt->format(greenwichdate, result);
@ -3643,7 +3646,7 @@ void DateFormatTest::TestStandAloneGMTParse() {
UErrorCode status = U_ZERO_ERROR;
SimpleDateFormat *sdf = new SimpleDateFormat("ZZZZ", Locale(""), status);
if (!failure(status, "new SimpleDateFormat")) {
if (U_SUCCESS(status)) {
UnicodeString inText("GMT$$$");
for (int32_t i = 0; i < 10; i++) {
@ -3655,6 +3658,8 @@ void DateFormatTest::TestStandAloneGMTParse() {
}
delete sdf;
} else {
dataerrln("Unable to create SimpleDateFormat - %s", u_errorName(status));
}
}

View File

@ -159,7 +159,10 @@ DateFormatMiscTests::test4099975()
{
UErrorCode status = U_ZERO_ERROR;
DateFormatSymbols* symbols = new DateFormatSymbols(Locale::getUS(), status);
if(failure(status, "new DateFormatSymbols")) return;
if (U_FAILURE(status)) {
dataerrln("Unable to create DateFormatSymbols - %s", u_errorName(status));
return;
}
SimpleDateFormat *df = new SimpleDateFormat(UnicodeString("E hh:mm"), *symbols, status);
if(failure(status, "new SimpleDateFormat")) return;
UnicodeString format0;
@ -324,7 +327,7 @@ DateFormatMiscTests::test4117335()
UErrorCode status = U_ZERO_ERROR;
DateFormatSymbols *symbols = new DateFormatSymbols(Locale::getJapan(), status);
if(U_FAILURE(status)) {
errcheckln(status, "Failure creating DateFormatSymbols, %s", u_errorName(status));
dataerrln("Failure creating DateFormatSymbols, %s", u_errorName(status));
delete symbols;
return;
}

View File

@ -1,5 +1,5 @@
/********************************************************************
* Copyright (c) 1997-2009, International Business Machines
* Copyright (c) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************/
@ -135,7 +135,7 @@ void IntlTestDateFormatSymbols::TestSymbols(/* char *par */)
DateFormatSymbols fr(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errcheckln(status, "ERROR: Couldn't create French DateFormatSymbols " + (UnicodeString)u_errorName(status));
dataerrln("ERROR: Couldn't create French DateFormatSymbols " + (UnicodeString)u_errorName(status));
return;
}

View File

@ -116,7 +116,7 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip(void) {
SimpleDateFormat *sdf = new SimpleDateFormat((UnicodeString)PATTERNS[patidx], LOCALES[locidx], status);
if (U_FAILURE(status)) {
errcheckln(status, (UnicodeString)"new SimpleDateFormat failed for pattern " +
dataerrln((UnicodeString)"new SimpleDateFormat failed for pattern " +
PATTERNS[patidx] + " for locale " + LOCALES[locidx].getName() + " - " + u_errorName(status));
status = U_ZERO_ERROR;
continue;

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2007-2010, International Business Machines Corporation and *
* Copyright (C) 2007-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -193,7 +193,7 @@ TimeZoneOffsetLocalTest::TestGetOffsetAroundTransition() {
SimpleDateFormat df(UnicodeString("yyyy-MM-dd HH:mm:ss"), status);
if (U_FAILURE(status)) {
errcheckln(status, "Failed to initialize a SimpleDateFormat - %s", u_errorName(status));
dataerrln("Failed to initialize a SimpleDateFormat - %s", u_errorName(status));
}
df.setTimeZone(*utc);
UnicodeString dateStr;

View File

@ -147,7 +147,7 @@ void TimeZoneRegressionTest:: Test4073215()
SimpleDateFormat sdf((UnicodeString)"E d MMM yyyy G HH:mm", status);
if(U_FAILURE(status)) {
errcheckln(status, "Error creating date format %s", u_errorName(status));
dataerrln("Error creating date format %s", u_errorName(status));
return;
}
sdf.setCalendar(cal);