From a2b57cea30e10f675ac0127987c2e63b35853154 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Mon, 17 Dec 2012 16:23:38 +0000 Subject: [PATCH] ICU-9802 Fix failures in running intltest without data X-SVN-Rev: 32981 --- icu4c/source/test/intltest/dtfmttst.cpp | 4 ++++ icu4c/source/test/intltest/numrgts.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/icu4c/source/test/intltest/dtfmttst.cpp b/icu4c/source/test/intltest/dtfmttst.cpp index cc6d7b603c..d56da3dfc7 100644 --- a/icu4c/source/test/intltest/dtfmttst.cpp +++ b/icu4c/source/test/intltest/dtfmttst.cpp @@ -4112,6 +4112,10 @@ void DateFormatTest::TestDotAndAtLeniency() { LocalPointer format(DateFormat::createDateTimeInstance(dateStyle, timeStyle, locale)); LocalPointer timeFormat(DateFormat::createTimeInstance(timeStyle, locale)); UnicodeString formattedString; + if (format.isNull()) { + dataerrln("Unable to create DateFormat"); + continue; + } format->format(TEST_DATE, formattedString); if (!showParse(*format, formattedString)) { diff --git a/icu4c/source/test/intltest/numrgts.cpp b/icu4c/source/test/intltest/numrgts.cpp index 4470c37a49..633d4537ad 100644 --- a/icu4c/source/test/intltest/numrgts.cpp +++ b/icu4c/source/test/intltest/numrgts.cpp @@ -2904,8 +2904,11 @@ void NumberFormatRegressionTest::Test9677(void) { UErrorCode status = U_ZERO_ERROR; LocalUNumberFormatPointer f(unum_open(UNUM_DEFAULT, NULL, 0, "en_US", NULL, &status)); + if (U_FAILURE(status)) { + dataerrln("Failure opening unum_open"); + return; + } - assertSuccess("opening unum_open", status); if (U_SUCCESS(status)) { unum_applyPattern(f.getAlias(), FALSE, pattern, -1, NULL, &status); unum_setTextAttribute(f.getAlias(), UNUM_POSITIVE_PREFIX, positivePrefix, -1, &status);