test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
test/compiler/intrinsics/mathexact/AddExactIRepeatTest.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,37 ****
--- 23,41 ----
/*
* @test
* @bug 8025657
* @summary Test repeating addExact
+ * @library /testlibrary
* @compile AddExactIRepeatTest.java Verify.java
* @run main AddExactIRepeatTest
*
*/
+ import com.oracle.java.testlibrary.Utils;
+ import java.util.Random;
+
public class AddExactIRepeatTest {
public static void main(String[] args) {
runTest(new Verify.AddExactI());
}
*** 42,52 ****
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.MAX_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.MAX_VALUE - 10;
int y = Integer.MAX_VALUE - 10 + rnd.nextInt(5);
int c = rnd.nextInt() / 2;
test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File