rbackman@5791: /* rbackman@5791: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. rbackman@5791: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. rbackman@5791: * rbackman@5791: * This code is free software; you can redistribute it and/or modify it rbackman@5791: * under the terms of the GNU General Public License version 2 only, as rbackman@5791: * published by the Free Software Foundation. rbackman@5791: * rbackman@5791: * This code is distributed in the hope that it will be useful, but WITHOUT rbackman@5791: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or rbackman@5791: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License rbackman@5791: * version 2 for more details (a copy is included in the LICENSE file that rbackman@5791: * accompanied this code). rbackman@5791: * rbackman@5791: * You should have received a copy of the GNU General Public License version rbackman@5791: * 2 along with this work; if not, write to the Free Software Foundation, rbackman@5791: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. rbackman@5791: * rbackman@5791: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA rbackman@5791: * or visit www.oracle.com if you need additional information or have any rbackman@5791: * questions. rbackman@5791: */ rbackman@5791: rbackman@5791: /* rbackman@5791: * @test rbackman@5791: * @bug 8024924 rbackman@5791: * @summary Test non constant addExact rbackman@5791: * @compile NonConstantTest.java Verify.java rbackman@5791: * @run main NonConstantTest rbackman@5791: * rbackman@5791: */ rbackman@5791: rbackman@5791: import java.lang.ArithmeticException; rbackman@5791: rbackman@5791: public class NonConstantTest { rbackman@5791: public static java.util.Random rnd = new java.util.Random(); rbackman@5791: rbackman@5791: public static void main(String[] args) { rbackman@5791: for (int i = 0; i < 50000; ++i) { rbackman@5791: int rnd1 = rnd.nextInt(), rnd2 = rnd.nextInt(); rbackman@5791: Verify.verify(rnd1, rnd2); rbackman@5791: Verify.verify(rnd1, rnd2 + 1); rbackman@5791: Verify.verify(rnd1 + 1, rnd2); rbackman@5791: Verify.verify(rnd1 - 1, rnd2); rbackman@5791: Verify.verify(rnd1, rnd2 - 1); rbackman@5791: } rbackman@5791: } rbackman@5791: }