harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r407228 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
Date Wed, 17 May 2006 12:07:45 GMT
Author: gharley
Date: Wed May 17 05:07:44 2006
New Revision: 407228

URL: http://svn.apache.org/viewcvs?rev=407228&view=rev
Log:
HARMONY 468 : CalendarTest compareTo test is unstable

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java?rev=407228&r1=407227&r2=407228&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CalendarTest.java
Wed May 17 05:07:44 2006
@@ -399,21 +399,25 @@
 	 * @tests java.util.Calendar#compareTo(Calendar)
 	 */
 	public void test_compareToLjava_util_Calendar() {
-		Calendar cal = Calendar.getInstance();
-		cal.set(1997, 12, 13, 23, 57);
-		
-		Calendar anotherCal = Calendar.getInstance();
-		anotherCal.set(1997, 12, 13, 23, 57);
-		assertEquals(0, cal.compareTo(anotherCal));
-				
-		anotherCal = Calendar.getInstance();
-		anotherCal.set(1997, 11, 13, 24, 57);
-		assertEquals(1, cal.compareTo(anotherCal));
+        Calendar cal = Calendar.getInstance();
+        cal.clear();
+        cal.set(1997, 12, 13, 23, 57);
 
-		anotherCal = Calendar.getInstance();
-		anotherCal.set(1997, 12, 13, 23, 58);
-		assertEquals(-1, cal.compareTo(anotherCal));
-	}
+        Calendar anotherCal = Calendar.getInstance();
+        anotherCal.clear();
+        anotherCal.set(1997, 12, 13, 23, 57);
+        assertEquals(0, cal.compareTo(anotherCal));
+
+        anotherCal = Calendar.getInstance();
+        anotherCal.clear();
+        anotherCal.set(1997, 11, 13, 24, 57);
+        assertEquals(1, cal.compareTo(anotherCal));
+
+        anotherCal = Calendar.getInstance();
+        anotherCal.clear();
+        anotherCal.set(1997, 12, 13, 23, 58);
+        assertEquals(-1, cal.compareTo(anotherCal));
+    }
 
 	protected void setUp() {
 		defaultLocale = Locale.getDefault();



Mime
View raw message