Merge "Change ReferenceQueue.add to append at end of the unenqueued list" into lmp-dev
diff --git a/expectations/knownfailures.txt b/expectations/knownfailures.txt
index 3de387a..175fe03 100644
--- a/expectations/knownfailures.txt
+++ b/expectations/knownfailures.txt
@@ -1458,5 +1458,12 @@
names: [
"com.squareup.okhttp.internal.http.HttpResponseCacheTest#setIfModifiedSince"
]
+},
+{
+ description: "libcore.java.text.DecimalFormatSymbolsTest#test_getInstance_unknown_or_invalid_locale assumes fallback to locale other than en_US_POSIX.",
+ bug: 17374604,
+ names: [
+ "libcore.java.text.DecimalFormatSymbolsTest#test_getInstance_unknown_or_invalid_locale"
+ ]
}
]
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.util.Locale;
public class DecimalFormatSymbolsTest extends junit.framework.TestCase {
+ public void test_getInstance_unknown_or_invalid_locale() throws Exception {
+ // 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);
}
- 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.
- checkLocaleIsEquivalentToRoot(new Locale("xx", "XX"));
- checkLocaleIsEquivalentToRoot(new Locale("not exist language", "not exist country"));
- }
// http://code.google.com/p/android/issues/detail?id=14495
public void testSerialization() throws Exception {