# HG changeset patch # User rriggs # Date 1368201981 25200 # Node ID 1de0e7df9a905b878b9fedb62ed3810bab54b2e0 # Parent 1e94dbb5f8d757f9248c2331da9a26a83be9d35e 8014296: DivModTests should not compare pointers Reviewed-by: darcy diff -r 1e94dbb5f8d7 -r 1de0e7df9a90 jdk/test/java/lang/Math/DivModTests.java --- a/jdk/test/java/lang/Math/DivModTests.java Fri May 10 08:53:38 2013 -0700 +++ b/jdk/test/java/lang/Math/DivModTests.java Fri May 10 09:06:21 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, 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 @@ -137,7 +137,8 @@ int tmp = x / y; // Force ArithmeticException for divide by zero double ff = x - Math.floor((double)x / (double)y) * y; int fr = (int)ff; - if (fr != result) { + boolean t = (fr == ((Integer)result)); + if (!result.equals(fr)) { fail("FAIL: Math.floorMod(%d, %d) = %s differs from Math.floor(x, y): %d%n", x, y, result, fr); } } catch (ArithmeticException ae) { @@ -240,8 +241,8 @@ resultD = resultD.multiply(yD); resultD = xD.subtract(resultD); long fr = resultD.longValue(); - if (fr != result) { - fail("FAIL: Long.floorMod(%d, %d) = %d is different than BigDecimal result: %d%n",x, y, result, fr); + if (!result.equals(fr)) { + fail("FAIL: Long.floorMod(%d, %d) = %d is different than BigDecimal result: %d%n", x, y, result, fr); } } catch (ArithmeticException ae) {