harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r419424 - /incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatTest.java
Date Thu, 06 Jul 2006 03:35:19 GMT
Author: ndbeyer
Date: Wed Jul  5 20:35:19 2006
New Revision: 419424

URL: http://svn.apache.org/viewvc?rev=419424&view=rev
Log:
Apply patch of regression tests for HARMONY-106: java.text.DecimalFormat does not parse infinite
values correctly

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatTest.java?rev=419424&r1=419423&r2=419424&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatTest.java
Wed Jul  5 20:35:19 2006
@@ -1523,4 +1523,30 @@
         // assertEquals(df, deserializedDF);
 
     }
+
+    /**
+     * Test whether DecimalFormat can parse Positive infinity correctly
+     */
+    public void testParseInfinityBigDecimalFalse() {
+        // Regression test for HARMONY-106
+        DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
+        DecimalFormatSymbols symbols = new DecimalFormatSymbols();
+        Number number = format.parse(symbols.getInfinity(),
+                new ParsePosition(0));
+        assertTrue(number instanceof Double);
+        assertTrue(Double.isInfinite(number.doubleValue()));
+    }
+
+    /**
+     * Test whether DecimalFormat can parse Negative infinity correctly
+     */
+    public void testParseMinusInfinityBigDecimalFalse() {
+        // Regression test for HARMONY-106
+        DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
+        DecimalFormatSymbols symbols = new DecimalFormatSymbols();
+        Number number = format.parse("-" + symbols.getInfinity(),
+                new ParsePosition(0));
+        assertTrue(number instanceof Double);
+        assertTrue(Double.isInfinite(number.doubleValue()));
+    }
 }



Mime
View raw message