harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r446561 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang: MathTest.java StrictMathTest.java
Date Fri, 15 Sep 2006 09:44:37 GMT
Author: hindessm
Date: Fri Sep 15 02:44:36 2006
New Revision: 446561

URL: http://svn.apache.org/viewvc?view=rev&rev=446561
Log:
Applied patch from "[#HARMONY-1461] [classlib][luni] refactor test cases in
MathTest and StrictMathTest".

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java?view=diff&rev=446561&r1=446560&r2=446561
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
Fri Sep 15 02:44:36 2006
@@ -126,9 +126,12 @@
         assertEquals("Should return Double.NEGATIVE_INFINITY",
                 Double.NEGATIVE_INFINITY, Math
                         .cbrt(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return 0.0", 0.0, Math.cbrt(0.0), 0D);
-        assertEquals("Should return +0.0", +0.0, Math.cbrt(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, Math.cbrt(-0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
+				.cbrt(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double.doubleToLongBits(Math
+				.cbrt(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double.doubleToLongBits(Math
+				.cbrt(-0.0)));
 
         assertEquals("Should return 3.0", 3.0, Math.cbrt(27.0), 0D);
         assertEquals("Should return 23.111993172558684", 23.111993172558684,
@@ -216,9 +219,12 @@
                 Double.POSITIVE_INFINITY, Math.expm1(Double.POSITIVE_INFINITY), 0D);
         assertEquals("Should return -1.0", -1.0, Math
                 .expm1(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return 0.0", 0.0, Math.expm1(0.0), 0D);
-        assertEquals("Should return +0.0", +0.0, Math.expm1(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, Math.expm1(-0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
+				.expm1(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.expm1(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.expm1(-0.0)));
 
         assertEquals("Should return -9.999950000166666E-6",
                 -9.999950000166666E-6, Math.expm1(-0.00001), 0D);
@@ -316,9 +322,12 @@
         assertTrue("Should return NaN", Double.isNaN(Math.log1p(-32.0482175)));
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, Math.log1p(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return 0.0", 0.0, Math.log1p(0.0), 0D);
-        assertEquals("Should return +0.0", +0.0, Math.log1p(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, Math.log1p(-0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
+				.log1p(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.log1p(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.log1p(-0.0)));
 
         assertEquals("Should return -0.2941782295312541", -0.2941782295312541,
                 Math.log1p(-0.254856327), 0D);
@@ -550,9 +559,12 @@
                 Double.POSITIVE_INFINITY, Math.sinh(Double.POSITIVE_INFINITY), 0D);
         assertEquals("Should return NEGATIVE_INFINITY",
                 Double.NEGATIVE_INFINITY, Math.sinh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return 0.0", 0.0, Math.sinh(0.0), 0D);
-        assertEquals("Should return +0.0", +0.0, Math.sinh(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, Math.sinh(-0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
+				.sinh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.sinh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.sinh(-0.0)));
 
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, Math.sinh(1234.56), 0D);
@@ -598,9 +610,12 @@
                 .tanh(Double.POSITIVE_INFINITY), 0D);
         assertEquals("Should return -1.0", -1.0, Math
                 .tanh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return +0.0", +0.0, Math.tanh(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, Math.tanh(-0.0), 0D);
-        assertEquals("Should return 0.0", 0.0, Math.tanh(0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
+				.tanh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.tanh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.tanh(-0.0)));
 
         assertEquals("Should return 1.0", 1.0, Math.tanh(1234.56), 0D);
         assertEquals("Should return -1.0", -1.0, Math.tanh(-1234.56), 0D);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java?view=diff&rev=446561&r1=446560&r2=446561
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java
Fri Sep 15 02:44:36 2006
@@ -123,9 +123,12 @@
         assertEquals("Should return Double.NEGATIVE_INFINITY",
                 Double.NEGATIVE_INFINITY, StrictMath
                         .cbrt(Double.NEGATIVE_INFINITY));
-        assertEquals("Should return 0.0", 0.0, StrictMath.cbrt(0.0));
-        assertEquals("Should return +0.0", +0.0, StrictMath.cbrt(+0.0));
-        assertEquals("Should return -0.0", -0.0, StrictMath.cbrt(-0.0));
+        assertEquals(Double.doubleToLongBits(0.0), Double
+				.doubleToLongBits(StrictMath.cbrt(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.cbrt(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.cbrt(-0.0)));
 
         assertEquals("Should return 3.0", 3.0, StrictMath.cbrt(27.0));
         assertEquals("Should return 23.111993172558684", 23.111993172558684,
@@ -227,9 +230,12 @@
                 Double.POSITIVE_INFINITY, StrictMath.expm1(Double.POSITIVE_INFINITY));
         assertEquals("Should return -1.0", -1.0, StrictMath
                 .expm1(Double.NEGATIVE_INFINITY));
-        assertEquals("Should return 0.0", 0.0, StrictMath.expm1(0.0));
-        assertEquals("Should return +0.0", +0.0, StrictMath.expm1(+0.0));
-        assertEquals("Should return -0.0", -0.0, StrictMath.expm1(-0.0));
+        assertEquals(Double.doubleToLongBits(0.0), Double
+				.doubleToLongBits(StrictMath.expm1(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.expm1(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.expm1(-0.0)));
 
         assertEquals("Should return -9.999950000166666E-6",
                 -9.999950000166666E-6, StrictMath.expm1(-0.00001));
@@ -371,9 +377,12 @@
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, StrictMath
                         .log1p(Double.POSITIVE_INFINITY));
-        assertEquals("Should return 0.0", 0.0, StrictMath.log1p(0.0));
-        assertEquals("Should return +0.0", +0.0, StrictMath.log1p(+0.0));
-        assertEquals("Should return -0.0", -0.0, StrictMath.log1p(-0.0));
+        assertEquals(Double.doubleToLongBits(0.0), Double
+				.doubleToLongBits(StrictMath.log1p(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.log1p(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.log1p(-0.0)));
 
         assertEquals("Should return -0.2941782295312541", -0.2941782295312541,
                 StrictMath.log1p(-0.254856327));
@@ -609,9 +618,12 @@
         assertEquals("Should return NEGATIVE_INFINITY",
                 Double.NEGATIVE_INFINITY, StrictMath
                         .sinh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return 0.0", 0.0, StrictMath.sinh(0.0), 0D);
-        assertEquals("Should return +0.0", +0.0, StrictMath.sinh(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, StrictMath.sinh(-0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double
+				.doubleToLongBits(StrictMath.sinh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.sinh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.sinh(-0.0)));
 
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, StrictMath.sinh(1234.56), 0D);
@@ -660,9 +672,12 @@
                 .tanh(Double.POSITIVE_INFINITY), 0D);
         assertEquals("Should return -1.0", -1.0, StrictMath
                 .tanh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return +0.0", +0.0, StrictMath.tanh(+0.0), 0D);
-        assertEquals("Should return -0.0", -0.0, StrictMath.tanh(-0.0), 0D);
-        assertEquals("Should return 0.0", 0.0, StrictMath.tanh(0.0), 0D);
+        assertEquals(Double.doubleToLongBits(0.0), Double
+				.doubleToLongBits(StrictMath.tanh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.tanh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.tanh(-0.0)));
 
         assertEquals("Should return 1.0", 1.0, StrictMath.tanh(1234.56), 0D);
         assertEquals("Should return -1.0", -1.0, StrictMath.tanh(-1234.56), 0D);



Mime
View raw message