8211002: test/jdk/java/lang/Math/PowTests.java skips testing for non-corner-case values

Reviewed-by: darcy
This commit is contained in:
Brian Burkhalter 2021-07-22 20:35:05 +00:00
parent 984003d5c9
commit 1362e09479

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2021, 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
@ -57,6 +57,15 @@ public class PowTests {
return failures;
}
static int testStrictVsNonstrictPowCase(double input1, double input2) {
double smResult = StrictMath.pow(input1, input2);
double mResult = Math.pow(input1, input2);
return Tests.testUlpDiff(
"StrictMath.pow(double, double) vs Math.pow(double, double)",
input1, input2, mResult, smResult, 2.0
);
}
/*
* Test for bad negation implementation.
*/
@ -206,8 +215,10 @@ public class PowTests {
assert y != 0.0;
failures += testStrictPowCase(x, y, f3(x, y));
failures += testNonstrictPowCase(x, y, f3ns(x, y));
failures += testStrictVsNonstrictPowCase(x, y);
continue;
} else {
failures += testStrictVsNonstrictPowCase(x, y);
// go to next iteration
expected = NaN;
continue;