8062163: java/awt/geom/AffineTransform/TestInvertMethods.java test fails
authorprr
Thu, 06 Nov 2014 15:10:00 -0800
changeset 27761 0b8f80bdab90
parent 27760 40c141ec4ea1
child 27762 397a31d6d1a6
8062163: java/awt/geom/AffineTransform/TestInvertMethods.java test fails Reviewed-by: jgodinez
jdk/test/java/awt/geom/AffineTransform/TestInvertMethods.java
--- a/jdk/test/java/awt/geom/AffineTransform/TestInvertMethods.java	Wed Nov 05 18:33:28 2014 +0300
+++ b/jdk/test/java/awt/geom/AffineTransform/TestInvertMethods.java	Thu Nov 06 15:10:00 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 4987374
+ * @bug 4987374 8062163
  * @summary Unit test for inversion methods:
  *
  *          AffineTransform.createInverse();
@@ -188,6 +188,8 @@
             double m11 = at.getScaleY();
             double m02 = at.getTranslateX();
             double m12 = at.getTranslateY();
+            if (Math.abs(m00-1.0) < 1E-10) m00 = 1.0;
+            if (Math.abs(m11-1.0) < 1E-10) m11 = 1.0;
             if (Math.abs(m02) < 1E-10) m02 = 0.0;
             if (Math.abs(m12) < 1E-10) m12 = 0.0;
             if (Math.abs(m01) < 1E-15) m01 = 0.0;
@@ -273,7 +275,7 @@
                 int inc = full ? 10 : 45;
                 for (int i = -720; i <= 720; i += inc) {
                     AffineTransform at2 = new AffineTransform(init);
-                    at2.rotate(Math.toRadians(i));
+                    at2.rotate(i / 180.0 * Math.PI);
                     if (verbose) System.out.println("*Rotate("+i+") = "+at2);
                     next.test(at2, full);
                 }