[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] [9] RFR: JDK-7107620, , Need to round in test java/awt/print/PageFormat/PageFor
From:       Philip Race <philip.race () oracle ! com>
Date:       2016-03-23 22:28:21
Message-ID: 56F31885.2040300 () oracle ! com
[Download RAW message or body]

+1. I think one reviewer will suffice for this test fix.

-phil.

On 3/23/16, 12:26 AM, prasanta sadhukhan wrote:
> Hi Phil,
>
> Please review a simple fix for jdk9.
> Bug: https://bugs.openjdk.java.net/browse/JDK-7107620
> webrev: http://cr.openjdk.java.net/~psadhukhan/7107620/webrev.00/
>
> It was seen width/height obtained by calculating via MediaSize/units 
> is not same as obtained from Paper.getWIdth/getHeight().
> It seems the testcase is storing the result of the calculations in 
> "int" varible whereas MediaSize.getX()/getY() is "float" and units is 
> "double" variable thereby resulting is loss of precision.
>
> It was only seen in osx as osx returns a integer value for 
> getWidth()/getHeight() ie 842 instead of ~841.889 maybe because it 
> rounds off to nearest whereas MediaSize/units value is stored as 841 
> when typecasted to int
> resulting in failure.
> Modified testcase to store in "double" to avoid loss of precision and 
> use Math.round() to round off to nearest value before comparing these 
> 2 values (from MediaSize/units and getWidth/getHeight).
>
> Tested in windows, linux, mac to be working.
>
> Regards
> Prasanta
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic