summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-06-06 16:39:33 -0700
committerElliott Hughes <enh@google.com>2013-06-06 16:39:33 -0700
commit8c8fdca4a5c764fa7a6990dc44252736e5f44846 (patch)
tree1d181186266a296ba25213db1c493bbe37b4a070 /luni
parentb5ba804a3b6d00c63a59902b782c11a0af9ed205 (diff)
downloadlibcore-8c8fdca4a5c764fa7a6990dc44252736e5f44846.zip
libcore-8c8fdca4a5c764fa7a6990dc44252736e5f44846.tar.gz
libcore-8c8fdca4a5c764fa7a6990dc44252736e5f44846.tar.bz2
Add a test for bug 9087737.
This won't crash unless you're very unlucky, but at least valgrind will notice something untoward is going on. Bug: 9087737 Change-Id: I486374a85d4f0cc3a0e7afec29a1003ce1951a5a
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/libcore/java/text/DecimalFormatTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java
index a2f93a8..9de1f0a 100644
--- a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java
@@ -22,6 +22,7 @@ import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
+import java.util.Currency;
import java.util.Locale;
import tests.support.Support_Locale;
@@ -176,4 +177,11 @@ public class DecimalFormatTest extends junit.framework.TestCase {
BigDecimal d = new BigDecimal(value);
assertEquals(expectedResult, df.format(d));
}
+
+ public void testBug9087737() throws Exception {
+ DecimalFormat df = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.US);
+ // These shouldn't make valgrind unhappy.
+ df.setCurrency(Currency.getInstance("CHF"));
+ df.setCurrency(Currency.getInstance("GBP"));
+ }
}