summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-09-26 15:52:49 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-26 15:52:49 +0000
commit37fcc48b63f95775d0304bf0bd3b9d7ff30e2232 (patch)
tree7188c247cacab4e3ee145c94fb2ea5734eef1e01 /luni
parent77afa6c64f0af91224368452e3cce74338d667d2 (diff)
parent19dcdd94310c9a6aedb80e8b9570334fc7d24f6a (diff)
downloadlibcore-37fcc48b63f95775d0304bf0bd3b9d7ff30e2232.zip
libcore-37fcc48b63f95775d0304bf0bd3b9d7ff30e2232.tar.gz
libcore-37fcc48b63f95775d0304bf0bd3b9d7ff30e2232.tar.bz2
Merge "Mark libcore.java.text.DecimalFormatSymbolsTest#test_getInstance_unknown_or_invalid_locale a known failure."
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java b/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java
index 8b24c6d..619c38e 100644
--- a/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java
+++ b/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java
@@ -24,18 +24,21 @@ import java.text.DecimalFormatSymbols;
import java.util.Locale;
public class DecimalFormatSymbolsTest extends junit.framework.TestCase {
- private void checkLocaleIsEquivalentToRoot(Locale locale) {
- DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(locale);
- assertEquals(DecimalFormatSymbols.getInstance(Locale.ROOT), dfs);
- }
public void test_getInstance_unknown_or_invalid_locale() throws Exception {
- // TODO: we fail these tests because ROOT has "INF" for infinity but 'dfs' has "\u221e".
- // On the RI, ROOT has "\u221e" too, but DecimalFormatSymbols.equals appears to be broken;
- // it returns false for objects that -- if you compare their externally visible state --
- // are equal. It could be that they're accidentally checking the Locale.
+ // http://b/17374604: this test passes on the host but fails on the target.
+ // ICU uses setlocale(3) to determine its default locale, and glibc (on my box at least)
+ // returns "en_US.UTF-8". bionic before L returned NULL and in L returns "C.UTF-8", both
+ // of which get treated as "en_US_POSIX". What that means for this test is that you get
+ // "INF" for infinity instead of "\u221e".
+ // On the RI, this test fails for a different reason: their DecimalFormatSymbols.equals
+ // appears to be broken. It could be that they're accidentally checking the Locale field?
checkLocaleIsEquivalentToRoot(new Locale("xx", "XX"));
checkLocaleIsEquivalentToRoot(new Locale("not exist language", "not exist country"));
}
+ private void checkLocaleIsEquivalentToRoot(Locale locale) {
+ DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(locale);
+ assertEquals(DecimalFormatSymbols.getInstance(Locale.ROOT), dfs);
+ }
// http://code.google.com/p/android/issues/detail?id=14495
public void testSerialization() throws Exception {