You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2014/10/03 18:37:19 UTC
svn commit: r1629253 - in /db/derby/code/branches/10.11: ./
java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java
java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
Author: rhillegas
Date: Fri Oct 3 16:37:19 2014
New Revision: 1629253
URL: http://svn.apache.org/r1629253
Log:
DERBY-6755: Port 1629251 (derby-6755-01-aa-java9diff.diff) from trunk to 10.11 branch.
Modified:
db/derby/code/branches/10.11/ (props changed)
db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java
db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
Propchange: db/derby/code/branches/10.11/
------------------------------------------------------------------------------
Merged /db/derby/code/trunk:r1629251
Modified: db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java?rev=1629253&r1=1629252&r2=1629253&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java (original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/lang/MathTrigFunctionsTest.java Fri Oct 3 16:37:19 2014
@@ -676,15 +676,15 @@ public class MathTrigFunctionsTest exten
// Numbers below verified by using lava.lang.StrictMath.toRadians
// outside Derby context. First number: argument to ps and psFN, second
- // number: expected result.
+ // number: expected result. Actual results vary by JVM level. See DERBY-6755.
double[][] inOut = new double[][] {
{180.0d, java.lang.StrictMath.PI},
{PRE_DERBY_3398_SMALLEST_NEG_DERBY_DOUBLE, -3.1375609430176863E306},
{DOUBLE_MIN_NORMAL, 3.8834864931005E-310},
{Double.MIN_VALUE, 0.0d},
{Double.MAX_VALUE, 3.1375664143845866E306},
- {PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE, 3.88335758568738E-309},
- {PRE_DERBY_3398_LARGEST_NEG_DERBY_DOUBLE, -3.88335758568738E-309},
+ {PRE_DERBY_3398_SMALLEST_POS_DERBY_DOUBLE, vmAtLeast( 1, 9 ) ? 3.883357585687384E-309 : 3.88335758568738E-309},
+ {PRE_DERBY_3398_LARGEST_NEG_DERBY_DOUBLE, vmAtLeast( 1, 9 ) ? -3.883357585687384E-309 : -3.88335758568738E-309},
};
for (int i=0; i < inOut.length; i++) {
Modified: db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java?rev=1629253&r1=1629252&r2=1629253&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java (original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java Fri Oct 3 16:37:19 2014
@@ -19,6 +19,7 @@
*/
package org.apache.derbyTesting.junit;
+import org.apache.derbyTesting.functionTests.harness.JavaVersionHolder;
import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;
import junit.framework.Assert;
import junit.framework.TestCase;
@@ -1219,6 +1220,22 @@ public abstract class BaseTestCase
}
}
+ /** Return true if the JVM is at least at the indicated rev level */
+ public static boolean vmAtLeast( int major, int minor )
+ {
+ String version = AccessController.doPrivileged
+ (new PrivilegedAction<String>(){
+ public String run(){
+ return System.getProperty( "java.version" );
+ }
+ }
+ );
+
+ JavaVersionHolder jvh = new JavaVersionHolder( version );
+
+ return jvh.atLeast( major, minor );
+ }
+
/** Makes the current thread sleep up to {@code ms} milliseconds. */
public static void sleep(long ms) {
try {