test/hotspot/jtreg/vmTestbase/nsk/jdi/IntegerArgument/stringValueOf/stringvalueof001.java
author iignatyev
Sat, 05 May 2018 09:24:29 -0700
changeset 50018 3ba0d8631f24
permissions -rw-r--r--
8199382: [TESTBUG] Open source VM testbase JDI tests Reviewed-by: erikj, kvn, sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50018
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     1
/*
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     2
 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     4
 *
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     7
 * published by the Free Software Foundation.
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     8
 *
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    13
 * accompanied this code).
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    14
 *
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    18
 *
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    21
 * questions.
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    22
 */
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    23
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    24
package nsk.jdi.IntegerArgument.stringValueOf;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    25
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    26
import java.io.PrintStream;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    27
import java.io.Serializable;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    28
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    29
import java.util.Map;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    30
import java.util.Set;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    31
import java.util.List;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    32
import java.util.Iterator;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    33
import java.util.NoSuchElementException;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    34
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    35
import com.sun.jdi.VirtualMachineManager;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    36
import com.sun.jdi.Bootstrap;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    37
import com.sun.jdi.connect.Connector;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    38
import com.sun.jdi.connect.Connector.IntegerArgument;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    39
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    40
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    41
/**
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    42
 * The test for the implementation of an object of the type <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    43
 * Connector_IntegerArgument. <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    44
 * <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    45
 * The test checks up that results of the method                        <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    46
 * <code>Connector.IntegerArgument.stringValueOf()</code>               <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    47
 * complies with the following requirements in its specification:       <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    48
 *    "Returns the String representation of the value parameter."       <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    49
 * The checking values are as follows:          <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    50
 *      min()   <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    51
 *      max()   <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    52
 *      min()+1 <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    53
 *      min()-1 <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    54
 *      max()+1 <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    55
 * <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    56
 * In case of a value set with setValue(stringValueOf(value))   <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    57
 * is not equal to a value returned by the following intValue(),<BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    58
 * the test produces the return value 97 and    <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    59
 * a corresponding error message.               <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    60
 * Otherwise, the test is passed and produces   <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    61
 * the return value 95 and no message.          <BR>
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    62
 */
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    63
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    64
//
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    65
public class stringvalueof001 {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    66
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    67
    public static void main(String argv[]) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    68
        System.exit(run(argv, System.out) + 95); // JCK-compatible exit status
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    69
    }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    70
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    71
    public static int run(String argv[], PrintStream out) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    72
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    73
        int exitCode  = 0;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    74
        int exitCode0 = 0;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    75
        int exitCode2 = 2;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    76
//
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    77
        String sErr1 =  "WARNING\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    78
                        "Method tested: " +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    79
                        "jdi.Connector.IntegerArgument.intValue\n" ;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    80
//
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    81
        String sErr2 =  "ERROR\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    82
                        "Method tested: " +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    83
                        "jdi.Connector.IntegerArgument.intValue()\n" ;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    84
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    85
        VirtualMachineManager vmm = Bootstrap.virtualMachineManager();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    86
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    87
        List connectorsList = vmm.allConnectors();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    88
        Iterator connectorsListIterator = connectorsList.iterator();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    89
//
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    90
        Connector.IntegerArgument intArgument = null;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    91
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    92
        for ( ; ; ) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    93
            try {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    94
                Connector connector =
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    95
                (Connector) connectorsListIterator.next();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    96
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    97
                Map defaultArguments = connector.defaultArguments();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    98
                Set keyset     = defaultArguments.keySet();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
    99
                int keysetSize = defaultArguments.size();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   100
                Iterator  keysetIterator = keyset.iterator();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   101
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   102
                for ( ; ; ) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   103
                    try {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   104
                        String argName = (String) keysetIterator.next();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   105
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   106
                        try {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   107
//
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   108
                            intArgument = (Connector.IntegerArgument)
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   109
                                       defaultArguments.get(argName);
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   110
                            break ;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   111
                        } catch ( ClassCastException e) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   112
                        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   113
                    } catch ( NoSuchElementException e) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   114
                        break ;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   115
                    }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   116
                }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   117
                if (intArgument != null) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   118
                    break ;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   119
                }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   120
            } catch ( NoSuchElementException e) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   121
                out.println(sErr1 +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   122
//
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   123
                    "no Connector with IntegerArgument found\n");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   124
                return exitCode0;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   125
            }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   126
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   127
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   128
        Integer intI = null;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   129
        int i;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   130
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   131
        i = intArgument.min();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   132
        intArgument.setValue(intArgument.stringValueOf(i));
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   133
        if (intArgument.intValue() != i) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   134
            exitCode = exitCode2;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   135
            out.println(sErr2 +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   136
                     "check: stringValueOf(min())\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   137
                     "result: inequality\n");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   138
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   139
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   140
        i = intArgument.max();
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   141
        intArgument.setValue(intArgument.stringValueOf(i));
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   142
        if (intArgument.intValue() != i) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   143
            exitCode = exitCode2;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   144
            out.println(sErr2 +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   145
                     "check: stringValueOf(max())\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   146
                     "result: inequality\n");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   147
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   148
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   149
        if (intArgument.min() < intArgument.max()) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   150
            i = intArgument.min() + 1;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   151
            intArgument.setValue(intArgument.stringValueOf(i));
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   152
            if (intArgument.intValue() != i) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   153
                exitCode = exitCode2;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   154
                out.println(sErr2 +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   155
                        "check: stringValueOf(min()+1)\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   156
                        "result: inequality\n");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   157
            }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   158
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   159
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   160
        if (intArgument.min() > intI.MIN_VALUE) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   161
            i = intArgument.min() - 1;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   162
            intArgument.setValue(intArgument.stringValueOf(i));
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   163
            if (intArgument.intValue() != i) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   164
                exitCode = exitCode2;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   165
                out.println(sErr2 +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   166
                        "check: stringValueOf(min()-1)\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   167
                        "result: inequality\n");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   168
            }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   169
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   170
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   171
        if (intArgument.max() < intI.MAX_VALUE) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   172
            i = intArgument.max() + 1;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   173
            intArgument.setValue(intArgument.stringValueOf(i));
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   174
            if (intArgument.intValue() != i) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   175
                exitCode = exitCode2;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   176
                out.println(sErr2 +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   177
                        "check: stringValueOf(max()+1)\n" +
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   178
                        "result: inequality\n");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   179
            }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   180
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   181
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   182
        if (exitCode != exitCode0) {
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   183
            out.println("TEST FAILED");
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   184
        }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   185
        return exitCode;
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   186
    }
3ba0d8631f24 8199382: [TESTBUG] Open source VM testbase JDI tests
iignatyev
parents:
diff changeset
   187
}