Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/IntegerValue/equals/equals002a.java
41161 views
/*1* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.jdi.IntegerValue.equals;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdi.*;282930/**31* <code>equals002a</code> is deugee's part of the test.<br>32* It contains the static fields with boundary values for each primitive type.<br>33* <code>ClassToCheck</code> delivers values for first parameter of <code>equals</code>.<br>34*/35public class equals002a {3637static ClassToCheck testedObj = new ClassToCheck();38static String[] testedFields = {39"cmpObjNULL",40"cmpObject",41"cmpBoolMAX",42"cmpBoolMIN",43"cmpByteMAX",44"cmpByte1",45"cmpByte0",46"cmpByte_1",47"cmpByteMIN",48"cmpCharMAX",49"cmpCharMIN",50"cmpDoubleMAX",51"cmpDouble1",52"cmpDouble0",53"cmpDouble_1",54"cmpDoubleMIN",55"cmpFloatMAX",56"cmpFloat1",57"cmpFloat0",58"cmpFloat_1",59"cmpFloatMIN",60"cmpIntMAX",61"cmpInt1",62"cmpInt0",63"cmpInt_1",64"cmpIntMIN",65"cmpLongMAX",66"cmpLong1",67"cmpLong0",68"cmpLong_1",69"cmpLongMIN",70"cmpShortMAX",71"cmpShort1",72"cmpShort0",73"cmpShort_1",74"cmpShortMIN"75};7677static Object cmpObjNULL = null;78static Object cmpObject = new Object();79static boolean cmpBoolMAX = true;80static boolean cmpBoolMIN = false;81static byte cmpByteMAX = Byte.MAX_VALUE;82static byte cmpByte1 = 1;83static byte cmpByte0 = 0;84static byte cmpByte_1 = -1;85static byte cmpByteMIN = Byte.MIN_VALUE;86static char cmpCharMAX = Character.MAX_VALUE;87static char cmpCharMIN = Character.MIN_VALUE;88static double cmpDoubleMAX= Double.MAX_VALUE;89static double cmpDouble1 = 1;90static double cmpDouble0 = 0;91static double cmpDouble_1 = -1;92static double cmpDoubleMIN= Double.MIN_VALUE;93static float cmpFloatMAX = Float.MAX_VALUE;94static float cmpFloat1 = 1;95static float cmpFloat0 = 0;96static float cmpFloat_1 = -1;97static float cmpFloatMIN = Float.MIN_VALUE;98static int cmpIntMAX = Integer.MAX_VALUE;99static int cmpInt1 = 1;100static int cmpInt0 = 0;101static int cmpInt_1 = -1;102static int cmpIntMIN = Integer.MIN_VALUE;103static long cmpLongMAX = Long.MAX_VALUE;104static long cmpLong1 = 1;105static long cmpLong0 = 0;106static long cmpLong_1 = -1;107static long cmpLongMIN = Long.MIN_VALUE;108static short cmpShortMAX = Short.MAX_VALUE;109static short cmpShort1 = 1;110static short cmpShort0 = 0;111static short cmpShort_1 = -1;112static short cmpShortMIN = Short.MIN_VALUE;113114public static void main (String argv[]) {115116ArgumentHandler argHandler = new ArgumentHandler(argv);117Log log = new Log(System.err, argHandler);118IOPipe pipe = argHandler.createDebugeeIOPipe(log);119pipe.println("ready");120121String instruction = pipe.readln();122123if ( instruction.equals("quit") ) {124log.display("DEBUGEE> \"quit\" signal received.");125log.display("DEBUGEE> completed succesfully.");126System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);127}128log.complain("DEBUGEE FAILURE> unexpected signal "129+ "(no \"quit\") - " + instruction);130log.complain("DEBUGEE FAILURE> TEST FAILED");131System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);132}133}134135class ClassToCheck {136public int integerMAX = Integer.MAX_VALUE;137public int int1 = 1;138public int int0 = 0;139public int int_1 = -1;140public int integerMIN = Integer.MIN_VALUE;141}142143144