jdk/test/com/sun/jdi/LocalVariableEqual.java
author ykantser
Thu, 07 May 2015 09:11:49 +0200
changeset 30376 2ccf2cf7ea48
parent 24973 8c4bc3fa4c4e
child 44423 306c020eb154
permissions -rw-r--r--
8078896: Add @modules as needed to the jdk_svc tests Reviewed-by: alanb, mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
30376
2ccf2cf7ea48 8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents: 24973
diff changeset
     2
 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 *  @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 *  @bug 4916263
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *  @summary Test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *  @author Serguei Spitsyn
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *
30376
2ccf2cf7ea48 8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents: 24973
diff changeset
    31
 *  @modules jdk.jdi
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *  @run build TestScaffold VMConnection TargetListener TargetAdapter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *  @run compile -g LocalVariableEqual.java
24973
8c4bc3fa4c4e 6622468: TEST_BUG: Time to retire the @debuggeeVMOptions mechanism used in the com.sun.jdi infrastructure
sla
parents: 5506
diff changeset
    34
 *  @run driver LocalVariableEqual
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import com.sun.jdi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import com.sun.jdi.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import com.sun.jdi.request.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    /********** target program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
class LocalVariableEqualTarg {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    public static void main(String[] args){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        int intVar = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        System.out.println("LocalVariableEqualTarg: Started");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        intVar = staticMeth(intVar);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        System.out.println("LocalVariableEqualTarg: Finished");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static int staticMeth(int intArg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        System.out.println("staticMeth: Started");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        int result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
             { boolean bool_1 = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
               {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                 { byte byte_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                   intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                 byte byte_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                 intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
               }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
             boolean bool_2 = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
             {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
               {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                 { char   char_1 = '1';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                   intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                 short  short_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                 intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
               }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
             { short  short_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
             char   char_2 = '2';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
             { int int_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
             long long_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
             { float  float_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
             double double_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
             { String string_1 = "1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
             Object obj_2 = new Object();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        result = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        System.out.println("staticMeth: Finished");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    /********** test program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
public class LocalVariableEqual extends TestScaffold {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    ReferenceType targetClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    ThreadReference mainThread;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    LocalVariableEqual (String args[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        super(args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        new LocalVariableEqual(args).startTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /********** test assist **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    Method getMethod(String className, String methodName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        List refs = vm().classesByName(className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        if (refs.size() != 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            failure("Test failure: " + refs.size() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                    " ReferenceTypes named: " + className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        ReferenceType refType = (ReferenceType)refs.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        List meths = refType.methodsByName(methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        if (meths.size() != 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            failure("Test failure: " + meths.size() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                    " methods named: " + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        return (Method)meths.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    void printVariable(LocalVariable lv, int index) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        if (lv == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            println(" Var  name: null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        String tyname = lv.typeName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        println(" Var: " + lv.name() + ", index: " + index + ", type: " + tyname +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                ", Signature: " + lv.type().signature());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        // Sorry, there is no way to take local variable slot numbers using JDI!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        // It is because method LocalVariableImpl.slot() is private.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    void compareTwoEqualVars(LocalVariable lv1, LocalVariable lv2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        if (lv1.equals(lv2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            println(" Success: equality of local vars detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            failure(" Failure: equality of local vars is NOT detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        if (lv1.hashCode() == lv2.hashCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            println(" Success: hashCode's of equal local vars are equal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            failure(" Failure: hashCode's of equal local vars differ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        if (lv1.compareTo(lv2) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            println(" Success: compareTo() is correct for equal local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            failure(" Failure: compareTo() is NOT correct for equal local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    void compareTwoDifferentVars(LocalVariable lv1, LocalVariable lv2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        if (!lv1.equals(lv2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            println(" Success: difference of local vars detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            failure(" Failure: difference of local vars is NOT detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        if (lv1.hashCode() != lv2.hashCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            println(" Success: hashCode's of different local vars differ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            failure(" Failure: hashCode's of different local vars are equal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        if (lv1.compareTo(lv2) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            println(" Success: compareTo() is correct for different local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            failure(" Failure: compareTo() is NOT correct for different local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    void compareAllVariables(String className, String methodName) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        println("compareAllVariables for method: " + className + "." + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        Method method = getMethod(className, methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        List localVars;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            localVars = method.variables();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            println("\n Success: got a list of all method variables: " + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        catch (com.sun.jdi.AbsentInformationException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            failure("\n AbsentInformationException has been thrown");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        // We consider N*N combinations for set of N variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        int index1 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        for (Iterator it1 = localVars.iterator(); it1.hasNext(); index1++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            LocalVariable lv1 = (LocalVariable) it1.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            int index2 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            for (Iterator it2 = localVars.iterator(); it2.hasNext(); index2++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                LocalVariable lv2 = (LocalVariable) it2.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                println("\n Two variables:");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                printVariable(lv1, index1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                printVariable(lv2, index2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                println("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                if (index1 == index2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    compareTwoEqualVars(lv1, lv2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                    compareTwoDifferentVars(lv1, lv2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        println("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    /********** test core **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    protected void runTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
         * Get to the top of main() to determine targetClass and mainThread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        BreakpointEvent bpe = startToMain("LocalVariableEqualTarg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        println("startToMain(LocalVariableEqualTarg)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        compareAllVariables("LocalVariableEqualTarg", "staticMeth");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
         * resume until the end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        listenUntilVMDisconnect();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
         * deal with results of test
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
         * if anything has called failure("foo") testFailed will be true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        if (!testFailed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            println("\nLocalVariableEqual: passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
            throw new Exception("\nLocalVariableEqual: FAILED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
}