ICU-10483 Fix no data test errors in ICU4C 53m1
X-SVN-Rev: 34979
This commit is contained in:
parent
1c67f2b859
commit
4e806c800e
@ -691,7 +691,9 @@ RelativeDateTimeFormatter& RelativeDateTimeFormatter::operator=(
|
||||
}
|
||||
|
||||
RelativeDateTimeFormatter::~RelativeDateTimeFormatter() {
|
||||
ptr->removeRef();
|
||||
if (ptr != NULL) {
|
||||
ptr->removeRef();
|
||||
}
|
||||
}
|
||||
|
||||
const NumberFormat& RelativeDateTimeFormatter::getNumberFormat() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************
|
||||
* Copyright (c) 1997-2013, International Business Machines
|
||||
* Copyright (c) 1997-2014, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
********************************************************************
|
||||
*
|
||||
@ -259,7 +259,7 @@ static void TestCalendar()
|
||||
resultlength = ucal_getCanonicalTimeZoneID(PST, -1,
|
||||
canonicalID, sizeof(canonicalID)/sizeof(UChar), &isSystemID, &status);
|
||||
if (U_FAILURE(status)) {
|
||||
log_err("FAIL: error in ucal_getCanonicalTimeZoneID : %s\n", u_errorName(status));
|
||||
log_data_err("FAIL: error in ucal_getCanonicalTimeZoneID : %s\n", u_errorName(status));
|
||||
} else {
|
||||
if (u_strcmp(AMERICA_LOS_ANGELES, canonicalID) != 0) {
|
||||
log_data_err("FAIL: ucal_getCanonicalTimeZoneID(%s) returned %s : expected - %s (Are you missing data?)\n",
|
||||
|
@ -1476,7 +1476,7 @@ static void TestContext(void) {
|
||||
}
|
||||
udatpg_close(udtpg);
|
||||
} else {
|
||||
log_err("FAIL: udatpg_open for locale %s, status %s\n", textContextItemPtr->locale, u_errorName(status) );
|
||||
log_data_err("FAIL: udatpg_open for locale %s, status %s\n", textContextItemPtr->locale, u_errorName(status) );
|
||||
}
|
||||
}
|
||||
for (textRelContextItemPtr = textContextRelativeItems; textRelContextItemPtr->locale != NULL; ++textRelContextItemPtr) {
|
||||
|
@ -1534,17 +1534,22 @@ void DateFormatRegressionTest::TestT10334(void) {
|
||||
UnicodeString text("--mon-02-march-2011");
|
||||
SimpleDateFormat format(pattern, status);
|
||||
|
||||
if (U_FAILURE(status)) {
|
||||
dataerrln("Fail creating SimpleDateFormat object - %s", u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
format.setBooleanAttribute(UDAT_PARSE_PARTIAL_MATCH, FALSE, status);
|
||||
format.parse(text, status);
|
||||
if (!U_FAILURE(status)) {
|
||||
errln("parse partial match did NOT fail in strict mode", u_errorName(status));
|
||||
errln("parse partial match did NOT fail in strict mode - %s", u_errorName(status));
|
||||
}
|
||||
|
||||
status = U_ZERO_ERROR;
|
||||
format.setBooleanAttribute(UDAT_PARSE_PARTIAL_MATCH, TRUE, status);
|
||||
format.parse(text, status);
|
||||
if (U_FAILURE(status)) {
|
||||
errln("parse partial match failure in lenient mode", u_errorName(status));
|
||||
errln("parse partial match failure in lenient mode - %s", u_errorName(status));
|
||||
}
|
||||
|
||||
status = U_ZERO_ERROR;
|
||||
|
@ -7326,6 +7326,11 @@ void NumberFormatTest::Test10468ApplyPattern() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
DecimalFormat fmt("'I''ll'*a###.##", status);
|
||||
|
||||
if (U_FAILURE(status)) {
|
||||
errcheckln(status, "DecimalFormat constructor failed - %s", u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
if (fmt.getPadCharacterString() != UnicodeString("a")) {
|
||||
errln("Padding character should be 'a'.");
|
||||
return;
|
||||
@ -7344,6 +7349,10 @@ void NumberFormatTest::Test10468ApplyPattern() {
|
||||
void NumberFormatTest::TestRoundingScientific10542() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
DecimalFormat format("0.00E0", status);
|
||||
if (U_FAILURE(status)) {
|
||||
errcheckln(status, "DecimalFormat constructor failed - %s", u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
DecimalFormat::ERoundingMode roundingModes[] = {
|
||||
DecimalFormat::kRoundCeiling,
|
||||
|
@ -1961,10 +1961,10 @@ void TimeZoneTest::TestCanonicalIDAPI() {
|
||||
canonicalID.setToBogus();
|
||||
ec = U_ZERO_ERROR;
|
||||
pResult = &TimeZone::getCanonicalID(berlin, canonicalID, ec);
|
||||
assertSuccess("TimeZone::getCanonicalID(bogus dest) should succeed", ec);
|
||||
assertSuccess("TimeZone::getCanonicalID(bogus dest) should succeed", ec, TRUE);
|
||||
assertTrue("TimeZone::getCanonicalID(bogus dest) should return the dest string", pResult == &canonicalID);
|
||||
assertFalse("TimeZone::getCanonicalID(bogus dest) should un-bogus the dest string", canonicalID.isBogus());
|
||||
assertEquals("TimeZone::getCanonicalID(bogus dest) unexpected result", canonicalID, berlin);
|
||||
assertEquals("TimeZone::getCanonicalID(bogus dest) unexpected result", canonicalID, berlin, TRUE);
|
||||
}
|
||||
|
||||
void TimeZoneTest::TestCanonicalID() {
|
||||
|
Loading…
Reference in New Issue
Block a user