harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r477185 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/lang/ main/native/luni/linux/ main/native/luni/shared/ main/native/luni/windows/ test/java/org/apache/harmony/luni/tests/java/lang/
Date Mon, 20 Nov 2006 14:14:04 GMT
Author: pyang
Date: Mon Nov 20 06:14:03 2006
New Revision: 477185

URL: http://svn.apache.org/viewvc?view=rev&rev=477185
Log:
Apply patch for HARMONY-2222([classlib][luni]a testcase failed on j.l.Math.log10(double))

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/libhyluni.exp
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/math.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/hyluni.def
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java?view=diff&rev=477185&r1=477184&r2=477185
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java Mon Nov
20 06:14:03 2006
@@ -252,10 +252,7 @@
      *            the value to compute the log10 of
      * @return the natural logarithm of the argument.
      */
-    public static double log10(double d) {
-        //TODO: this is a stub to integrate HARMONY-935
-        return log(d)/log(10);
-    }
+    public static native double log10(double d);
     
     /**
      * Answers the closest double approximation of the natural logarithm of the

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/libhyluni.exp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/libhyluni.exp?view=diff&rev=477185&r1=477184&r2=477185
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/libhyluni.exp
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/linux/libhyluni.exp
Mon Nov 20 06:14:03 2006
@@ -104,6 +104,7 @@
 		Java_java_lang_Math_hypot;
 		Java_java_lang_Math_IEEEremainder;
 		Java_java_lang_Math_log;
+		Java_java_lang_Math_log10;
 		Java_java_lang_Math_log1p;
 		Java_java_lang_Math_nextafter;
 		Java_java_lang_Math_nextafterf;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/math.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/math.c?view=diff&rev=477185&r1=477184&r2=477185
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/math.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/math.c Mon Nov
20 06:14:03 2006
@@ -492,6 +492,11 @@
   return internal_log10 (arg1);
 }
 
+jdouble JNICALL
+Java_java_lang_Math_log10 (JNIEnv * env, jclass jclazz, jdouble arg1)
+{
+  return internal_log10 (arg1);
+}
 
 jdouble JNICALL
 Java_java_lang_StrictMath_log1p (JNIEnv * env, jclass jclazz, jdouble arg1)

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/hyluni.def
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/hyluni.def?view=diff&rev=477185&r1=477184&r2=477185
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/hyluni.def (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/hyluni.def Mon
Nov 20 06:14:03 2006
@@ -97,6 +97,7 @@
 	Java_java_lang_Math_hypot
 	Java_java_lang_Math_IEEEremainder
 	Java_java_lang_Math_log
+	Java_java_lang_Math_log10
 	Java_java_lang_Math_log1p
 	Java_java_lang_Math_nextafter
 	Java_java_lang_Math_nextafterf

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java?view=diff&rev=477185&r1=477184&r2=477185
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
Mon Nov 20 06:14:03 2006
@@ -316,6 +316,29 @@
 	}
     
     /**
+     * @tests java.lang.Math#log10(double)
+     */
+    @SuppressWarnings("boxing")
+    public void test_log10_D() {
+        // Test for special cases
+        assertTrue(Double.isNaN(Math.log10(Double.NaN)));
+        assertTrue(Double.isNaN(Math.log10(-2541.05745687234187532)));
+        assertTrue(Double.isNaN(Math.log10(-0.1)));
+        assertEquals(Double.POSITIVE_INFINITY, Math.log10(Double.POSITIVE_INFINITY));
+        assertEquals(Double.NEGATIVE_INFINITY, Math.log10(0.0));
+        assertEquals(Double.NEGATIVE_INFINITY, Math.log10(+0.0));
+        assertEquals(Double.NEGATIVE_INFINITY, Math.log10(-0.0));
+        
+        assertEquals(3.0, Math.log10(1000.0));
+        assertEquals(14.0, Math.log10(Math.pow(10, 14)));
+        assertEquals(3.7389561269540406, Math.log10(5482.2158));
+        assertEquals(14.661551142893833, Math.log10(458723662312872.125782332587));
+        assertEquals(-0.9083828622192334, Math.log10(0.12348583358871));
+        assertEquals(308.25471555991675, Math.log10(Double.MAX_VALUE));
+        assertEquals(-323.3062153431158, Math.log10(Double.MIN_VALUE));
+    }
+    
+    /**
      * @tests java.lang.Math#log1p(double)
      */
     public void test_log1p_D() {



Mime
View raw message