test/java/lang/Double/BitwiseConversion.java

Print this page

        

@@ -23,25 +23,27 @@
 
 /*
  * @test
  * @bug 5037596
  * @summary Verify bitwise conversion works for non-canonical NaN values
+ * @library ../Math
+ * @build DoubleUtils
+ * @run main BitwiseConversion
  * @author Joseph D. Darcy
  */
 
 import static java.lang.Double.*;
-import static sun.misc.DoubleConsts.*;
 
 public class BitwiseConversion {
     static int testNanCase(long x) {
         int errors  = 0;
         // Strip out sign and exponent bits
-        long y = x & SIGNIF_BIT_MASK;
+        long y = x & DoubleUtils.SIGNIF_BIT_MASK;
 
         double values[] = {
-            longBitsToDouble(EXP_BIT_MASK | y),
-            longBitsToDouble(SIGN_BIT_MASK | EXP_BIT_MASK | y)
+            longBitsToDouble(DoubleUtils.EXP_BIT_MASK | y),
+            longBitsToDouble(DoubleUtils.SIGN_BIT_MASK | DoubleUtils.EXP_BIT_MASK | y)
         };
 
         for(double value: values) {
             if (!isNaN(value)) {
                 throw new RuntimeException("Invalid input " + y +

@@ -58,11 +60,11 @@
     }
 
     public static void main(String... argv) {
         int errors = 0;
 
-        for (int i = 0; i < SIGNIFICAND_WIDTH-1; i++) {
+        for (int i = 0; i < DoubleUtils.SIGNIFICAND_WIDTH-1; i++) {
             errors += testNanCase(1L<<i);
         }
 
         if (doubleToLongBits(Double.POSITIVE_INFINITY)
                 != 0x7ff0000000000000L) {