From: Shane F. Carr Date: Thu, 26 Mar 2020 01:24:08 +0000 (-0500) Subject: ICU-21005 Fix exhaustive test failure in IntlTestNumberFormat. X-Git-Tag: release-67-rc~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d26f83f83bdd5786a0719bc3ab161eccf8770b5;p=icu ICU-21005 Fix exhaustive test failure in IntlTestNumberFormat. --- diff --git a/icu4c/source/data/curr/su.txt b/icu4c/source/data/curr/su.txt index 02f5cdfcd2c..17a010fbf3f 100644 --- a/icu4c/source/data/curr/su.txt +++ b/icu4c/source/data/curr/su.txt @@ -40,7 +40,7 @@ su{ } XXX{ "¤", - "-", + "XXX", } } Currencies%narrow{ @@ -83,7 +83,7 @@ su{ other{"dolar A.S."} } XXX{ - other{"-"} + other{"XXX"} } } CurrencyUnitPatterns{ diff --git a/icu4j/main/shared/data/icudata.jar b/icu4j/main/shared/data/icudata.jar index 68dd388dd54..fa364e07b96 100644 --- a/icu4j/main/shared/data/icudata.jar +++ b/icu4j/main/shared/data/icudata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:11d8383eaff95db943d886a25e5c9d5a251e7c905868a72ed1dad5db51531fe4 -size 13149629 +oid sha256:d9d191cce367af280b3f9abfba02153754ea1339df538e4b0954e383478ac48e +size 13149615 diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestNumberFormat.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestNumberFormat.java index 2f7dcb10c1f..59624df0053 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestNumberFormat.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestNumberFormat.java @@ -13,6 +13,7 @@ **/ package com.ibm.icu.dev.test.format; + import java.util.Locale; import java.util.Random; @@ -23,6 +24,7 @@ import org.junit.runners.JUnit4; import com.ibm.icu.dev.test.TestFmwk; import com.ibm.icu.text.DecimalFormat; import com.ibm.icu.text.NumberFormat; +import com.ibm.icu.util.ULocale; /** * This test does round-trip testing (format -> parse -> format -> parse -> etc.) of @@ -167,6 +169,8 @@ public class IntlTestNumberFormat extends TestFmwk { boolean dump = false; int i; + String message = "Locale: " + fNumberFormat.getLocale(ULocale.VALID_LOCALE); + for (i = 0; i < DEPTH; i++) { if (i == 0) { number[i] = aNumber; @@ -174,7 +178,7 @@ public class IntlTestNumberFormat extends TestFmwk { try { number[i - 1] = fNumberFormat.parse(string[i - 1]).doubleValue(); } catch(java.text.ParseException pe) { - errln("**** FAIL: Parse of " + string[i-1] + " failed."); + errln("**** FAIL: Parse of " + string[i-1] + " failed: " + message); dump = true; break; } @@ -187,7 +191,7 @@ public class IntlTestNumberFormat extends TestFmwk { numberMatch = i; else if (numberMatch > 0 && number[i] != number[i-1]) { - errln("**** FAIL: Numeric mismatch after match."); + errln("**** FAIL: Numeric mismatch after match: " + message); dump = true; break; } @@ -195,7 +199,7 @@ public class IntlTestNumberFormat extends TestFmwk { stringMatch = i; else if (stringMatch > 0 && string[i] != string[i-1]) { - errln("**** FAIL: String mismatch after match."); + errln("**** FAIL: String mismatch after match: " + message); dump = true; break; } @@ -208,7 +212,7 @@ public class IntlTestNumberFormat extends TestFmwk { if (stringMatch > 2 || numberMatch > 2) { - errln("**** FAIL: No string and/or number match within 2 iterations."); + errln("**** FAIL: No string and/or number match within 2 iterations: " + message); dump = true; } @@ -229,16 +233,19 @@ public class IntlTestNumberFormat extends TestFmwk { public void tryIt(int aNumber) { long number; + String message = "Locale: " + fNumberFormat.getLocale(ULocale.VALID_LOCALE); + String stringNum = fNumberFormat.format(aNumber); try { number = fNumberFormat.parse(stringNum).longValue(); } catch (java.text.ParseException pe) { - errln("**** FAIL: Parse of " + stringNum + " failed."); + errln("**** FAIL: Parse of " + stringNum + " failed: " + message); return; } if (number != aNumber) { - errln("**** FAIL: Parse of " + stringNum + " failed. Got:" + number + errln("**** FAIL: Parse of " + stringNum + " failed: " + message + + " Got:" + number + " Expected:" + aNumber); } @@ -279,9 +286,9 @@ public class IntlTestNumberFormat extends TestFmwk { count = locales.length; if (count != 0) { - if (TestFmwk.getExhaustiveness() < 10 && count > 6) { - count = 6; - locales = new Locale[6]; + if (TestFmwk.getExhaustiveness() < 10 && count > 7) { + count = 7; + locales = new Locale[count]; locales[0] = allLocales[0]; locales[1] = allLocales[1]; locales[2] = allLocales[2]; @@ -291,6 +298,7 @@ public class IntlTestNumberFormat extends TestFmwk { locales[3] = new Locale("ar", "AE", ""); locales[4] = new Locale("cs", "CZ", ""); locales[5] = new Locale("en", "IN", ""); + locales[6] = new Locale("su", "", ""); } for (int i=0; i