changeset 22545:17fe5ef92696

More tests with doubles in the TCK to verify IEEE754 compliance
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Thu, 14 Jan 2016 14:09:27 +0100
parents 9aded7e1e122
children e77bcc4e4af6
files truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java
diffstat 1 files changed, 56 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Thu Jan 07 16:06:31 2016 +0100
+++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Thu Jan 14 14:09:27 2016 +0100
@@ -581,6 +581,62 @@
         doPlusWithDouble(a, b);
     }
 
+    @Test
+    public void testPlusWithDoubleMaxMinInt() throws Exception {
+        double a = Integer.MAX_VALUE;
+        double b = Integer.MIN_VALUE;
+
+        doPlusWithDouble(a, b);
+    }
+
+    @Test
+    public void testPlusWithDoubleMinIntMinusOne() throws Exception {
+        double a = -1;
+        double b = Integer.MIN_VALUE;
+
+        doPlusWithDouble(a, b);
+    }
+
+    @Test
+    public void testPlusWithDoubleMaxIntPlusOne() throws Exception {
+        double a = 1;
+        double b = Integer.MAX_VALUE;
+
+        doPlusWithDouble(a, b);
+    }
+
+    @Test
+    public void testPlusWithDoubleNaNPlusNegInf() throws Exception {
+        double a = Double.NaN;
+        double b = Double.NEGATIVE_INFINITY;
+
+        doPlusWithDouble(a, b);
+    }
+
+    @Test
+    public void testPlusWithDoubleNaNPlusPosInf() throws Exception {
+        double a = Double.NaN;
+        double b = Double.POSITIVE_INFINITY;
+
+        doPlusWithDouble(a, b);
+    }
+
+    @Test
+    public void testPlusWithDoubleMaxIntPlusPosInf() throws Exception {
+        double a = Integer.MAX_VALUE;
+        double b = Double.POSITIVE_INFINITY;
+
+        doPlusWithDouble(a, b);
+    }
+
+    @Test
+    public void testPlusWithDoubleMaxIntPlusNegInf() throws Exception {
+        double a = Integer.MAX_VALUE;
+        double b = Double.NEGATIVE_INFINITY;
+
+        doPlusWithDouble(a, b);
+    }
+
     private void doPlusWithDouble(double a, double b) throws Exception {
         PolyglotEngine.Value plus = findGlobalSymbol(plus(double.class, double.class));