< prev index next >

test/com/sun/jdi/GetSetLocalTest.java

Print this page
rev 16940 : 8177507: line number sensitive tests for jdi should be unified
Reviewed-by: duke

*** 1,10 **** ! /** hard coded linenumbers in other tests - DO NOT CHANGE ! * @test/nodynamiccopyright/ * @bug 4300412 * @summary Test GetLocal* and SetLocal* functions - * * @author Serguei Spitsyn * * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g GetSetLocalTest.java * @run driver GetSetLocalTest --- 1,34 ---- ! /* ! * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. ! * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ! * ! * This code is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License version 2 only, as ! * published by the Free Software Foundation. ! * ! * This code is distributed in the hope that it will be useful, but WITHOUT ! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ! * version 2 for more details (a copy is included in the LICENSE file that ! * accompanied this code). ! * ! * You should have received a copy of the GNU General Public License version ! * 2 along with this work; if not, write to the Free Software Foundation, ! * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ! * ! * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ! * or visit www.oracle.com if you need additional information or have any ! * questions. ! */ ! ! // THIS TEST IS LINE NUMBER SENSITIVE ! ! /** ! * @test * @bug 4300412 * @summary Test GetLocal* and SetLocal* functions * @author Serguei Spitsyn * * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g GetSetLocalTest.java * @run driver GetSetLocalTest
*** 33,43 **** public static int staticMeth(int intArg) { System.out.println("staticMeth: Started"); int result; { { boolean bool_1 = false; ! intArg++; } boolean bool_2 = true; intArg++; } --- 57,67 ---- public static int staticMeth(int intArg) { System.out.println("staticMeth: Started"); int result; { { boolean bool_1 = false; ! intArg++; // START_LINE } boolean bool_2 = true; intArg++; }
*** 109,119 **** { Object obj_1 = new Object(); intArg++; } Object obj_2 = new Object(); ! intArg++; // <-- Last stop is at this point. // Only obj_2 and intArg are valid // Note: even result is not valid here! } result = 10; // <- This is first init of result var System.out.println("staticMeth: Finished"); --- 133,143 ---- { Object obj_1 = new Object(); intArg++; } Object obj_2 = new Object(); ! intArg++; // STOP_LINE. Last stop is at this point. // Only obj_2 and intArg are valid // Note: even result is not valid here! } result = 10; // <- This is first init of result var System.out.println("staticMeth: Finished");
*** 123,132 **** --- 147,158 ---- /********** test program **********/ public class GetSetLocalTest extends TestScaffold { + static final int START_LINE = 62; + static final int STOP_LINE = 138; ReferenceType targetClass; ThreadReference mainThread; GetSetLocalTest (String args[]) { super(args);
*** 633,643 **** EventRequestManager erm = vm().eventRequestManager(); println("EventRequestManager"); StackFrame frame = null; ! for (int line = 38; line < 118; line += 4) { println("\n resumeTo(GetSetLocalTarg, " + line + ")"); bpe = resumeTo("GetSetLocalTarg", line); frame = bpe.thread().frame(0); printFrameVariables(frame); checkSetFrameVariables(frame); --- 659,669 ---- EventRequestManager erm = vm().eventRequestManager(); println("EventRequestManager"); StackFrame frame = null; ! for (int line = START_LINE; line <= STOP_LINE; line += 4) { println("\n resumeTo(GetSetLocalTarg, " + line + ")"); bpe = resumeTo("GetSetLocalTarg", line); frame = bpe.thread().frame(0); printFrameVariables(frame); checkSetFrameVariables(frame);
< prev index next >