Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/CharValue/compareTo/compareto001a.java
41160 views
1
/*
2
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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
package nsk.jdi.CharValue.compareTo;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
/**
31
* The debugged application of the test.
32
*/
33
public class compareto001a {
34
35
//----------------------------------------------------- immutable common fields
36
37
private static int exitStatus;
38
private static ArgumentHandler argHandler;
39
private static Log log;
40
private static IOPipe pipe;
41
42
//---------------------------------------------------------- immutable common methods
43
44
static void display(String msg) {
45
log.display("debuggee > " + msg);
46
}
47
48
static void complain(String msg) {
49
log.complain("debuggee FAILURE > " + msg);
50
}
51
52
public static void receiveSignal(String signal) {
53
String line = pipe.readln();
54
55
if ( !line.equals(signal) )
56
throw new Failure("UNEXPECTED debugger's signal " + line);
57
58
display("debuger's <" + signal + "> signal received.");
59
}
60
61
//------------------------------------------------------ mutable common fields
62
63
//------------------------------------------------------ test specific fields
64
static compareto001aClassToCheck testedObj = new compareto001aClassToCheck();
65
static String[] testedFields = {
66
"cmpObjNULL",
67
"cmpObject",
68
"cmpBoolMAX",
69
"cmpBoolMIN",
70
"cmpByteMAX",
71
"cmpByte1",
72
"cmpByte0",
73
"cmpByte_1",
74
"cmpByteMIN",
75
"cmpCharMAX",
76
"cmpCharMIN",
77
"cmpDoubleMAX",
78
"cmpDouble1",
79
"cmpDouble0",
80
"cmpDouble_1",
81
"cmpDoubleMIN",
82
"cmpFloatMAX",
83
"cmpFloat1",
84
"cmpFloat0",
85
"cmpFloat_1",
86
"cmpFloatMIN",
87
"cmpIntMAX",
88
"cmpInt1",
89
"cmpInt0",
90
"cmpInt_1",
91
"cmpIntMIN",
92
"cmpLongMAX",
93
"cmpLong1",
94
"cmpLong0",
95
"cmpLong_1",
96
"cmpLongMIN",
97
"cmpShortMAX",
98
"cmpShort1",
99
"cmpShort0",
100
"cmpShort_1",
101
"cmpShortMIN"
102
};
103
104
static Object cmpObjNULL = null;
105
static Object cmpObject = new Object();
106
static boolean cmpBoolMAX = true;
107
static boolean cmpBoolMIN = false;
108
static byte cmpByteMAX = Byte.MAX_VALUE;
109
static byte cmpByte1 = 1;
110
static byte cmpByte0 = 0;
111
static byte cmpByte_1 = -1;
112
static byte cmpByteMIN = Byte.MIN_VALUE;
113
static char cmpCharMAX = Character.MAX_VALUE;
114
static char cmpChar0 = 'a';
115
static char cmpChar1 = '%';
116
static char cmpChar2 = '\t';
117
static char cmpCharMIN = Character.MIN_VALUE;
118
static double cmpDoubleMAX= Double.MAX_VALUE;
119
static double cmpDouble1 = 1;
120
static double cmpDouble0 = 0;
121
static double cmpDouble_1 = -1;
122
static double cmpDoubleMIN= Double.MIN_VALUE;
123
static float cmpFloatMAX = Float.MAX_VALUE;
124
static float cmpFloat1 = 1;
125
static float cmpFloat0 = 0;
126
static float cmpFloat_1 = -1;
127
static float cmpFloatMIN = Float.MIN_VALUE;
128
static int cmpIntMAX = Integer.MAX_VALUE;
129
static int cmpInt1 = 1;
130
static int cmpInt0 = 0;
131
static int cmpInt_1 = -1;
132
static int cmpIntMIN = Integer.MIN_VALUE;
133
static long cmpLongMAX = Long.MAX_VALUE;
134
static long cmpLong1 = 1;
135
static long cmpLong0 = 0;
136
static long cmpLong_1 = -1;
137
static long cmpLongMIN = Long.MIN_VALUE;
138
static short cmpShortMAX = Short.MAX_VALUE;
139
static short cmpShort1 = 1;
140
static short cmpShort0 = 0;
141
static short cmpShort_1 = -1;
142
static short cmpShortMIN = Short.MIN_VALUE;
143
144
//------------------------------------------------------ mutable common method
145
146
public static void main (String argv[]) {
147
148
exitStatus = Consts.TEST_FAILED;
149
argHandler = new ArgumentHandler(argv);
150
log = argHandler.createDebugeeLog();
151
pipe = argHandler.createDebugeeIOPipe(log);
152
153
try {
154
pipe.println(compareto001.SIGNAL_READY);
155
// receiveSignal(compareto001.SIGNAL_GO);
156
157
receiveSignal(compareto001.SIGNAL_QUIT);
158
display("completed succesfully.");
159
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
160
} catch (Failure e) {
161
log.complain(e.getMessage());
162
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
163
}
164
}
165
166
//--------------------------------------------------------- test specific methods
167
168
}
169
170
//--------------------------------------------------------- test specific classes
171
172
class compareto001aClassToCheck {
173
public char charMAX = Character.MAX_VALUE;
174
public char char0 = 'a';
175
public char char1 = '%';
176
public char char2 = '\t';
177
public char charMIN = Character.MIN_VALUE;
178
}
179
180