Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/DoubleValue/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.DoubleValue.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 cmpCharMIN = Character.MIN_VALUE;
115
static double cmpDoubleMAX= Double.MAX_VALUE;
116
static double cmpDouble1 = 1;
117
static double cmpDouble0 = 0;
118
static double cmpDouble_1 = -1;
119
static double cmpDoubleMIN= Double.MIN_VALUE;
120
static float cmpFloatMAX = Float.MAX_VALUE;
121
static float cmpFloat1 = 1;
122
static float cmpFloat0 = 0;
123
static float cmpFloat_1 = -1;
124
static float cmpFloatMIN = Float.MIN_VALUE;
125
static int cmpIntMAX = Integer.MAX_VALUE;
126
static int cmpInt1 = 1;
127
static int cmpInt0 = 0;
128
static int cmpInt_1 = -1;
129
static int cmpIntMIN = Integer.MIN_VALUE;
130
static long cmpLongMAX = Long.MAX_VALUE;
131
static long cmpLong1 = 1;
132
static long cmpLong0 = 0;
133
static long cmpLong_1 = -1;
134
static long cmpLongMIN = Long.MIN_VALUE;
135
static short cmpShortMAX = Short.MAX_VALUE;
136
static short cmpShort1 = 1;
137
static short cmpShort0 = 0;
138
static short cmpShort_1 = -1;
139
static short cmpShortMIN = Short.MIN_VALUE;
140
141
//------------------------------------------------------ mutable common method
142
143
public static void main (String argv[]) {
144
145
exitStatus = Consts.TEST_FAILED;
146
argHandler = new ArgumentHandler(argv);
147
log = argHandler.createDebugeeLog();
148
pipe = argHandler.createDebugeeIOPipe(log);
149
150
try {
151
pipe.println(compareto001.SIGNAL_READY);
152
// receiveSignal(compareto001.SIGNAL_GO);
153
154
receiveSignal(compareto001.SIGNAL_QUIT);
155
display("completed succesfully.");
156
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
157
} catch (Failure e) {
158
log.complain(e.getMessage());
159
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
160
}
161
}
162
163
//--------------------------------------------------------- test specific methods
164
165
}
166
167
//--------------------------------------------------------- test specific classes
168
169
class compareto001aClassToCheck {
170
public double doubleMAX = Double.MAX_VALUE;
171
public double double1 = 1;
172
public double double0 = 0;
173
public double double_1 = -1;
174
public double doubleMIN = Double.MIN_VALUE;
175
}
176
177