harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r499961 - /harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java
Date Thu, 25 Jan 2007 20:46:17 GMT
Author: geirm
Date: Thu Jan 25 12:46:17 2007
New Revision: 499961

URL: http://svn.apache.org/viewvc?view=rev&rev=499961
Log:
Fix test_hashCode() - there is no reason to believe that a hashCode() must be 
negative.  Also, added a test to ensure that a clone returns the same hashCode().


Modified:
    harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java?view=diff&rev=499961&r1=499960&r2=499961
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java
Thu Jan 25 12:46:17 2007
@@ -193,10 +193,12 @@
      */
     public void test_hashCode() {
         // Test for method int java.text.DateFormatSymbols.hashCode()
-        int hc1 = hashCode();
-        int hc2 = hashCode();
-        assertTrue("hashCode() returned negative number", hc1 >= 0);
-        assertTrue("hashCode() returned inconsistent number", hc1 == hc2);
+        int hc1 = dfs.hashCode();
+        int hc2 = dfs.hashCode();
+        assertTrue("hashCode() returned inconsistent number : " + hc1 + " - " + hc2, hc1
== hc2);
+
+        assertTrue("hashCode() returns different values for equal() objects", 
+                            dfs.hashCode() == dfs.clone().hashCode());
     }
 
     /**



Mime
View raw message