diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index 18a444dd84a..468eaccafb4 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -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: diff --git a/icu4c/source/test/intltest/dtfmttst.cpp b/icu4c/source/test/intltest/dtfmttst.cpp index e15fa9e8e3e..0e9135d4b99 100644 --- a/icu4c/source/test/intltest/dtfmttst.cpp +++ b/icu4c/source/test/intltest/dtfmttst.cpp @@ -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 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); diff --git a/icu4c/source/test/intltest/loctest.cpp b/icu4c/source/test/intltest/loctest.cpp index 20feb407412..3053e30f438 100644 --- a/icu4c/source/test/intltest/loctest.cpp +++ b/icu4c/source/test/intltest/loctest.cpp @@ -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; } diff --git a/icu4c/source/test/intltest/rbbiapts.cpp b/icu4c/source/test/intltest/rbbiapts.cpp index 56e2be45c48..2fb0a40b530 100644 --- a/icu4c/source/test/intltest/rbbiapts.cpp +++ b/icu4c/source/test/intltest/rbbiapts.cpp @@ -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:");