()
| 88 | } |
| 89 | |
| 90 | private static Class makeTestClass() throws IOException { |
| 91 | List pool = new ArrayList(); |
| 92 | ByteArrayOutputStream out = new ByteArrayOutputStream(); |
| 93 | String name = "$SubroutineTest$"; |
| 94 | |
| 95 | Assembler.writeClass |
| 96 | (out, pool, ConstantPool.addClass(pool, name), |
| 97 | ConstantPool.addClass(pool, "java/lang/Object"), |
| 98 | new int[0], new MethodData[] |
| 99 | { new MethodData(Assembler.ACC_STATIC | Assembler.ACC_PUBLIC, |
| 100 | ConstantPool.addUtf8(pool, "test"), |
| 101 | ConstantPool.addUtf8(pool, "()V"), |
| 102 | makeTestCode(pool)) }); |
| 103 | |
| 104 | return new MyClassLoader(Subroutine.class.getClassLoader()) |
| 105 | .defineClass(name, out.toByteArray()); |
| 106 | } |
| 107 | |
| 108 | // These tests are intended to cover the jsr and ret instructions. |
| 109 | // However, recent Sun javac versions avoid generating these |
no test coverage detected