diff options
author | Neil Fuller <nfuller@google.com> | 2015-06-09 16:19:32 +0100 |
---|---|---|
committer | Neil Fuller <nfuller@google.com> | 2015-06-10 10:41:52 +0100 |
commit | 38a0b85afd4231f46fac59e59ee38729bd5154c4 (patch) | |
tree | 1372863850d681f12c535d821b09a70df0671a01 /luni/src | |
parent | 33019c39f1aad75d763cd03f91c7b48cff50e75f (diff) | |
download | libcore-38a0b85afd4231f46fac59e59ee38729bd5154c4.zip libcore-38a0b85afd4231f46fac59e59ee38729bd5154c4.tar.gz libcore-38a0b85afd4231f46fac59e59ee38729bd5154c4.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
Change-Id: I0f03f54b76dc5d343a2c842434412ff59908b129
Diffstat (limited to 'luni/src')
-rw-r--r-- | luni/src/test/java/libcore/java/text/OldDateFormatTest.java | 6 |
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 { |