summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-06-09 16:19:32 +0100
committerNeil Fuller <nfuller@google.com>2015-06-15 11:25:59 +0100
commit2e2e29c3e70abebaf4e56cadffeed37ccf862836 (patch)
tree7147c410b92c8421c2b55625955350a25c69dcd0 /luni
parent7329657b7087ab1a1411c8911edd9c392f415969 (diff)
downloadlibcore-2e2e29c3e70abebaf4e56cadffeed37ccf862836.zip
libcore-2e2e29c3e70abebaf4e56cadffeed37ccf862836.tar.gz
libcore-2e2e29c3e70abebaf4e56cadffeed37ccf862836.tar.bz2
Explicitly set DateFormat.is24Hour value needed by tests
Some tests fail under CTS if the device is set to use the 24 hour clock. The tests that depend on the value of the setting are now being explicit. Bug: 20899571 Bug: 20937589 Bug: 20939139 Bug: 20378566 Bug: 21585934 Bug: https://code.google.com/p/android/issues/detail?id=162384 (cherry-picked from commit 38a0b85afd4231f46fac59e59ee38729bd5154c4) Change-Id: I1a369baeeac929ef010e7906e92544b9f483f02c
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/libcore/java/text/OldDateFormatTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/text/OldDateFormatTest.java b/luni/src/test/java/libcore/java/text/OldDateFormatTest.java
index df388d3..1bd1d0c 100644
--- a/luni/src/test/java/libcore/java/text/OldDateFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldDateFormatTest.java
@@ -86,6 +86,8 @@ public class OldDateFormatTest extends junit.framework.TestCase {
*/
public void test_formatLjava_util_Date() {
try {
+ // This test assumes a default DateFormat.is24Hour setting.
+ DateFormat.is24Hour = null;
DateFormat format = DateFormat.getDateTimeInstance(
DateFormat.SHORT, DateFormat.SHORT, Locale.US);
Date current = new Date();
@@ -104,6 +106,8 @@ public class OldDateFormatTest extends junit.framework.TestCase {
*/
public void test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition() {
try {
+ // This test assumes a default DateFormat.is24Hour setting.
+ DateFormat.is24Hour = null;
DateFormat format = DateFormat.getDateTimeInstance(
DateFormat.SHORT, DateFormat.SHORT, Locale.US);
Date current = new Date();
@@ -204,6 +208,8 @@ public class OldDateFormatTest extends junit.framework.TestCase {
* java.text.DateFormat#parse(String)
*/
public void test_parseLString() throws Exception {
+ // This test assumes a default DateFormat.is24Hour setting.
+ DateFormat.is24Hour = null;
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US);
try {