test/java/awt/geom/AffineTransform/TestInvertMethods.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 21,31 ****
* questions.
*/
/**
* @test
! * @bug 4987374
* @summary Unit test for inversion methods:
*
* AffineTransform.createInverse();
* AffineTransform.invert();
*
--- 21,31 ----
* questions.
*/
/**
* @test
! * @bug 4987374 8062163
* @summary Unit test for inversion methods:
*
* AffineTransform.createInverse();
* AffineTransform.invert();
*
*** 186,195 ****
--- 186,197 ----
double m10 = at.getShearY();
double m01 = at.getShearX();
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;
if (Math.abs(m10) < 1E-15) m10 = 0.0;
at.setTransform(m00, m10,
*** 271,281 ****
public static class Rotate extends Tester {
public void test(AffineTransform init, Tester next, boolean full) {
int inc = full ? 10 : 45;
for (int i = -720; i <= 720; i += inc) {
AffineTransform at2 = new AffineTransform(init);
! at2.rotate(Math.toRadians(i));
if (verbose) System.out.println("*Rotate("+i+") = "+at2);
next.test(at2, full);
}
}
}
--- 273,283 ----
public static class Rotate extends Tester {
public void test(AffineTransform init, Tester next, boolean full) {
int inc = full ? 10 : 45;
for (int i = -720; i <= 720; i += inc) {
AffineTransform at2 = new AffineTransform(init);
! at2.rotate(i / 180.0 * Math.PI);
if (verbose) System.out.println("*Rotate("+i+") = "+at2);
next.test(at2, full);
}
}
}