diff options
Diffstat (limited to 'test/918-fields')
| -rw-r--r--[-rwxr-xr-x] | test/918-fields/run.py (renamed from test/918-fields/run) | 4 | ||||
| -rw-r--r-- | test/918-fields/src/Main.java | 6 | ||||
| -rw-r--r-- | test/918-fields/src/art/Test918.java | 87 |
3 files changed, 49 insertions, 48 deletions
diff --git a/test/918-fields/run b/test/918-fields/run.py index c6e62ae6cd..4796039801 100755..100644 --- a/test/918-fields/run +++ b/test/918-fields/run.py @@ -14,4 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -./default-run "$@" --jvmti + +def run(ctx, args): + ctx.default_run(args, jvmti=True) diff --git a/test/918-fields/src/Main.java b/test/918-fields/src/Main.java index e0ed65c763..e9f9bc9a72 100644 --- a/test/918-fields/src/Main.java +++ b/test/918-fields/src/Main.java @@ -15,7 +15,7 @@ */ public class Main { - public static void main(String[] args) throws Exception { - art.Test918.run(); - } + public static void main(String[] args) throws Exception { + art.Test918.run(); + } } diff --git a/test/918-fields/src/art/Test918.java b/test/918-fields/src/art/Test918.java index 5328b0bbdb..966c093215 100644 --- a/test/918-fields/src/art/Test918.java +++ b/test/918-fields/src/art/Test918.java @@ -21,58 +21,57 @@ import java.lang.reflect.Field; import java.util.Arrays; public class Test918 { - public static void run() throws Exception { - doTest(); - } + public static void run() throws Exception { + doTest(); + } - public static void doTest() throws Exception { - testField(Math.class, "PI"); - testField(InterruptedIOException.class, "bytesTransferred"); - testField(Foo.class, "this$0"); - testField(Bar.class, "VAL"); - testField(Generics.class, "generics"); - testField(Generics.class, "privateValue"); - } + public static void doTest() throws Exception { + testField(Math.class, "PI"); + testField(InterruptedIOException.class, "bytesTransferred"); + testField(Foo.class, "this$0"); + testField(Bar.class, "VAL"); + testField(Generics.class, "generics"); + testField(Generics.class, "privateValue"); + } - private static void testField(Class<?> base, String fieldName) - throws Exception { - Field f = base.getDeclaredField(fieldName); - String[] result = getFieldName(f); - System.out.println(Arrays.toString(result)); + private static void testField(Class<?> base, String fieldName) throws Exception { + Field f = base.getDeclaredField(fieldName); + String[] result = getFieldName(f); + System.out.println(Arrays.toString(result)); - Class<?> declClass = getFieldDeclaringClass(f); - if (base != declClass) { - throw new RuntimeException("Declaring class not equal: " + base + " vs " + declClass); - } - System.out.println(declClass); + Class<?> declClass = getFieldDeclaringClass(f); + if (base != declClass) { + throw new RuntimeException("Declaring class not equal: " + base + " vs " + declClass); + } + System.out.println(declClass); - int modifiers = getFieldModifiers(f); - if (modifiers != f.getModifiers()) { - throw new RuntimeException("Modifiers not equal: " + f.getModifiers() + " vs " + modifiers); - } - System.out.println(modifiers); + int modifiers = getFieldModifiers(f); + if (modifiers != f.getModifiers()) { + throw new RuntimeException( + "Modifiers not equal: " + f.getModifiers() + " vs " + modifiers); + } + System.out.println(modifiers); - boolean synth = isFieldSynthetic(f); - if (synth != f.isSynthetic()) { - throw new RuntimeException("Synthetic not equal: " + f.isSynthetic() + " vs " + synth); + boolean synth = isFieldSynthetic(f); + if (synth != f.isSynthetic()) { + throw new RuntimeException("Synthetic not equal: " + f.isSynthetic() + " vs " + synth); + } + System.out.println(synth); } - System.out.println(synth); - } - private static native String[] getFieldName(Field f); - private static native Class<?> getFieldDeclaringClass(Field f); - private static native int getFieldModifiers(Field f); - private static native boolean isFieldSynthetic(Field f); + private static native String[] getFieldName(Field f); + private static native Class<?> getFieldDeclaringClass(Field f); + private static native int getFieldModifiers(Field f); + private static native boolean isFieldSynthetic(Field f); - private class Foo { - } + private class Foo {} - private static interface Bar { - public static int VAL = 1; - } + private static interface Bar { + public static int VAL = 1; + } - private static class Generics<T> { - T generics; - private int privateValue = 42; - } + private static class Generics<T> { + T generics; + private int privateValue = 42; + } } |