Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/BooleanValue/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.BooleanValue.equals;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdi.*;2829/**30* <code>equals002a</code> is deugee's part of the test.<br>31* It contains the static fields with boundary values for each primitive type.<br>32* <code>ClassToCheck</code> delivers values for first parameter of <code>equals</code>.<br>33*/34public class equals002a {3536static ClassToCheck testedObj = new ClassToCheck();37static String[] testedFields = {38"cmpObjNULL",39"cmpObject",40"cmpBoolMAX",41"cmpBoolMIN",42"cmpByteMAX",43"cmpByteMIN",44"cmpCharMAX",45"cmpCharMIN",46"cmpDoubleMAX",47"cmpDoubleMIN",48"cmpFloatMAX",49"cmpFloatMIN",50"cmpIntMAX",51"cmpIntMIN",52"cmpLongMAX",53"cmpLongMIN",54"cmpShortMAX",55"cmpShortMIN"56};5758static Object cmpObjNULL = null;59static Object cmpObject = new Object();60static boolean cmpBoolMAX = true;61static boolean cmpBoolMIN = false;62static byte cmpByteMAX = Byte.MAX_VALUE;63static byte cmpByteMIN = Byte.MIN_VALUE;64static char cmpCharMAX = Character.MAX_VALUE;65static char cmpCharMIN = Character.MIN_VALUE;66static double cmpDoubleMAX= Double.MAX_VALUE;67static double cmpDoubleMIN= Double.MIN_VALUE;68static float cmpFloatMAX = Float.MAX_VALUE;69static float cmpFloatMIN = Float.MIN_VALUE;70static int cmpIntMAX = Integer.MAX_VALUE;71static int cmpIntMIN = Integer.MIN_VALUE;72static long cmpLongMAX = Long.MAX_VALUE;73static long cmpLongMIN = Long.MIN_VALUE;74static short cmpShortMAX = Short.MAX_VALUE;75static short cmpShortMIN = Short.MIN_VALUE;7677public static void main (String argv[]) {7879ArgumentHandler argHandler = new ArgumentHandler(argv);80Log log = new Log(System.err, argHandler);81IOPipe pipe = argHandler.createDebugeeIOPipe(log);82pipe.println("ready");8384String instruction = pipe.readln();8586if ( instruction.equals("quit") ) {87log.display("DEBUGEE> \"quit\" signal received.");88log.display("DEBUGEE> completed succesfully.");89System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);90}91log.complain("DEBUGEE FAILURE> unexpected signal "92+ "(no \"quit\") - " + instruction);93log.complain("DEBUGEE FAILURE> TEST FAILED");94System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);95}96}9798class ClassToCheck {99public boolean boolTRUE = true;100public boolean boolFALSE = false;101}102103104