< prev index next >

test/runtime/verifier/TestMultiANewArray.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.File;
  25 import java.io.FileOutputStream;
  26 import jdk.internal.org.objectweb.asm.ClassWriter;
  27 import jdk.internal.org.objectweb.asm.MethodVisitor;
  28 import static jdk.internal.org.objectweb.asm.Opcodes.*;
  29 import jdk.test.lib.*;

  30 
  31 /*
  32  * @test TestMultiANewArray
  33  * @bug 8038076
  34  * @library /testlibrary
  35  * @modules java.base/jdk.internal.org.objectweb.asm
  36  *          java.base/jdk.internal.misc
  37  *          java.management
  38  * @compile -XDignore.symbol.file TestMultiANewArray.java
  39  * @run main/othervm TestMultiANewArray 49
  40  * @run main/othervm TestMultiANewArray 50
  41  * @run main/othervm TestMultiANewArray 51
  42  * @run main/othervm TestMultiANewArray 52
  43  */
  44 
  45 public class TestMultiANewArray {
  46     public static void main(String... args) throws Exception {
  47         int cfv = Integer.parseInt(args[0]);
  48         writeClassFile(cfv);
  49         System.err.println("Running with cfv: " + cfv);
  50         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",  "ClassFile");
  51         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  52         output.shouldContain("VerifyError");
  53         output.shouldHaveExitValue(1);
  54     }




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.File;
  25 import java.io.FileOutputStream;
  26 import jdk.internal.org.objectweb.asm.ClassWriter;
  27 import jdk.internal.org.objectweb.asm.MethodVisitor;
  28 import static jdk.internal.org.objectweb.asm.Opcodes.*;
  29 import jdk.test.lib.process.ProcessTools;
  30 import jdk.test.lib.process.OutputAnalyzer;
  31 
  32 /*
  33  * @test TestMultiANewArray
  34  * @bug 8038076
  35  * @library /test/lib
  36  * @modules java.base/jdk.internal.org.objectweb.asm
  37  *          java.base/jdk.internal.misc
  38  *          java.management
  39  * @compile -XDignore.symbol.file TestMultiANewArray.java
  40  * @run main/othervm TestMultiANewArray 49
  41  * @run main/othervm TestMultiANewArray 50
  42  * @run main/othervm TestMultiANewArray 51
  43  * @run main/othervm TestMultiANewArray 52
  44  */
  45 
  46 public class TestMultiANewArray {
  47     public static void main(String... args) throws Exception {
  48         int cfv = Integer.parseInt(args[0]);
  49         writeClassFile(cfv);
  50         System.err.println("Running with cfv: " + cfv);
  51         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",  "ClassFile");
  52         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  53         output.shouldContain("VerifyError");
  54         output.shouldHaveExitValue(1);
  55     }


< prev index next >