test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
Print this page
rev 7259 : 8044186: Introduce a reproducible random generator
Reviewed-by: iignatyev
Contributed-by: sergei.kovalev@oracle.com
*** 1,7 ****
/*
! * Copyright (c) 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2013, 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.
*** 23,38 ****
/*
* @test
* @bug 8026844
* @summary Test repeating subtractExact
* @compile SubExactIRepeatTest.java Verify.java
* @run main SubExactIRepeatTest
*
*/
! import java.lang.ArithmeticException;
public class SubExactIRepeatTest {
public static void main(String[] args) {
runTest(new Verify.SubExactI());
}
--- 23,40 ----
/*
* @test
* @bug 8026844
* @summary Test repeating subtractExact
+ * @library /testlibrary
* @compile SubExactIRepeatTest.java Verify.java
* @run main SubExactIRepeatTest
*
*/
! import com.oracle.java.testlibrary.Utils;
! import java.util.Random;
public class SubExactIRepeatTest {
public static void main(String[] args) {
runTest(new Verify.SubExactI());
}
*** 44,54 ****
result += method.unchecked(x, y);
return result;
}
public static void runTest(Verify.BinaryMethod method) {
! java.util.Random rnd = new java.util.Random();
for (int i = 0; i < 50000; ++i) {
int x = Integer.MIN_VALUE + 10;
int y = Integer.MAX_VALUE - 10 + rnd.nextInt(5);
int c = rnd.nextInt() / 2;
--- 46,56 ----
result += method.unchecked(x, y);
return result;
}
public static void runTest(Verify.BinaryMethod method) {
! Random rnd = Utils.getRandomInstance();
for (int i = 0; i < 50000; ++i) {
int x = Integer.MIN_VALUE + 10;
int y = Integer.MAX_VALUE - 10 + rnd.nextInt(5);
int c = rnd.nextInt() / 2;
test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File