From cdd02be3f20258005b19bcfe2d8956641bdfe825 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Mon, 18 Jul 2011 18:09:52 +0000 Subject: [PATCH] ICU-8716 Update collation and date format test to pass without data X-SVN-Rev: 30378 --- icu4c/source/test/cintltst/capitst.c | 2 +- icu4c/source/test/intltest/dtfmttst.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/icu4c/source/test/cintltst/capitst.c b/icu4c/source/test/cintltst/capitst.c index e70e838992..ed6dce798c 100644 --- a/icu4c/source/test/cintltst/capitst.c +++ b/icu4c/source/test/cintltst/capitst.c @@ -897,7 +897,7 @@ static void TestBengaliSortKey(void) c2 = ucol_openRules(rules, rulesLength, UCOL_DEFAULT, UCOL_DEFAULT_STRENGTH, NULL, &status); if (U_FAILURE(status)) { - log_err("ERROR: Creating collator from rules failed with locale: %s : %s\n", curLoc, myErrorName(status)); + log_data_err("ERROR: Creating collator from rules failed with locale: %s : %s\n", curLoc, myErrorName(status)); return; } diff --git a/icu4c/source/test/intltest/dtfmttst.cpp b/icu4c/source/test/intltest/dtfmttst.cpp index d1aa57f6af..85202f975f 100644 --- a/icu4c/source/test/intltest/dtfmttst.cpp +++ b/icu4c/source/test/intltest/dtfmttst.cpp @@ -3586,18 +3586,20 @@ void DateFormatTest::TestFormalChineseDate() { void DateFormatTest::TestStandAloneGMTParse() { UErrorCode status = U_ZERO_ERROR; SimpleDateFormat *sdf = new SimpleDateFormat("ZZZZ", Locale(""), status); - failure(status, "new SimpleDateFormat"); + + if (!failure(status, "new SimpleDateFormat")) { - UnicodeString inText("GMT$$$"); - for (int32_t i = 0; i < 10; i++) { - ParsePosition pos(0); - sdf->parse(inText, pos); - if (pos.getIndex() != 3) { - errln((UnicodeString)"FAIL: Incorrect output parse position: actual=" + pos.getIndex() + " expected=3"); + UnicodeString inText("GMT$$$"); + for (int32_t i = 0; i < 10; i++) { + ParsePosition pos(0); + sdf->parse(inText, pos); + if (pos.getIndex() != 3) { + errln((UnicodeString)"FAIL: Incorrect output parse position: actual=" + pos.getIndex() + " expected=3"); + } } - } - delete sdf; + delete sdf; + } } #endif /* #if !UCONFIG_NO_FORMATTING */