ICU-11313 Fix some no data test failures

X-SVN-Rev: 36865
This commit is contained in:
Michael Ow 2014-12-12 04:34:51 +00:00
parent 2480631b1c
commit f61f05e5f5
4 changed files with 11 additions and 7 deletions

View File

@ -337,7 +337,7 @@ class SimpleDateFormatMutableNFs : public UMemory {
}
U_ASSERT(idx < UDAT_FIELD_COUNT);
nodes[idx].key = &nf;
nodes[idx].value = (NumberFormat *) nf.clone();
nodes[idx].value = (&nf == NULL) ? NULL : (NumberFormat *) nf.clone();
return nodes[idx].value;
}
private:

View File

@ -2506,7 +2506,7 @@ void DateFormatTest::TestDateFormatSymbolsClone(void)
Locale valid1;
Locale actual1;
if (!getActualAndValidLocales(*fmt, valid1, actual1)) {
errln("FAIL: Could not fetch valid + actual locales");
dataerrln("FAIL: Could not fetch valid + actual locales");
return;
}
LocalPointer<Format> fmtClone(fmt->clone());
@ -3835,7 +3835,9 @@ void DateFormatTest::TestFormalChineseDate() {
// create formatter
SimpleDateFormat *sdf = new SimpleDateFormat(pattern,override,Locale::getChina(),status);
failure(status, "new SimpleDateFormat with override", TRUE);
if (failure(status, "new SimpleDateFormat with override", TRUE)) {
return;
}
UDate thedate = date(2009-1900, UCAL_JULY, 28);
FieldPosition pos(0);

View File

@ -2097,7 +2097,7 @@ void LocaleTest::checkRegisteredCollators(const char *expectExtra) {
// the 'old' list (non enumeration)
const Locale* oldList = Collator::getAvailableLocales(count1);
if(oldList == NULL) {
errln("Error: Collator::getAvailableLocales(count) returned NULL");
dataerrln("Error: Collator::getAvailableLocales(count) returned NULL");
return;
}

View File

@ -1385,9 +1385,11 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
baseBI.adoptInstead(BreakIterator::createSentenceInstance(Locale::getFrench(), status));
TEST_ASSERT_SUCCESS(status);
logln("Building new BI\n");
frenchBI.adoptInstead(builder->build(baseBI.orphan(), status));
TEST_ASSERT_SUCCESS(status);
if (U_SUCCESS(status)) {
logln("Building new BI\n");
frenchBI.adoptInstead(builder->build(baseBI.orphan(), status));
TEST_ASSERT_SUCCESS(status);
}
if(frenchBI.isValid()) {
logln("Testing:");