Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/ConstantField/values001.java
41159 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.ConstantField;
25
26
import nsk.share.*;
27
import nsk.share.jdi.*;
28
29
import com.sun.jdi.*;
30
import com.sun.jdi.request.*;
31
32
import java.io.*;
33
import java.util.*;
34
35
/**
36
* Test checks up static fields of JDI interfaces according to specification
37
*/
38
public class values001 {
39
40
private static int exitStatus;
41
private static Log log;
42
43
public static void main(String argv[]) {
44
System.exit(Consts.JCK_STATUS_BASE + run(argv, System.out));
45
}
46
47
public static int run(String argv[], PrintStream out) {
48
49
exitStatus = Consts.TEST_PASSED;
50
51
ArgumentHandler argHandler = new ArgumentHandler(argv);
52
log = new Log(out, argHandler);
53
54
execTest();
55
56
log.display("execTest finished. exitStatus = " + exitStatus);
57
58
return exitStatus;
59
}
60
61
private static void execTest() {
62
exitStatus = Consts.TEST_PASSED;
63
64
if (ClassType.INVOKE_SINGLE_THREADED != 1) {
65
log.complain("***wrong value*** : ClassType.INVOKE_SINGLE_THREADED = "
66
+ ClassType.INVOKE_SINGLE_THREADED);
67
exitStatus = Consts.TEST_FAILED;
68
}
69
70
if (ObjectReference.INVOKE_NONVIRTUAL != 2) {
71
log.complain("***wrong value*** : ObjectReference.INVOKE_NONVIRTUAL = "
72
+ ObjectReference.INVOKE_NONVIRTUAL);
73
exitStatus = Consts.TEST_FAILED;
74
}
75
76
if (ObjectReference.INVOKE_SINGLE_THREADED != 1) {
77
log.complain("***wrong value*** : ObjectReference.INVOKE_SINGLE_THREADED = "
78
+ ObjectReference.INVOKE_SINGLE_THREADED);
79
exitStatus = Consts.TEST_FAILED;
80
}
81
82
if (ThreadReference.THREAD_STATUS_MONITOR != 3) {
83
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_MONITOR = "
84
+ ThreadReference.THREAD_STATUS_MONITOR);
85
exitStatus = Consts.TEST_FAILED;
86
}
87
88
if (ThreadReference.THREAD_STATUS_NOT_STARTED != 5) {
89
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_NOT_STARTED = "
90
+ ThreadReference.THREAD_STATUS_NOT_STARTED);
91
exitStatus = Consts.TEST_FAILED;
92
}
93
94
if (ThreadReference.THREAD_STATUS_RUNNING != 1) {
95
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_RUNNING = "
96
+ ThreadReference.THREAD_STATUS_RUNNING);
97
exitStatus = Consts.TEST_FAILED;
98
}
99
100
if (ThreadReference.THREAD_STATUS_SLEEPING != 2) {
101
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_SLEEPING = "
102
+ ThreadReference.THREAD_STATUS_SLEEPING);
103
exitStatus = Consts.TEST_FAILED;
104
}
105
106
if (ThreadReference.THREAD_STATUS_UNKNOWN != -1) {
107
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_UNKNOWN = "
108
+ ThreadReference.THREAD_STATUS_UNKNOWN);
109
exitStatus = Consts.TEST_FAILED;
110
}
111
112
if (ThreadReference.THREAD_STATUS_WAIT != 4) {
113
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_WAIT = "
114
+ ThreadReference.THREAD_STATUS_WAIT);
115
exitStatus = Consts.TEST_FAILED;
116
}
117
118
if (ThreadReference.THREAD_STATUS_ZOMBIE != 0) {
119
log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_ZOMBIE = "
120
+ ThreadReference.THREAD_STATUS_ZOMBIE);
121
exitStatus = Consts.TEST_FAILED;
122
}
123
124
125
// VirtualMachine
126
if (VirtualMachine.TRACE_ALL != 16777215) {
127
log.complain("***wrong value*** : VirtualMachine.TRACE_ALL = "
128
+ VirtualMachine.TRACE_ALL);
129
exitStatus = Consts.TEST_FAILED;
130
}
131
132
if (VirtualMachine.TRACE_EVENTS != 4) {
133
log.complain("***wrong value*** : VirtualMachine.TRACE_EVENTS = "
134
+ VirtualMachine.TRACE_EVENTS);
135
exitStatus = Consts.TEST_FAILED;
136
}
137
138
if (VirtualMachine.TRACE_NONE != 0) {
139
log.complain("***wrong value*** : VirtualMachine.TRACE_NONE = "
140
+ VirtualMachine.TRACE_NONE);
141
exitStatus = Consts.TEST_FAILED;
142
}
143
144
if (VirtualMachine.TRACE_OBJREFS != 16) {
145
log.complain("***wrong value*** : VirtualMachine.TRACE_OBJREFS = "
146
+ VirtualMachine.TRACE_OBJREFS);
147
exitStatus = Consts.TEST_FAILED;
148
}
149
150
if (VirtualMachine.TRACE_RECEIVES != 2) {
151
log.complain("***wrong value*** : VirtualMachine.TRACE_RECEIVES = "
152
+ VirtualMachine.TRACE_RECEIVES);
153
exitStatus = Consts.TEST_FAILED;
154
}
155
156
if (VirtualMachine.TRACE_REFTYPES != 8) {
157
log.complain("***wrong value*** : VirtualMachine.TRACE_REFTYPES = "
158
+ VirtualMachine.TRACE_REFTYPES);
159
exitStatus = Consts.TEST_FAILED;
160
}
161
162
if (VirtualMachine.TRACE_SENDS != 1) {
163
log.complain("***wrong value*** : VirtualMachine.TRACE_SENDS = "
164
+ VirtualMachine.TRACE_SENDS);
165
exitStatus = Consts.TEST_FAILED;
166
}
167
168
169
if (EventRequest.SUSPEND_ALL != 2) {
170
log.complain("***wrong value*** : EventRequest.SUSPEND_ALL = "
171
+ EventRequest.SUSPEND_ALL);
172
exitStatus = Consts.TEST_FAILED;
173
}
174
175
if (EventRequest.SUSPEND_EVENT_THREAD != 1) {
176
log.complain("***wrong value*** : EventRequest.SUSPEND_EVENT_THREAD = "
177
+ EventRequest.SUSPEND_EVENT_THREAD);
178
exitStatus = Consts.TEST_FAILED;
179
}
180
181
if (EventRequest.SUSPEND_NONE != 0) {
182
log.complain("***wrong value*** : EventRequest.SUSPEND_NONE = "
183
+ EventRequest.SUSPEND_NONE);
184
exitStatus = Consts.TEST_FAILED;
185
}
186
187
188
if (StepRequest.STEP_INTO != 1) {
189
log.complain("***wrong value*** : StepRequest.STEP_INTO = "
190
+ StepRequest.STEP_INTO);
191
exitStatus = Consts.TEST_FAILED;
192
}
193
194
if (StepRequest.STEP_LINE != -2) {
195
log.complain("***wrong value*** : StepRequest.STEP_LINE = "
196
+ StepRequest.STEP_LINE);
197
exitStatus = Consts.TEST_FAILED;
198
}
199
200
if (StepRequest.STEP_MIN != -1) {
201
log.complain("***wrong value*** : StepRequest.STEP_MIN = "
202
+ StepRequest.STEP_MIN);
203
exitStatus = Consts.TEST_FAILED;
204
}
205
206
if (StepRequest.STEP_OUT != 3) {
207
log.complain("***wrong value*** : StepRequest.STEP_OUT = "
208
+ StepRequest.STEP_OUT);
209
exitStatus = Consts.TEST_FAILED;
210
}
211
212
if (StepRequest.STEP_OVER != 2) {
213
log.complain("***wrong value*** : StepRequest.STEP_OVER = "
214
+ StepRequest.STEP_OVER);
215
exitStatus = Consts.TEST_FAILED;
216
}
217
log.display("");
218
}
219
220
}
221
222