Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/DoubleValue/equals/equals001a.java
41161 views
1
/*
2
* Copyright (c) 2000, 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.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 equals001a JDI test.
33
34
*/
35
36
public class equals001a {
37
38
//----------------------------------------------------- templete section
39
40
static final int PASSED = 0;
41
static final int FAILED = 2;
42
static final int PASS_BASE = 95;
43
44
//-------------------------------------------------- log procedures
45
46
static boolean verbMode = false; // debugger may switch to true
47
48
private static void log1(String message) {
49
if (verbMode)
50
System.err.println("**> equals001a: " + message);
51
}
52
53
private static void logErr(String message) {
54
if (verbMode)
55
System.err.println("!!**> equals001a: " + message);
56
}
57
58
//====================================================== test program
59
//................................................... globals for a debugger
60
61
// public static double pos_inf = Double.POSITIVE_INFINITY;
62
// public static double pos_zero = 0.0d;
63
// public static double neg_zero = -0.0d;
64
// public static double neg_inf = Double.NEGATIVE_INFINITY;
65
66
// public static double pos_largest = Double.MAX_VALUE;
67
// public static double pos_smallest = Double.MIN_VALUE;
68
// public static double neg_largest = -Double.MAX_VALUE;
69
// public static double neg_smallest = -Double.MIN_VALUE;
70
71
// public static double double_nan = Double.NaN;
72
73
public static double plus1_1 = +1.0d;
74
public static double plus1_2 = +1.0d;
75
public static double minus1 = -1.0d;
76
77
public static float float_plus1 = +1.0f;
78
79
//....................................................
80
//---------------------------------------------------- main method
81
82
public static void main (String argv[]) {
83
84
for (int i=0; i<argv.length; i++) {
85
if ( argv[i].equals("-vbs") || argv[i].equals("-verbose") ) {
86
verbMode = true;
87
break;
88
}
89
}
90
log1("debuggee started!");
91
92
// informing a debugger of readyness
93
ArgumentHandler argHandler = new ArgumentHandler(argv);
94
IOPipe pipe = argHandler.createDebugeeIOPipe();
95
pipe.println("ready");
96
97
98
int exitCode = PASSED;
99
for (int i = 0; ; i++) {
100
101
String instruction;
102
103
log1("waiting for an instruction from the debugger ...");
104
instruction = pipe.readln();
105
if (instruction.equals("quit")) {
106
log1("'quit' recieved");
107
break ;
108
109
} else if (instruction.equals("newcheck")) {
110
switch (i) {
111
112
//------------------------------------------------------ section tested
113
114
case 0:
115
pipe.println("checkready");
116
break ;
117
118
//------------------------------------------------- standard end section
119
120
default:
121
pipe.println("checkend");
122
break ;
123
}
124
125
} else {
126
logErr("ERRROR: unexpected instruction: " + instruction);
127
exitCode = FAILED;
128
break ;
129
}
130
}
131
132
System.exit(exitCode + PASS_BASE);
133
}
134
}
135
136