From 2f3d2e791a304a437eeecd030a752822fe04ed69 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Sun, 27 Apr 2008 23:37:46 +0200 Subject: [PATCH] * .hgignore: Removed tests/regression/codepatching/*.class. * configure.ac (AC_CONFIG_FILES): Removed tests/regression/codepatching/Makefile. * tests/regression/Makefile.am (SUBDIRS): Removed codepatching. * tests/regression/junit/All.java (suite): Added TestPatcher. * tests/regression/junit/Makefile.am (EXTRA_DIST): Added $(srcdir) to actually find the files. * tests/regression/junit/TestPatcher.java: New file. * tests/regression/codepatching/Makefile.am, tests/regression/codepatching/aastoreconstClass.java, tests/regression/codepatching/checkcastC.java, tests/regression/codepatching/checkcastI.java, tests/regression/codepatching/getfieldD.java, tests/regression/codepatching/getfieldF.java, tests/regression/codepatching/getfieldI.java, tests/regression/codepatching/getfieldJ.java, tests/regression/codepatching/getfieldL.java, tests/regression/codepatching/getstaticD.java, tests/regression/codepatching/getstaticF.java, tests/regression/codepatching/getstaticI.java, tests/regression/codepatching/getstaticJ.java, tests/regression/codepatching/getstaticL.java, tests/regression/codepatching/instanceofC.java, tests/regression/codepatching/instanceofI.java, tests/regression/codepatching/invokespecial.java, tests/regression/codepatching/invokestatic.java, tests/regression/codepatching/multianewarray.java, tests/regression/codepatching/newarray.java, tests/regression/codepatching/putfieldD.java, tests/regression/codepatching/putfieldF.java, tests/regression/codepatching/putfieldI.java, tests/regression/codepatching/putfieldJ.java, tests/regression/codepatching/putfieldL.java, tests/regression/codepatching/putfieldconstC.java, tests/regression/codepatching/putfieldconstD.java, tests/regression/codepatching/putfieldconstF.java, tests/regression/codepatching/putfieldconstI.java, tests/regression/codepatching/putfieldconstJ.java, tests/regression/codepatching/putfieldconstL.java, tests/regression/codepatching/putstaticD.java, tests/regression/codepatching/putstaticF.java, tests/regression/codepatching/putstaticI.java, tests/regression/codepatching/putstaticJ.java, tests/regression/codepatching/putstaticL.java, tests/regression/codepatching/putstaticconstC.java, tests/regression/codepatching/putstaticconstD.java, tests/regression/codepatching/putstaticconstF.java, tests/regression/codepatching/putstaticconstI.java, tests/regression/codepatching/putstaticconstJ.java, tests/regression/codepatching/putstaticconstL.java, tests/regression/codepatching/test.java: Removed. --- .hgignore | 1 - configure.ac | 1 - tests/regression/Makefile.am | 1 - tests/regression/codepatching/Makefile.am | 140 ---- .../codepatching/aastoreconstClass.java | 3 - tests/regression/codepatching/checkcastC.java | 2 - tests/regression/codepatching/checkcastI.java | 2 - tests/regression/codepatching/getfieldD.java | 3 - tests/regression/codepatching/getfieldF.java | 3 - tests/regression/codepatching/getfieldI.java | 3 - tests/regression/codepatching/getfieldJ.java | 3 - tests/regression/codepatching/getfieldL.java | 3 - tests/regression/codepatching/getstaticD.java | 3 - tests/regression/codepatching/getstaticF.java | 3 - tests/regression/codepatching/getstaticI.java | 3 - tests/regression/codepatching/getstaticJ.java | 3 - tests/regression/codepatching/getstaticL.java | 3 - .../regression/codepatching/instanceofC.java | 2 - .../regression/codepatching/instanceofI.java | 2 - .../codepatching/invokespecial.java | 5 - .../regression/codepatching/invokestatic.java | 5 - .../codepatching/multianewarray.java | 2 - tests/regression/codepatching/newarray.java | 2 - tests/regression/codepatching/putfieldD.java | 3 - tests/regression/codepatching/putfieldF.java | 3 - tests/regression/codepatching/putfieldI.java | 3 - tests/regression/codepatching/putfieldJ.java | 3 - tests/regression/codepatching/putfieldL.java | 3 - .../codepatching/putfieldconstC.java | 3 - .../codepatching/putfieldconstD.java | 3 - .../codepatching/putfieldconstF.java | 3 - .../codepatching/putfieldconstI.java | 3 - .../codepatching/putfieldconstJ.java | 3 - .../codepatching/putfieldconstL.java | 3 - tests/regression/codepatching/putstaticD.java | 3 - tests/regression/codepatching/putstaticF.java | 3 - tests/regression/codepatching/putstaticI.java | 3 - tests/regression/codepatching/putstaticJ.java | 3 - tests/regression/codepatching/putstaticL.java | 3 - .../codepatching/putstaticconstC.java | 3 - .../codepatching/putstaticconstD.java | 3 - .../codepatching/putstaticconstF.java | 3 - .../codepatching/putstaticconstI.java | 3 - .../codepatching/putstaticconstJ.java | 3 - .../codepatching/putstaticconstL.java | 3 - tests/regression/codepatching/test.java | 763 ------------------ tests/regression/junit/All.java | 1 + tests/regression/junit/Makefile.am | 2 +- tests/regression/junit/TestPatcher.java | 650 +++++++++++++++ 49 files changed, 652 insertions(+), 1028 deletions(-) delete mode 100644 tests/regression/codepatching/Makefile.am delete mode 100644 tests/regression/codepatching/aastoreconstClass.java delete mode 100644 tests/regression/codepatching/checkcastC.java delete mode 100644 tests/regression/codepatching/checkcastI.java delete mode 100644 tests/regression/codepatching/getfieldD.java delete mode 100644 tests/regression/codepatching/getfieldF.java delete mode 100644 tests/regression/codepatching/getfieldI.java delete mode 100644 tests/regression/codepatching/getfieldJ.java delete mode 100644 tests/regression/codepatching/getfieldL.java delete mode 100644 tests/regression/codepatching/getstaticD.java delete mode 100644 tests/regression/codepatching/getstaticF.java delete mode 100644 tests/regression/codepatching/getstaticI.java delete mode 100644 tests/regression/codepatching/getstaticJ.java delete mode 100644 tests/regression/codepatching/getstaticL.java delete mode 100644 tests/regression/codepatching/instanceofC.java delete mode 100644 tests/regression/codepatching/instanceofI.java delete mode 100644 tests/regression/codepatching/invokespecial.java delete mode 100644 tests/regression/codepatching/invokestatic.java delete mode 100644 tests/regression/codepatching/multianewarray.java delete mode 100644 tests/regression/codepatching/newarray.java delete mode 100644 tests/regression/codepatching/putfieldD.java delete mode 100644 tests/regression/codepatching/putfieldF.java delete mode 100644 tests/regression/codepatching/putfieldI.java delete mode 100644 tests/regression/codepatching/putfieldJ.java delete mode 100644 tests/regression/codepatching/putfieldL.java delete mode 100644 tests/regression/codepatching/putfieldconstC.java delete mode 100644 tests/regression/codepatching/putfieldconstD.java delete mode 100644 tests/regression/codepatching/putfieldconstF.java delete mode 100644 tests/regression/codepatching/putfieldconstI.java delete mode 100644 tests/regression/codepatching/putfieldconstJ.java delete mode 100644 tests/regression/codepatching/putfieldconstL.java delete mode 100644 tests/regression/codepatching/putstaticD.java delete mode 100644 tests/regression/codepatching/putstaticF.java delete mode 100644 tests/regression/codepatching/putstaticI.java delete mode 100644 tests/regression/codepatching/putstaticJ.java delete mode 100644 tests/regression/codepatching/putstaticL.java delete mode 100644 tests/regression/codepatching/putstaticconstC.java delete mode 100644 tests/regression/codepatching/putstaticconstD.java delete mode 100644 tests/regression/codepatching/putstaticconstF.java delete mode 100644 tests/regression/codepatching/putstaticconstI.java delete mode 100644 tests/regression/codepatching/putstaticconstJ.java delete mode 100644 tests/regression/codepatching/putstaticconstL.java delete mode 100644 tests/regression/codepatching/test.java create mode 100644 tests/regression/junit/TestPatcher.java diff --git a/.hgignore b/.hgignore index 4f4ca6e21..e891ef1d1 100644 --- a/.hgignore +++ b/.hgignore @@ -44,7 +44,6 @@ tests/regression/*.class tests/regression/assertion/*.class tests/regression/assertion/packagetest/*.class tests/regression/bugzilla/*.class -tests/regression/codepatching/*.class tests/regression/jasmin/*.class tests/regression/junit/*.class tests/regression/native/*.class diff --git a/configure.ac b/configure.ac index ffc382ec8..08e573df1 100644 --- a/configure.ac +++ b/configure.ac @@ -919,7 +919,6 @@ AC_CONFIG_FILES([Makefile] [tests/Makefile] [tests/regression/Makefile] [tests/regression/bugzilla/Makefile] - [tests/regression/codepatching/Makefile] [tests/regression/assertion/Makefile] [tests/regression/jasmin/Makefile] [tests/regression/junit/Makefile] diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am index 6bd7697eb..02addaa9e 100644 --- a/tests/regression/Makefile.am +++ b/tests/regression/Makefile.am @@ -24,7 +24,6 @@ SUBDIRS = \ assertion \ bugzilla \ - codepatching \ jasmin \ junit \ native \ diff --git a/tests/regression/codepatching/Makefile.am b/tests/regression/codepatching/Makefile.am deleted file mode 100644 index 99fe7fe22..000000000 --- a/tests/regression/codepatching/Makefile.am +++ /dev/null @@ -1,140 +0,0 @@ -## tests/regression/codepatching/Makefile.am -## -## Copyright (C) 1996-2005, 2006, 2008 -## CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO -## -## This file is part of CACAO. -## -## This program is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2, or (at -## your option) any later version. -## -## This program 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 for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301, USA. - - -JAVA = $(top_builddir)/src/cacao/cacao -JAVACMD = $(JAVA) -Xbootclasspath:$(BOOTCLASSPATH) -JAVACCMD = $(JAVAC) -bootclasspath $(BOOTCLASSPATH) - -SOURCE_FILES = \ - $(srcdir)/aastoreconstClass.java \ - $(srcdir)/checkcastC.java \ - $(srcdir)/checkcastI.java \ - $(srcdir)/getfieldD.java \ - $(srcdir)/getfieldF.java \ - $(srcdir)/getfieldI.java \ - $(srcdir)/getfieldJ.java \ - $(srcdir)/getfieldL.java \ - $(srcdir)/getstaticD.java \ - $(srcdir)/getstaticF.java \ - $(srcdir)/getstaticI.java \ - $(srcdir)/getstaticJ.java \ - $(srcdir)/getstaticL.java \ - $(srcdir)/instanceofC.java \ - $(srcdir)/instanceofI.java \ - $(srcdir)/invokespecial.java \ - $(srcdir)/invokestatic.java \ - $(srcdir)/multianewarray.java \ - $(srcdir)/newarray.java \ - $(srcdir)/putfieldD.java \ - $(srcdir)/putfieldF.java \ - $(srcdir)/putfieldI.java \ - $(srcdir)/putfieldJ.java \ - $(srcdir)/putfieldL.java \ - $(srcdir)/putfieldconstC.java \ - $(srcdir)/putfieldconstD.java \ - $(srcdir)/putfieldconstF.java \ - $(srcdir)/putfieldconstI.java \ - $(srcdir)/putfieldconstJ.java \ - $(srcdir)/putfieldconstL.java \ - $(srcdir)/putstaticD.java \ - $(srcdir)/putstaticF.java \ - $(srcdir)/putstaticI.java \ - $(srcdir)/putstaticJ.java \ - $(srcdir)/putstaticL.java \ - $(srcdir)/putstaticconstC.java \ - $(srcdir)/putstaticconstD.java \ - $(srcdir)/putstaticconstF.java \ - $(srcdir)/putstaticconstI.java \ - $(srcdir)/putstaticconstJ.java \ - $(srcdir)/putstaticconstL.java \ - $(srcdir)/test.java - -EXTRA_DIST = \ - $(SOURCE_FILES) - -MAINCLASS = \ - test.class - -CLASSES = \ - aastoreconstClass.class \ - checkcastC.class \ - checkcastI.class \ - getfieldD.class \ - getfieldF.class \ - getfieldI.class \ - getfieldJ.class \ - getfieldL.class \ - getstaticD.class \ - getstaticF.class \ - getstaticI.class \ - getstaticJ.class \ - getstaticL.class \ - instanceofC.class \ - instanceofI.class \ - invokespecial.class \ - invokestatic.class \ - multianewarray.class \ - newarray.class \ - putfieldD.class \ - putfieldF.class \ - putfieldI.class \ - putfieldJ.class \ - putfieldL.class \ - putfieldconstC.class \ - putfieldconstD.class \ - putfieldconstF.class \ - putfieldconstI.class \ - putfieldconstJ.class \ - putfieldconstL.class \ - putstaticD.class \ - putstaticF.class \ - putstaticI.class \ - putstaticJ.class \ - putstaticL.class \ - putstaticconstC.class \ - putstaticconstD.class \ - putstaticconstF.class \ - putstaticconstI.class \ - putstaticconstJ.class \ - putstaticconstL.class - -CLEANFILES = \ - *.class - -build: - @$(JAVACCMD) -d . $(SOURCE_FILES) - -check: build - @LD_LIBRARY_PATH=$(top_builddir)/src/cacao/.libs $(JAVACMD) test - -remove: - $(RM) $(CLASSES) - - -## Local variables: -## mode: Makefile -## indent-tabs-mode: t -## c-basic-offset: 4 -## tab-width: 8 -## compile-command: "automake --add-missing" -## End: diff --git a/tests/regression/codepatching/aastoreconstClass.java b/tests/regression/codepatching/aastoreconstClass.java deleted file mode 100644 index bd11a0418..000000000 --- a/tests/regression/codepatching/aastoreconstClass.java +++ /dev/null @@ -1,3 +0,0 @@ -public class aastoreconstClass { -} - diff --git a/tests/regression/codepatching/checkcastC.java b/tests/regression/codepatching/checkcastC.java deleted file mode 100644 index 06e4d53a8..000000000 --- a/tests/regression/codepatching/checkcastC.java +++ /dev/null @@ -1,2 +0,0 @@ -public class checkcastC { -} diff --git a/tests/regression/codepatching/checkcastI.java b/tests/regression/codepatching/checkcastI.java deleted file mode 100644 index 39137be71..000000000 --- a/tests/regression/codepatching/checkcastI.java +++ /dev/null @@ -1,2 +0,0 @@ -public interface checkcastI { -} diff --git a/tests/regression/codepatching/getfieldD.java b/tests/regression/codepatching/getfieldD.java deleted file mode 100644 index 0462af940..000000000 --- a/tests/regression/codepatching/getfieldD.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getfieldD { - public double d = 789.012; -} diff --git a/tests/regression/codepatching/getfieldF.java b/tests/regression/codepatching/getfieldF.java deleted file mode 100644 index aa3f23ea8..000000000 --- a/tests/regression/codepatching/getfieldF.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getfieldF { - public float f = 123.456F; -} diff --git a/tests/regression/codepatching/getfieldI.java b/tests/regression/codepatching/getfieldI.java deleted file mode 100644 index 90fa2c47a..000000000 --- a/tests/regression/codepatching/getfieldI.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getfieldI { - public int i = 123; -} diff --git a/tests/regression/codepatching/getfieldJ.java b/tests/regression/codepatching/getfieldJ.java deleted file mode 100644 index d022d08ab..000000000 --- a/tests/regression/codepatching/getfieldJ.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getfieldJ { - public long l = 1234567890123L; -} diff --git a/tests/regression/codepatching/getfieldL.java b/tests/regression/codepatching/getfieldL.java deleted file mode 100644 index 18392a864..000000000 --- a/tests/regression/codepatching/getfieldL.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getfieldL { - public Object o = null; -} diff --git a/tests/regression/codepatching/getstaticD.java b/tests/regression/codepatching/getstaticD.java deleted file mode 100644 index 15620a781..000000000 --- a/tests/regression/codepatching/getstaticD.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getstaticD { - public static double d = 789.012; -} diff --git a/tests/regression/codepatching/getstaticF.java b/tests/regression/codepatching/getstaticF.java deleted file mode 100644 index 64a610d3f..000000000 --- a/tests/regression/codepatching/getstaticF.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getstaticF { - public static float f = 123.456F; -} diff --git a/tests/regression/codepatching/getstaticI.java b/tests/regression/codepatching/getstaticI.java deleted file mode 100644 index c08fbb9ea..000000000 --- a/tests/regression/codepatching/getstaticI.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getstaticI { - public static int i = 123; -} diff --git a/tests/regression/codepatching/getstaticJ.java b/tests/regression/codepatching/getstaticJ.java deleted file mode 100644 index 49b7275a8..000000000 --- a/tests/regression/codepatching/getstaticJ.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getstaticJ { - public static long l = 1234567890123L; -} diff --git a/tests/regression/codepatching/getstaticL.java b/tests/regression/codepatching/getstaticL.java deleted file mode 100644 index c2e035538..000000000 --- a/tests/regression/codepatching/getstaticL.java +++ /dev/null @@ -1,3 +0,0 @@ -public class getstaticL { - public static Object o = null; -} diff --git a/tests/regression/codepatching/instanceofC.java b/tests/regression/codepatching/instanceofC.java deleted file mode 100644 index d4d9857eb..000000000 --- a/tests/regression/codepatching/instanceofC.java +++ /dev/null @@ -1,2 +0,0 @@ -public class instanceofC { -} diff --git a/tests/regression/codepatching/instanceofI.java b/tests/regression/codepatching/instanceofI.java deleted file mode 100644 index 6cf5671c4..000000000 --- a/tests/regression/codepatching/instanceofI.java +++ /dev/null @@ -1,2 +0,0 @@ -public interface instanceofI { -} diff --git a/tests/regression/codepatching/invokespecial.java b/tests/regression/codepatching/invokespecial.java deleted file mode 100644 index 9f1885aaf..000000000 --- a/tests/regression/codepatching/invokespecial.java +++ /dev/null @@ -1,5 +0,0 @@ -public class invokespecial { - public invokespecial() { - System.out.println("OK"); - } -} diff --git a/tests/regression/codepatching/invokestatic.java b/tests/regression/codepatching/invokestatic.java deleted file mode 100644 index 9aaeb509c..000000000 --- a/tests/regression/codepatching/invokestatic.java +++ /dev/null @@ -1,5 +0,0 @@ -public class invokestatic { - public static void sub() { - System.out.println("OK"); - } -} diff --git a/tests/regression/codepatching/multianewarray.java b/tests/regression/codepatching/multianewarray.java deleted file mode 100644 index 1573d4835..000000000 --- a/tests/regression/codepatching/multianewarray.java +++ /dev/null @@ -1,2 +0,0 @@ -public class multianewarray { -} diff --git a/tests/regression/codepatching/newarray.java b/tests/regression/codepatching/newarray.java deleted file mode 100644 index 5f116d0a9..000000000 --- a/tests/regression/codepatching/newarray.java +++ /dev/null @@ -1,2 +0,0 @@ -public class newarray { -} diff --git a/tests/regression/codepatching/putfieldD.java b/tests/regression/codepatching/putfieldD.java deleted file mode 100644 index a7b28f78e..000000000 --- a/tests/regression/codepatching/putfieldD.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldD { - public double d; -} diff --git a/tests/regression/codepatching/putfieldF.java b/tests/regression/codepatching/putfieldF.java deleted file mode 100644 index 85d9f2b57..000000000 --- a/tests/regression/codepatching/putfieldF.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldF { - public float f; -} diff --git a/tests/regression/codepatching/putfieldI.java b/tests/regression/codepatching/putfieldI.java deleted file mode 100644 index 6af25d1a6..000000000 --- a/tests/regression/codepatching/putfieldI.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldI { - public int i; -} diff --git a/tests/regression/codepatching/putfieldJ.java b/tests/regression/codepatching/putfieldJ.java deleted file mode 100644 index 6b2db7ead..000000000 --- a/tests/regression/codepatching/putfieldJ.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldJ { - public long l; -} diff --git a/tests/regression/codepatching/putfieldL.java b/tests/regression/codepatching/putfieldL.java deleted file mode 100644 index 75b3ecc0e..000000000 --- a/tests/regression/codepatching/putfieldL.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldL { - public Object o; -} diff --git a/tests/regression/codepatching/putfieldconstC.java b/tests/regression/codepatching/putfieldconstC.java deleted file mode 100644 index e62abd6a0..000000000 --- a/tests/regression/codepatching/putfieldconstC.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldconstC { - public Class c; -} diff --git a/tests/regression/codepatching/putfieldconstD.java b/tests/regression/codepatching/putfieldconstD.java deleted file mode 100644 index 3cb447836..000000000 --- a/tests/regression/codepatching/putfieldconstD.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldconstD { - public double d; -} diff --git a/tests/regression/codepatching/putfieldconstF.java b/tests/regression/codepatching/putfieldconstF.java deleted file mode 100644 index 49c07dbed..000000000 --- a/tests/regression/codepatching/putfieldconstF.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldconstF { - public float f; -} diff --git a/tests/regression/codepatching/putfieldconstI.java b/tests/regression/codepatching/putfieldconstI.java deleted file mode 100644 index 062271a9d..000000000 --- a/tests/regression/codepatching/putfieldconstI.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldconstI { - public int i; -} diff --git a/tests/regression/codepatching/putfieldconstJ.java b/tests/regression/codepatching/putfieldconstJ.java deleted file mode 100644 index a38325dd7..000000000 --- a/tests/regression/codepatching/putfieldconstJ.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldconstJ { - public long l; -} diff --git a/tests/regression/codepatching/putfieldconstL.java b/tests/regression/codepatching/putfieldconstL.java deleted file mode 100644 index 3d008294c..000000000 --- a/tests/regression/codepatching/putfieldconstL.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putfieldconstL { - public Object o; -} diff --git a/tests/regression/codepatching/putstaticD.java b/tests/regression/codepatching/putstaticD.java deleted file mode 100644 index 49f2010c5..000000000 --- a/tests/regression/codepatching/putstaticD.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticD { - public static double d; -} diff --git a/tests/regression/codepatching/putstaticF.java b/tests/regression/codepatching/putstaticF.java deleted file mode 100644 index 08cc3bc18..000000000 --- a/tests/regression/codepatching/putstaticF.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticF { - public static float f; -} diff --git a/tests/regression/codepatching/putstaticI.java b/tests/regression/codepatching/putstaticI.java deleted file mode 100644 index 39a18cab8..000000000 --- a/tests/regression/codepatching/putstaticI.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticI { - public static int i; -} diff --git a/tests/regression/codepatching/putstaticJ.java b/tests/regression/codepatching/putstaticJ.java deleted file mode 100644 index 8a3cfc5b3..000000000 --- a/tests/regression/codepatching/putstaticJ.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticJ { - public static long l; -} diff --git a/tests/regression/codepatching/putstaticL.java b/tests/regression/codepatching/putstaticL.java deleted file mode 100644 index f8e8deedf..000000000 --- a/tests/regression/codepatching/putstaticL.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticL { - public static Object o; -} diff --git a/tests/regression/codepatching/putstaticconstC.java b/tests/regression/codepatching/putstaticconstC.java deleted file mode 100644 index 358614ba9..000000000 --- a/tests/regression/codepatching/putstaticconstC.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticconstC { - public static Class c; -} diff --git a/tests/regression/codepatching/putstaticconstD.java b/tests/regression/codepatching/putstaticconstD.java deleted file mode 100644 index 219909dc8..000000000 --- a/tests/regression/codepatching/putstaticconstD.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticconstD { - public static double d; -} diff --git a/tests/regression/codepatching/putstaticconstF.java b/tests/regression/codepatching/putstaticconstF.java deleted file mode 100644 index 454c0c321..000000000 --- a/tests/regression/codepatching/putstaticconstF.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticconstF { - public static float f; -} diff --git a/tests/regression/codepatching/putstaticconstI.java b/tests/regression/codepatching/putstaticconstI.java deleted file mode 100644 index 7038a513b..000000000 --- a/tests/regression/codepatching/putstaticconstI.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticconstI { - public static int i; -} diff --git a/tests/regression/codepatching/putstaticconstJ.java b/tests/regression/codepatching/putstaticconstJ.java deleted file mode 100644 index 00409d0d3..000000000 --- a/tests/regression/codepatching/putstaticconstJ.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticconstJ { - public static long l; -} diff --git a/tests/regression/codepatching/putstaticconstL.java b/tests/regression/codepatching/putstaticconstL.java deleted file mode 100644 index 45e97dd44..000000000 --- a/tests/regression/codepatching/putstaticconstL.java +++ /dev/null @@ -1,3 +0,0 @@ -public class putstaticconstL { - public static Object o; -} diff --git a/tests/regression/codepatching/test.java b/tests/regression/codepatching/test.java deleted file mode 100644 index aba4d5e04..000000000 --- a/tests/regression/codepatching/test.java +++ /dev/null @@ -1,763 +0,0 @@ -public class test extends Thread { - static boolean doit = true; - - public static void main(String[] argv) { - int threadcount = 1; - - if (argv.length > 0) { - for (int i = 0; i < argv.length; i++) { - if (argv[i].equals("--help")) { - usage(); - - } else if (argv[i].equals("skip")) { - doit = false; - - } else { - threadcount = Integer.valueOf(argv[i]).intValue(); - } - } - } - - System.out.println("Running with " + threadcount + " threads."); - - for (int i = 0; i < threadcount; i++) { - new test().start(); - } - } - - static void usage() { - System.out.println("test [number of threads] [skip]"); - System.exit(1); - } - - public test() { - } - - public void start() { - run(); - } - - public void run() { - invokestatic(); - - getstatic(); - putstatic(); - putstaticconst(); - - getfield(); - putfield(); - putfieldconst(); - - newarray(); - multianewarray(); - - invokespecial(); - - checkcast(); - _instanceof(); - - aastoreconst(); - } - - - final private static void invokestatic() { - try { - p("invokestatic: "); - if (doit) - invokestatic.sub(); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - - private void getstatic() { - try { - p("getstatic (I): "); - if (doit) - check(getstaticI.i, 123); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getstatic (J): "); - if (doit) - check(getstaticJ.l, 1234567890123L); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getstatic (F): "); - if (doit) - check(getstaticF.f, 123.456F); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getstatic (D): "); - if (doit) - check(getstaticD.d, 789.012); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getstatic (L): "); - if (doit) - check(getstaticL.o, null); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void putstatic() { - try { - p("putstatic (I): "); - if (doit) { - int i = 123; - putstaticI.i = i; - check(putstaticI.i, i); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstatic (J): "); - if (doit) { - long l = 1234567890123L; - putstaticJ.l = l; - check(putstaticJ.l, l); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstatic (F): "); - if (doit) { - float f = 123.456F; - putstaticF.f = f; - check(putstaticF.f, f); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstatic (D): "); - if (doit) { - double d = 789.012; - putstaticD.d = d; - check(putstaticD.d, d); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - - try { - p("putstatic (L): "); - if (doit) { - Object o = null; - putstaticL.o = o; - check(putstaticL.o, o); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void putstaticconst() { - try { - p("putstaticconst (I): "); - if (doit) { - putstaticconstI.i = 123; - check(putstaticconstI.i, 123); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst (J): "); - if (doit) { - putstaticconstJ.l = 1234567890123L; - check(putstaticconstJ.l, 1234567890123L); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst (F): "); - if (doit) { - putstaticconstF.f = 123.456F; - check(putstaticconstF.f, 123.456F); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst (D): "); - if (doit) { - putstaticconstD.d = 789.012; - check(putstaticconstD.d, 789.012); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst zero (I): "); - if (doit) { - putstaticconstI.i = 0; - check(putstaticconstI.i, 0); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst zero (J): "); - if (doit) { - putstaticconstJ.l = 0L; - check(putstaticconstJ.l, 0L); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst zero (F): "); - if (doit) { - putstaticconstF.f = 0.0F; - check(putstaticconstF.f, 0.0F); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst zero (D): "); - if (doit) { - putstaticconstD.d = 0.0; - check(putstaticconstD.d, 0.0); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst zero (L): "); - if (doit) { - putstaticconstL.o = null; - check(putstaticconstL.o, null); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putstaticconst unresolved class: "); - if (doit) { - putstaticconstC.c = putstaticconstC.class; - check(putstaticconstC.c, Class.forName("putstaticconstC")); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } catch (ClassNotFoundException t) { - failed(t); - } - } - - private void getfield() { - try { - p("getfield (I): "); - if (doit) - check(new getfieldI().i, 123); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getfield (J): "); - if (doit) - check(new getfieldJ().l, 1234567890123L); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getfield (F): "); - if (doit) - check(new getfieldF().f, 123.456F); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getfield (D): "); - if (doit) - check(new getfieldD().d, 789.012); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("getfield (L): "); - if (doit) - check(new getfieldL().o, null); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void putfield() { - try { - p("putfield (I): "); - if (doit) { - putfieldI pfi = new putfieldI(); - int i = 123; - pfi.i = i; - check(pfi.i, i); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfield (J): "); - if (doit) { - putfieldJ pfj = new putfieldJ(); - long l = 1234567890123L; - pfj.l = l; - check(pfj.l, l); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfield (F): "); - if (doit) { - putfieldF pff = new putfieldF(); - float f = 123.456F; - pff.f = f; - check(pff.f, f); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfield (D): "); - if (doit) { - putfieldD pfd = new putfieldD(); - double d = 789.012; - pfd.d = d; - check(pfd.d, d); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfield (L): "); - if (doit) { - putfieldL pfl = new putfieldL(); - Object o = null; - pfl.o = o; - check(pfl.o, o); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void putfieldconst() { - try { - p("putfieldconst (I): "); - if (doit) { - putfieldconstI pfci = new putfieldconstI(); - pfci.i = 123; - check(pfci.i, 123); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst (J): "); - if (doit) { - putfieldconstJ pfcj = new putfieldconstJ(); - pfcj.l = 1234567890123L; - check(pfcj.l, 1234567890123L); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst (F): "); - if (doit) { - putfieldconstF pfcf = new putfieldconstF(); - pfcf.f = 123.456F; - check(pfcf.f, 123.456F); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst (D): "); - if (doit) { - putfieldconstD pfcd = new putfieldconstD(); - pfcd.d = 789.012; - check(pfcd.d, 789.012); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst zero (I): "); - if (doit) { - putfieldconstI pfci = new putfieldconstI(); - pfci.i = 0; - check(pfci.i, 0); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst zero (J): "); - if (doit) { - putfieldconstJ pfcj = new putfieldconstJ(); - pfcj.l = 0L; - check(pfcj.l, 0L); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst zero (F): "); - if (doit) { - putfieldconstF pfcf = new putfieldconstF(); - pfcf.f = 0.0F; - check(pfcf.f, 0.0F); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst zero (D): "); - if (doit) { - putfieldconstD pfcd = new putfieldconstD(); - pfcd.d = 0.0; - check(pfcd.d, 0.0); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst zero (L): "); - if (doit) { - putfieldconstL pfcl = new putfieldconstL(); - pfcl.o = null; - check(pfcl.o, null); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("putfieldconst unresolved class: "); - if (doit) { - putfieldconstC pfcc = new putfieldconstC(); - pfcc.c = putfieldconstC.class; - check(pfcc.c, Class.forName("putfieldconstC")); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } catch (ClassNotFoundException t) { - failed(t); - } - } - - private void newarray() { - try { - p("newarray: "); - if (doit) { - newarray[] na = new newarray[1]; - } - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void multianewarray() { - try { - p("multianewarray: "); - if (doit) { - multianewarray[][] ma = new multianewarray[1][1]; - } - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void invokespecial() { - try { - p("invokespecial: "); - if (doit) - new invokespecial(); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void checkcast() { - Object o = new Object(); - - // class - try { - p("checkcast class: "); - if (doit) { - checkcastC cc = (checkcastC) o; - failed(); - } else - ok(); - } catch (ClassCastException e) { - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - // interface - try { - p("checkcast interface: "); - if (doit) { - checkcastI ci = (checkcastI) o; - failed(); - } else - ok(); - } catch (ClassCastException e) { - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - - // array - - Object[] oa = new Object[1]; - - try { - p("checkcast class array: "); - if (doit) { - checkcastC[] cca = (checkcastC[]) oa; - failed(); - } else - ok(); - } catch (ClassCastException e) { - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void _instanceof() { - Object o = new Object(); - - try { - p("instanceof class: "); - if (doit) - if (o instanceof instanceofC) - failed(); - else - ok(); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - try { - p("instanceof interface: "); - if (doit) - if (o instanceof instanceofI) - failed(); - else - ok(); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - - - // array - - Object[] oa = new Object[1]; - - try { - p("instanceof class array: "); - if (doit) - if (oa instanceof instanceofC[]) - failed(); - else - ok(); - else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } - } - - private void aastoreconst() { - Class[] ca = new Class[1]; - - try { - p("aastoreconst of unresolved class != NULL: "); - if (doit) { - ca[0] = aastoreconstClass.class; - - if (ca[0] != null) - ok(); - else - failed(); - - p("aastoreconst of unresolved correct value: "); - check(ca[0],Class.forName("aastoreconstClass")); - } else - ok(); - } catch (NoClassDefFoundError t) { - failed(t); - } catch (ClassNotFoundException t) { - failed(t); - } - } - - private static final void ok() { - pln("OK"); - } - - private static final void failed() { - pln("FAILED"); - } - - private static final void failed(Throwable t) { - pln("FAILED: " + t); - } - - private static final void check(int a, int b) { - if (a == b) - ok(); - else - pln("FAILED: " + a + " != " + b + " (0x" + Integer.toHexString(a) + " != 0x" + Integer.toHexString(b) + ")"); - } - - private static final void check(long a, long b) { - if (a == b) - ok(); - else - pln("FAILED: " + a + " != " + b + " (0x" + Long.toHexString(a) + " != 0x" + Long.toHexString(b) + ")"); - } - - private static final void check(float a, float b) { - if (a == b) - ok(); - else - pln("FAILED: " + a + " != " + b); - } - - private static final void check(double a, double b) { - if (a == b) - ok(); - else - pln("FAILED: " + a + " != " + b); - } - - private static final void check(Object a, Object b) { - if (a == b) - ok(); - else - pln("FAILED: " + a + " != " + b); - } - - private static final void p(String s) { - System.out.print(s); - } - - private static final void pln(String s) { - System.out.println(s); - } -} - -// vim: et ts=4 sw=4 - diff --git a/tests/regression/junit/All.java b/tests/regression/junit/All.java index 013535388..15a552301 100644 --- a/tests/regression/junit/All.java +++ b/tests/regression/junit/All.java @@ -44,6 +44,7 @@ public class All extends TestCase { // Add your test here. + suite.addTest(new TestSuite(TestPatcher.class)); suite.addTest(new TestSuite(TestExceptionInStaticClassInitializer.class)); return suite; diff --git a/tests/regression/junit/Makefile.am b/tests/regression/junit/Makefile.am index 31b78a27e..5b7351b6a 100644 --- a/tests/regression/junit/Makefile.am +++ b/tests/regression/junit/Makefile.am @@ -26,7 +26,7 @@ JAVACMD = $(JAVA) -Xbootclasspath:$(BOOTCLASSPATH) JAVACCMD = $(JAVAC) -bootclasspath $(BOOTCLASSPATH) EXTRA_DIST = \ - *.java + $(srcdir)/*.java CLEANFILES = \ *.class diff --git a/tests/regression/junit/TestPatcher.java b/tests/regression/junit/TestPatcher.java new file mode 100644 index 000000000..841760826 --- /dev/null +++ b/tests/regression/junit/TestPatcher.java @@ -0,0 +1,650 @@ +/* tests/regression/bugzilla/TestPatcher.java + + Copyright (C) 2008 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO + + This file is part of CACAO. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program 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 for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +*/ + + +import junit.framework.*; +import junit.textui.*; + +import java.io.*; + +public class TestPatcher extends TestCase { + public static void main(String[] args) { + TestRunner.run(suite()); + } + + public static Test suite() { + return new TestSuite(TestPatcher.class); + } + + static boolean doit = true; + + final static int i = 123; + final static long l = 1234567890123L; + final static float f = 123.456F; + final static double d = 789.012; + final static Object o = new Object(); + + public void testNormal() { + invokestatic(); + invokespecial(); + + getstatic(); + putstatic(); + putstaticconst(); + + getfield(); + putfield(); + putfieldconst(); + + newarray(); + multianewarray(); + + checkcast(); + _instanceof(); + + aastoreconst(); + } + + public void testWithoutClasses() { + // Delete all classes. + //new File("TestPatcher$invokestatic.class").delete(); + + invokestatic(); + invokespecial(); + + getstatic(); + putstatic(); + putstaticconst(); + + getfield(); + putfield(); + putfieldconst(); + + newarray(); + multianewarray(); + + checkcast(); + _instanceof(); + + aastoreconst(); + } + + private void invokestatic() { + try { + if (doit) + invokestatic.sub(); + } catch (NoClassDefFoundError e) { + fail(e.toString()); + } + } + + private void getstatic() { + try { + if (doit) + assertTrue(getstaticI.i + " != " + i, getstaticI.i == i); + } catch (NoClassDefFoundError e) { + fail(e.toString()); + } + + try { + if (doit) + assertTrue(getstaticJ.l + " != " + l, getstaticJ.l == l); + } catch (NoClassDefFoundError e) { + fail(e.toString()); + } + + try { + if (doit) + assertTrue(getstaticF.f + " != " + f, getstaticF.f == f); + } catch (NoClassDefFoundError e) { + fail(e.toString()); + } + + try { + if (doit) + assertTrue(getstaticD.d + " != " + d, getstaticD.d == d); + } catch (NoClassDefFoundError e) { + fail(e.toString()); + } + + try { + if (doit) + assertTrue(getstaticL.o + " != null", getstaticL.o == null); + } catch (NoClassDefFoundError e) { + fail(e.toString()); + } + } + + private void putstatic() { + try { + if (doit) { + putstaticI.i = i; + assertTrue(putstaticI.i + " != " + i, putstaticI.i == i); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticJ.l = l; + assertTrue(putstaticJ.l + " != " + l, putstaticJ.l == l); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticF.f = f; + assertTrue(putstaticF.f + " != " + f, putstaticF.f == f); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticD.d = d; + assertTrue(putstaticD.d + " != " + d, putstaticD.d == d); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + + try { + if (doit) { + putstaticL.o = o; + assertTrue(putstaticL.o + " != " + o, putstaticL.o == o); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void putstaticconst() { + try { + if (doit) { + putstaticconstI.i = i; + assertTrue(putstaticconstI.i + " != " + i, putstaticconstI.i == i); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstJ.l = l; + assertTrue(putstaticconstJ.l + " != " + l, putstaticconstJ.l == l); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstF.f = f; + assertTrue(putstaticconstF.f + " != " + f, putstaticconstF.f == f); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstD.d = d; + assertTrue(putstaticconstD.d + " != " + d, putstaticconstD.d == d); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstI.i = 0; + assertTrue(putstaticconstI.i + " != " + 0, putstaticconstI.i == 0); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstJ.l = 0L; + assertTrue(putstaticconstJ.l + " != " + 0L, putstaticconstJ.l == 0L); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstF.f = 0.0F; + assertTrue(putstaticconstF.f + " != " + 0.0F, putstaticconstF.f == 0.0F); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstD.d = 0.0; + assertTrue(putstaticconstD.d + " != " + 0.0, putstaticconstD.d == 0.0); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstL.o = null; + assertTrue(putstaticconstL.o + " != " + null, putstaticconstL.o == null); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putstaticconstC.c = putstaticconstC.class; + assertTrue(putstaticconstC.c + " != " + Class.forName("TestPatcher$putstaticconstC"), putstaticconstC.c == Class.forName("TestPatcher$putstaticconstC")); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } catch (ClassNotFoundException t) { + fail(t.toString()); + } + } + + private void getfield() { + try { + if (doit) + assertTrue(new getfieldI().i + " != " + i, new getfieldI().i == i); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) + assertTrue(new getfieldJ().l + " != " + l, new getfieldJ().l == l); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) + assertTrue(new getfieldF().f + " != " + f, new getfieldF().f == f); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) + assertTrue(new getfieldD().d + " != " + d, new getfieldD().d == d); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) + assertTrue(new getfieldL().o + " != " + null, new getfieldL().o == null); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void putfield() { + try { + if (doit) { + TestPatcher.putfieldI pfi = new TestPatcher.putfieldI(); + pfi.i = i; + assertTrue(pfi.i + " != " + i, pfi.i == i); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldJ pfj = new putfieldJ(); + pfj.l = l; + assertTrue(pfj.l + " != " + l, pfj.l == l); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldF pff = new putfieldF(); + pff.f = f; + assertTrue(pff.f + " != " + f, pff.f == f); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldD pfd = new putfieldD(); + pfd.d = d; + assertTrue(pfd.d + " != " + d, pfd.d == d); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldL pfl = new putfieldL(); + pfl.o = o; + assertTrue(pfl.o + " != " + o, pfl.o == o); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void putfieldconst() { + try { + if (doit) { + putfieldconstI pfci = new putfieldconstI(); + pfci.i = i; + assertTrue(pfci.i + " != " + i, pfci.i == i); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstJ pfcj = new putfieldconstJ(); + pfcj.l = l; + assertTrue(pfcj.l + " != " + l, pfcj.l == l); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstF pfcf = new putfieldconstF(); + pfcf.f = f; + assertTrue(pfcf.f + " != " + f, pfcf.f == f); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstD pfcd = new putfieldconstD(); + pfcd.d = d; + assertTrue(pfcd.d + " != " + d, pfcd.d == d); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstI pfci = new putfieldconstI(); + pfci.i = 0; + assertTrue(pfci.i + " != " + 0, pfci.i == 0); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstJ pfcj = new putfieldconstJ(); + pfcj.l = 0L; + assertTrue(pfcj.l + " != " + 0L, pfcj.l == 0L); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstF pfcf = new putfieldconstF(); + pfcf.f = 0.0F; + assertTrue(pfcf.f + " != " + 0.0F, pfcf.f == 0.0F); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstD pfcd = new putfieldconstD(); + pfcd.d = 0.0; + assertTrue(pfcd.d + " != " + 0.0, pfcd.d == 0.0); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstL pfcl = new putfieldconstL(); + pfcl.o = null; + assertTrue(pfcl.o + " != " + null, pfcl.o == null); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) { + putfieldconstC pfcc = new putfieldconstC(); + pfcc.c = putfieldconstC.class; + assertTrue(pfcc.c + " != " + Class.forName("TestPatcher$putfieldconstC"), pfcc.c == Class.forName("TestPatcher$putfieldconstC")); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } catch (ClassNotFoundException t) { + fail(t.toString()); + } + } + + private void newarray() { + try { + if (doit) { + newarray[] na = new newarray[1]; + na[0] = null; + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void multianewarray() { + try { + if (doit) { + multianewarray[][] ma = new multianewarray[1][1]; + ma[0][0] = null; + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void invokespecial() { + try { + if (doit) + new invokespecial(); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void checkcast() { + Object o = new Object(); + + // class + try { + if (doit) { + checkcastC cc = (checkcastC) o; + fail(); + } + } catch (ClassCastException success) { + // This is OK. + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + // interface + try { + if (doit) { + checkcastI ci = (checkcastI) o; + fail(); + } + } catch (ClassCastException success) { + // This is OK. + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + + // array + Object[] oa = new Object[1]; + + try { + if (doit) { + checkcastC[] cca = (checkcastC[]) oa; + fail(); + } + } catch (ClassCastException e) { + // This is OK. + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void _instanceof() { + Object o = new Object(); + + try { + if (doit) + if (o instanceof instanceofC) + fail(); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + try { + if (doit) + if (o instanceof instanceofI) + fail(); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + + + // array + Object[] oa = new Object[1]; + + try { + if (doit) + if (oa instanceof instanceofC[]) + fail(); + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } + } + + private void aastoreconst() { + Class[] ca = new Class[1]; + + try { + if (doit) { + ca[0] = aastoreconstClass.class; + + if (ca[0] == null) + fail(); + + assertTrue(ca[0] + " != " + Class.forName("TestPatcher$aastoreconstClass") , ca[0] == Class.forName("TestPatcher$aastoreconstClass")); + } + } catch (NoClassDefFoundError t) { + fail(t.toString()); + } catch (ClassNotFoundException t) { + fail(t.toString()); + } + } + + static class invokestatic { static void sub() {} } + static class invokespecial { void invokespecial() {} } + + static class getstaticI { static int i = TestPatcher.i; } + static class getstaticJ { static long l = TestPatcher.l; } + static class getstaticF { static float f = TestPatcher.f; } + static class getstaticD { static double d = TestPatcher.d; } + static class getstaticL { static Object o = null; } + + static class putstaticI { static int i; } + static class putstaticJ { static long l; } + static class putstaticF { static float f; } + static class putstaticD { static double d; } + static class putstaticL { static Object o; } + + static class putstaticconstI { static int i; } + static class putstaticconstJ { static long l; } + static class putstaticconstF { static float f; } + static class putstaticconstD { static double d; } + static class putstaticconstL { static Object o; } + static class putstaticconstC { static Class c; } + + static class getfieldI { int i = TestPatcher.i; } + static class getfieldJ { long l = TestPatcher.l; } + static class getfieldF { float f = TestPatcher.f; } + static class getfieldD { double d = TestPatcher.d; } + static class getfieldL { Object o = null; } + + static class putfieldI { int i; } + static class putfieldJ { long l; } + static class putfieldF { float f; } + static class putfieldD { double d; } + static class putfieldL { Object o; } + + static class putfieldconstI { int i; } + static class putfieldconstJ { long l; } + static class putfieldconstF { float f; } + static class putfieldconstD { double d; } + static class putfieldconstL { Object o; } + static class putfieldconstC { Class c; } + + static class newarray {} + static class multianewarray {} + + static class instanceofC {} + static interface instanceofI {} + + static class checkcastC {} + static interface checkcastI {} + + static class aastoreconstClass {} +} -- 2.25.1