jdk/test/com/sun/jdi/LocalVariableEqual.java
author iignatyev
Wed, 15 Mar 2017 22:48:59 -0700
changeset 44423 306c020eb154
parent 30376 2ccf2cf7ea48
permissions -rw-r--r--
8176176: fix @modules in jdk_svc tests Reviewed-by: shurailine, sspitsyn
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
/**
44423
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    25
 * @test
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    26
 * @bug 4916263
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    27
 * @summary Test
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    28
 * @author Serguei Spitsyn
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
44423
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    30
 * @run build TestScaffold VMConnection TargetListener TargetAdapter
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    31
 * @run compile -g LocalVariableEqual.java
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    32
 * @run driver LocalVariableEqual
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import com.sun.jdi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import com.sun.jdi.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import com.sun.jdi.request.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    /********** target program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
class LocalVariableEqualTarg {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    public static void main(String[] args){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        int intVar = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        System.out.println("LocalVariableEqualTarg: Started");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        intVar = staticMeth(intVar);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        System.out.println("LocalVariableEqualTarg: Finished");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    public static int staticMeth(int intArg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        System.out.println("staticMeth: Started");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        int result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
             { boolean bool_1 = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
               {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
                 { byte byte_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
                   intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                 byte byte_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                 intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
               }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
             boolean bool_2 = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
             {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
               {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                 { char   char_1 = '1';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                   intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                 short  short_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                 intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
               }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
             { short  short_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
             char   char_2 = '2';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
             { int int_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
             long long_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
             { float  float_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
             double double_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
             { String string_1 = "1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
             Object obj_2 = new Object();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        result = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        System.out.println("staticMeth: Finished");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /********** test program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
public class LocalVariableEqual extends TestScaffold {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    ReferenceType targetClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    ThreadReference mainThread;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    LocalVariableEqual (String args[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        super(args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        new LocalVariableEqual(args).startTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    /********** test assist **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    Method getMethod(String className, String methodName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        List refs = vm().classesByName(className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        if (refs.size() != 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            failure("Test failure: " + refs.size() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                    " ReferenceTypes named: " + className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        ReferenceType refType = (ReferenceType)refs.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        List meths = refType.methodsByName(methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        if (meths.size() != 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            failure("Test failure: " + meths.size() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                    " methods named: " + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        return (Method)meths.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    void printVariable(LocalVariable lv, int index) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        if (lv == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            println(" Var  name: null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        String tyname = lv.typeName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        println(" Var: " + lv.name() + ", index: " + index + ", type: " + tyname +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                ", Signature: " + lv.type().signature());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        // Sorry, there is no way to take local variable slot numbers using JDI!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        // It is because method LocalVariableImpl.slot() is private.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    void compareTwoEqualVars(LocalVariable lv1, LocalVariable lv2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        if (lv1.equals(lv2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            println(" Success: equality of local vars detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            failure(" Failure: equality of local vars is NOT detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        if (lv1.hashCode() == lv2.hashCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            println(" Success: hashCode's of equal local vars are equal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            failure(" Failure: hashCode's of equal local vars differ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        if (lv1.compareTo(lv2) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            println(" Success: compareTo() is correct for equal local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            failure(" Failure: compareTo() is NOT correct for equal local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    void compareTwoDifferentVars(LocalVariable lv1, LocalVariable lv2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        if (!lv1.equals(lv2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            println(" Success: difference of local vars detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            failure(" Failure: difference of local vars is NOT detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        if (lv1.hashCode() != lv2.hashCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            println(" Success: hashCode's of different local vars differ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            failure(" Failure: hashCode's of different local vars are equal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        if (lv1.compareTo(lv2) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            println(" Success: compareTo() is correct for different local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            failure(" Failure: compareTo() is NOT correct for different local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    void compareAllVariables(String className, String methodName) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        println("compareAllVariables for method: " + className + "." + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        Method method = getMethod(className, methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        List localVars;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            localVars = method.variables();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            println("\n Success: got a list of all method variables: " + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        catch (com.sun.jdi.AbsentInformationException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            failure("\n AbsentInformationException has been thrown");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        // We consider N*N combinations for set of N variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        int index1 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        for (Iterator it1 = localVars.iterator(); it1.hasNext(); index1++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            LocalVariable lv1 = (LocalVariable) it1.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            int index2 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            for (Iterator it2 = localVars.iterator(); it2.hasNext(); index2++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                LocalVariable lv2 = (LocalVariable) it2.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                println("\n Two variables:");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                printVariable(lv1, index1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                printVariable(lv2, index2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                println("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                if (index1 == index2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                    compareTwoEqualVars(lv1, lv2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    compareTwoDifferentVars(lv1, lv2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        println("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /********** test core **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    protected void runTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
         * Get to the top of main() to determine targetClass and mainThread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        BreakpointEvent bpe = startToMain("LocalVariableEqualTarg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        println("startToMain(LocalVariableEqualTarg)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        compareAllVariables("LocalVariableEqualTarg", "staticMeth");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
         * resume until the end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        listenUntilVMDisconnect();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
         * deal with results of test
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
         * if anything has called failure("foo") testFailed will be true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        if (!testFailed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
            println("\nLocalVariableEqual: passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            throw new Exception("\nLocalVariableEqual: FAILED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
}