diff options
author | Elliott Hughes <enh@google.com> | 2014-09-05 16:25:43 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-05 16:25:44 +0000 |
commit | 019acff099095fac32f2a0c51f6df79f1d709c01 (patch) | |
tree | 25c798c0f745e98217032257414da9eb65e67c2f /luni/src | |
parent | 433348326c496760dabee1130b17e684419cca4d (diff) | |
parent | 41231627e3385b3160d6fa421de6bc3cbc94f96c (diff) | |
download | libcore-019acff099095fac32f2a0c51f6df79f1d709c01.zip libcore-019acff099095fac32f2a0c51f6df79f1d709c01.tar.gz libcore-019acff099095fac32f2a0c51f6df79f1d709c01.tar.bz2 |
Merge "Make sure calendars are compared correctly." into lmp-dev
Diffstat (limited to 'luni/src')
-rw-r--r-- | luni/src/test/java/libcore/java/util/CalendarTest.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/luni/src/test/java/libcore/java/util/CalendarTest.java b/luni/src/test/java/libcore/java/util/CalendarTest.java index b2f6b94..e0e1a35 100644 --- a/luni/src/test/java/libcore/java/util/CalendarTest.java +++ b/luni/src/test/java/libcore/java/util/CalendarTest.java @@ -17,6 +17,7 @@ package libcore.java.util; import java.util.Calendar; +import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; @@ -245,14 +246,21 @@ public class CalendarTest extends junit.framework.TestCase { // here. We should add a targetSdkVersion based check and throw for each of these // cases. public void test_nullLocale() { - assertEquals( + assertCalendarConfigEquals( Calendar.getInstance(Locale.getDefault()), Calendar.getInstance((Locale) null)); - assertEquals( + assertCalendarConfigEquals( Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault()), Calendar.getInstance(TimeZone.getDefault(), null)); - assertEquals( + assertCalendarConfigEquals( new GregorianCalendar(Locale.getDefault()), new GregorianCalendar((Locale) null)); } + + public void assertCalendarConfigEquals(Calendar a, Calendar b) { + Date d = new Date(); + a.setTime(d); + b.setTime(d); + assertEquals(a, b); + } } |