harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r447351 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/DoubleTest.java
Date Mon, 18 Sep 2006 10:18:45 GMT
Author: pyang
Date: Mon Sep 18 03:18:44 2006
New Revision: 447351

URL: http://svn.apache.org/viewvc?view=rev&rev=447351
Log:
First updated patch applied for HARMONY-747 (java.lang.Double.parseDouble(String) does not
support Hex number)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/DoubleTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/DoubleTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/DoubleTest.java?view=diff&rev=447351&r1=447350&r2=447351
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/DoubleTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/DoubleTest.java
Mon Sep 18 03:18:44 2006
@@ -552,6 +552,74 @@
                 "-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055595409854908458349204328908234982349050934129878452378432452458968024357823490509341298784523784324524589680243578234905093412987845237843245245896802435782349050934129878452378432452458968024357868024357823490509341298784523784324524589680243578234905093412987845237843245245896802435786802435782349050934129878452378432452458968024357823490509341298784523784324524589680243578",
                 0x8000000000000001L, "-4.9E-324");
     }
+    
+    /**
+     * @tests java.lang.Double#parseDouble(java.lang.String)
+     */
+    public void test_parseDouble_LString_Hexadecimal() {
+        try {
+            Double.parseDouble("0.0p0D");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble("+0x.p1d");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble("0Xg.gp1D");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble("-0x1.1p");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble("+0x 1.1 p2d");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble("x1.1p2d");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble(" 0x-2.1p2");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble(" 0x2.1pad");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+
+        try {
+            Double.parseDouble(" 0x111.222p 22d");
+            fail("Should throw NumberFormatException.");
+        } catch (NumberFormatException e) {
+            // expected
+        }
+    }
 
     /**
      * @tests java.lang.Double#shortValue()



Mime
View raw message