From 5e2bae89096e86de42ab4f557dd2b3257afb326c Mon Sep 17 00:00:00 2001 From: Deborah Goldsmith Date: Wed, 1 Jun 2005 17:45:25 +0000 Subject: [PATCH] ICU-4239 test fixes for warnings from ucurr_getName X-SVN-Rev: 17767 --- icu4c/source/test/intltest/numfmtst.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/icu4c/source/test/intltest/numfmtst.cpp b/icu4c/source/test/intltest/numfmtst.cpp index e6bf04c2eb3..ef78f02061c 100644 --- a/icu4c/source/test/intltest/numfmtst.cpp +++ b/icu4c/source/test/intltest/numfmtst.cpp @@ -1419,6 +1419,7 @@ void NumberFormatTest::TestCurrencyNames(void) { // USD { "US$", "US Dollar" } // 04/04/1792- UErrorCode ec = U_ZERO_ERROR; static const UChar USD[] = {85, 83, 68, 0}; /*USD*/ + static const UChar CAD[] = {0x43, 0x41, 0x44, 0}; /*CAD*/ UBool isChoiceFormat; int32_t len; // Warning: HARD-CODED LOCALE DATA in this test. If it fails, CHECK @@ -1435,6 +1436,16 @@ void NumberFormatTest::TestCurrencyNames(void) { &isChoiceFormat, &len, &ec))); assertSuccess("ucurr_getName", ec); + // Test that a default or fallback warning is being returned. JB 4239. + (void) ucurr_getName(CAD, "en_US", UCURR_LONG_NAME, &isChoiceFormat, + &len, &ec); + assertTrue("ucurr_getName (fallback)", + U_USING_FALLBACK_WARNING == ec, TRUE); + (void) ucurr_getName(CAD, "vi", UCURR_LONG_NAME, &isChoiceFormat, + &len, &ec); + assertTrue("ucurr_getName (default)", + U_USING_DEFAULT_WARNING == ec, TRUE); + // TODO add more tests later }