Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/toString/tostring001a.java
41161 views
1
/*
2
* Copyright (c) 2002, 2021, 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.toString;
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 tostring001a {
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
65
//------------------------------------------------------ mutable common method
66
67
public static void main (String argv[]) {
68
exitStatus = Consts.TEST_FAILED;
69
argHandler = new ArgumentHandler(argv);
70
log = new Log(System.err, argHandler);
71
pipe = argHandler.createDebugeeIOPipe(log);
72
73
// Tested local variables --------------------
74
boolean z0 = true, z1[] = {z0}, z2[][] = {z1};
75
byte b0 = (byte)-1, b1[] = {b0}, b2[][] = {b1};
76
char c0 = '\n', c1[] = {c0}, c2[][] = {c1};
77
double d0 = (double)-1, d1[] = {d0}, d2[][] = {d1};
78
float f0 = (float)-1, f1[] = {f0}, f2[][] = {f1};
79
int i0 = -1, i1[] = {i0}, i2[][] = {i1};
80
long l0 = (long)-1, l1[] = {l0}, l2[][] = {l1};
81
short r0 = (short)-1, r1[] = {r0}, r2[][] = {r1};
82
83
Boolean Z0 = Boolean.valueOf(false), Z1[] = {Z0}, Z2[][] = {Z1};
84
Byte B0 = Byte.valueOf((byte)1), B1[] = {B0}, B2[][] = {B1};
85
Character C0 = Character.valueOf('z'), C1[] = {C0}, C2[][] = {C1};
86
Double D0 = Double.valueOf((double)1), D1[] = {D0}, D2[][] = {D1};
87
Float F0 = Float.valueOf((float)1), F1[] = {F0}, F2[][] = {F1};
88
Integer I0 = Integer.valueOf(1), I1[] = {I0}, I2[][] = {I1};
89
Long L0 = Long.valueOf((long)1), L1[] = {L0}, L2[][] = {L1};
90
Short R0 = Short.valueOf((short)1), R1[] = {R0}, R2[][] = {R1};
91
92
String s0 = "string", s1[] = {s0}, s2[][] = {s1};
93
Object o0 = new Object(), o1[] = {o0}, o2[][] = {o1};
94
tostring001aP p0 = new tostring001aP(), p1[] = {p0}, p2[][] = {p1};
95
tostring001aM m0 = new tostring001aP(), m1[] = {m0}, m2[][] = {m1};
96
//--------------------------------------------
97
98
try {
99
pipe.println(tostring001.SIGNAL_READY);
100
101
receiveSignal(tostring001.SIGNAL_QUIT);
102
display("completed succesfully.");
103
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
104
} catch (Failure e) {
105
log.complain(e.getMessage());
106
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
107
}
108
}
109
110
//--------------------------------------------------------- test specific methods
111
}
112
113
//--------------------------------------------------------- test specific classes
114
class tostring001aP implements tostring001aM {}
115
interface tostring001aM {}
116
117