Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/equals/equals001a.java
41161 views
1
/*
2
* Copyright (c) 2001, 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.LocalVariable.equals;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
31
/**
32
* This class is used as debuggee application for the equals001 JDI test.
33
*/
34
35
public class equals001a {
36
37
//----------------------------------------------------- templete section
38
39
static final int PASSED = 0;
40
static final int FAILED = 2;
41
static final int PASS_BASE = 95;
42
43
//-------------------------------------------------- log procedures
44
45
static boolean verbMode = false;
46
47
private static void log1(String message) {
48
if (verbMode)
49
System.err.println("**> equals001a: " + message);
50
}
51
52
private static void logErr(String message) {
53
if (verbMode)
54
System.err.println("!!**> equals001a: " + message);
55
}
56
57
//====================================================== test program
58
59
static TestClass obj = new TestClass();
60
61
//---------------------------------------------------- main method
62
63
public static void main (String argv[]) {
64
65
for (int i=0; i<argv.length; i++) {
66
if ( argv[i].equals("-vbs") || argv[i].equals("-verbose") ) {
67
verbMode = true;
68
break;
69
}
70
}
71
log1("debuggee started!");
72
73
// informing a debugger of readyness
74
ArgumentHandler argHandler = new ArgumentHandler(argv);
75
IOPipe pipe = argHandler.createDebugeeIOPipe();
76
pipe.println("ready");
77
78
79
int exitCode = PASSED;
80
for (int i = 0; ; i++) {
81
82
String instruction;
83
84
log1("waiting for an instruction from the debugger ...");
85
instruction = pipe.readln();
86
if (instruction.equals("quit")) {
87
log1("'quit' recieved");
88
break ;
89
90
} else if (instruction.equals("newcheck")) {
91
switch (i) {
92
93
//------------------------------------------------------ section tested
94
95
case 0:
96
pipe.println("checkready");
97
break ;
98
99
//------------------------------------------------- standard end section
100
101
default:
102
pipe.println("checkend");
103
break ;
104
}
105
106
} else {
107
logErr("ERRROR: unexpected instruction: " + instruction);
108
exitCode = FAILED;
109
break ;
110
}
111
}
112
113
System.exit(exitCode + PASS_BASE);
114
}
115
}
116
117
class TestClass {
118
119
public void testmethod1 (int param1, int param2) {
120
121
boolean bl1 = false, bl2 = true;
122
byte bt1 = 0, bt2 = 1;
123
char ch1 = 0, ch2 = 1;
124
double db1 = 0.0d, db2 = 1.0d;
125
float fl1 = 0.0f, fl2 = 1.0f;
126
int in1 = 0, in2 = 1;
127
long ln1 = 0, ln2 = 1;
128
short sh1 = 0, sh2 = 1;
129
130
ClassForCheck_2 class2_1 = new ClassForCheck_2();
131
ClassForCheck_2 class2_2 = new ClassForCheck_2();
132
133
InterfaceForCheck iface_1 = class2_1;
134
InterfaceForCheck iface_2 = class2_2;
135
136
ClassForCheck[] cfc_1 = { new ClassForCheck(), new ClassForCheck() };
137
ClassForCheck[] cfc_2 = { new ClassForCheck(), new ClassForCheck() };
138
139
return;
140
}
141
142
public void testmethod2 (int param1, int param2) {
143
144
boolean bl1 = false, bl2 = true;
145
byte bt1 = 0, bt2 = 1;
146
char ch1 = 0, ch2 = 1;
147
double db1 = 0.0d, db2 = 1.0d;
148
float fl1 = 0.0f, fl2 = 1.0f;
149
int in1 = 0, in2 = 1;
150
long ln1 = 0, ln2 = 1;
151
short sh1 = 0, sh2 = 1;
152
153
ClassForCheck_2 class2_1 = new ClassForCheck_2();
154
ClassForCheck_2 class2_2 = new ClassForCheck_2();
155
156
InterfaceForCheck iface_1 = class2_1;
157
InterfaceForCheck iface_2 = class2_2;
158
159
ClassForCheck[] cfc_1 = { new ClassForCheck(), new ClassForCheck() };
160
ClassForCheck[] cfc_2 = { new ClassForCheck(), new ClassForCheck() };
161
162
return;
163
}
164
165
}
166
167
168
interface InterfaceForCheck {
169
170
// static final boolean s_iface_boolean = true;
171
static final byte s_iface_byte = (byte)1;
172
static final char s_iface_char = '1';
173
static final double s_iface_double = 999;
174
static final float s_iface_float = 99;
175
static final int s_iface_int = 100;
176
static final long s_iface_long = 1000;
177
static final Object s_iface_object = new Object();
178
}
179
180
class ClassForCheck_2 implements InterfaceForCheck {
181
}
182
183
class ClassForCheck {
184
185
// static fields
186
187
static boolean bl[] = {true, false};
188
189
static boolean s_boolean;
190
static byte s_byte;
191
static char s_char;
192
static double s_double;
193
static float s_float;
194
static int s_int;
195
static long s_long;
196
197
// instance fields
198
199
boolean i_boolean;
200
byte i_byte;
201
char i_char;
202
double i_double;
203
float i_float;
204
int i_int;
205
long i_long;
206
}
207
208