< prev index next >

test/java/math/BigInteger/SymmetricRangeTests.java

Print this page




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @ignore This test has huge memory requirements
  27  * @library ..
  28  * @run main/timeout=180/othervm -Xmx8g SymmetricRangeTests
  29  * @bug 6910473 8021204 8021203 9005933 8074460
  30  * @summary Test range of BigInteger values (use -Dseed=X to set PRNG seed)
  31  * @author Dmitry Nadezhin

  32  */
  33 import java.io.ByteArrayInputStream;
  34 import java.io.ByteArrayOutputStream;
  35 import java.io.IOException;
  36 import java.io.ObjectInputStream;
  37 import java.io.ObjectOutputStream;
  38 import java.util.Arrays;
  39 import java.math.BigInteger;
  40 
  41 public class SymmetricRangeTests {
  42 
  43     private static final BigInteger MAX_VALUE = makeMaxValue();
  44     private static final BigInteger MIN_VALUE = MAX_VALUE.negate();
  45 
  46     private static BigInteger makeMaxValue() {
  47         byte[] ba = new byte[1 << 28];
  48         Arrays.fill(ba, (byte) 0xFF);
  49         ba[0] = (byte) 0x7F;
  50         return new BigInteger(ba);
  51     }




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @ignore This test has huge memory requirements
  27  * @library ..
  28  * @run main/timeout=180/othervm -Xmx8g SymmetricRangeTests
  29  * @bug 6910473 8021204 8021203 9005933 8074460
  30  * @summary Test range of BigInteger values (use -Dseed=X to set PRNG seed)
  31  * @author Dmitry Nadezhin
  32  * @key randomness
  33  */
  34 import java.io.ByteArrayInputStream;
  35 import java.io.ByteArrayOutputStream;
  36 import java.io.IOException;
  37 import java.io.ObjectInputStream;
  38 import java.io.ObjectOutputStream;
  39 import java.util.Arrays;
  40 import java.math.BigInteger;
  41 
  42 public class SymmetricRangeTests {
  43 
  44     private static final BigInteger MAX_VALUE = makeMaxValue();
  45     private static final BigInteger MIN_VALUE = MAX_VALUE.negate();
  46 
  47     private static BigInteger makeMaxValue() {
  48         byte[] ba = new byte[1 << 28];
  49         Arrays.fill(ba, (byte) 0xFF);
  50         ba[0] = (byte) 0x7F;
  51         return new BigInteger(ba);
  52     }


< prev index next >