/** hard coded linenumbers in test - DO NOT CHANGE
* @test/nodynamiccopyright/
* @bug 4386002 4429245
* @summary Test fix for: Incorrect values reported for some locals of type long
*
* @author Tim Bell
*
* @run build TestScaffold VMConnection TargetListener TargetAdapter
* @run compile -g FetchLocals.java
* @run main FetchLocals
*/
class FetchLocalsDebugee {
public long testMethod() {
short s = 12345;
int i = 8675309;
boolean pt = true;
long w = 973230999L;
byte b = 0x3b;
long x = w * 1000L;
char c = '\u005A'; // 005A = "Z"
long y = 22;
float f = 6.66f;
double d = 7.77;
if (w == 0xde00ad00be00ef00L) {
} else {
}
return x;
}
}
}
super(args);
}
throws Exception
{
}
/** Express a 64 bit double as a hex string
*/
}
/** Express a 32 bit float as a hex string
*/
}
throws Exception
{
" should be: " + expectV);
testFailed = true;
} else {
}
}
throws Exception
{
" should be: " + expectV);
testFailed = true;
} else {
}
}
throws Exception
{
" should be: " + expectV);
testFailed = true;
} else {
}
}
throws Exception
{
" should be: " + expectV);
testFailed = true;
} else {
}
}
throws Exception
{
" should be: " + expectV);
testFailed = true;
} else {
}
}
throws Exception
{
" should be: 0x" +
testFailed = true;
} else {
}
}
throws Exception
{
" should be: " + expectV +
testFailed = true;
} else {
}
}
throws Exception
{
" should be: " + expectV +
testFailed = true;
} else {
}
}
throws Exception
{
/*
* Test values in the local method testMethod ():
* 1) Read current data
* 2) Test against the expected value
* 3) Set to a new value
* 4) Read again
* 5) Test against the expected value
*/
byte bTmp = 0x3b;
bTmp = 0x7e;
char cTmp = '\u005A';
cTmp = 'A';
short sTmp = 12345;
sTmp = -32766;
int iTmp = 8675309;
iTmp = -42;
long wTmp = 973230999L;
wTmp = 0xde00ad00be00ef00L;
xTmp = 0xca00fe00ba00be00L;
long yTmp = 22;
yTmp = 0xdeadbeefcafebabeL;
float fTmp = 6.66f;
double dTmp = 7.77;
}
protected void runTests()
throws Exception
{
startToMain("FetchLocalsDebugee");
/*
* Get to the bottom of testMethod():
*/
try {
/*
* Fetch values from fields; what did we get?
*/
testFailed = true;
} finally {
// Allow application to complete and shut down
}
if (!testFailed) {
} else {
throw new Exception("FetchLocals: failed");
}
}
}