diff options
author | eshizhan <eshizhan@126.com> | 2021-01-29 12:34:08 +0800 |
---|---|---|
committer | eshizhan <eshizhan@126.com> | 2021-01-29 12:34:08 +0800 |
commit | 5bccb19933b3eda51518d79ca52a06b89d304bf6 (patch) | |
tree | c6456844b635ebf4b644e5defef6259157289fa2 /src/test | |
parent | 084c8e89b5d40bb739b7a6dee61a89452d679c1c (diff) | |
download | javassist-5bccb19933b3eda51518d79ca52a06b89d304bf6.tar.gz javassist-5bccb19933b3eda51518d79ca52a06b89d304bf6.zip |
add unit tests for LocalVariableAttribute.variableNameByIndex and MethodParametersAttribute.parameterName
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/javassist/JvstTest4.java | 4 | ||||
-rw-r--r-- | src/test/javassist/bytecode/BytecodeTest.java | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index d53148bd..259451b9 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -1019,11 +1019,15 @@ public class JvstTest4 extends JvstTestRoot { assertEquals(2, attr.size()); assertEquals("i", cp.getUtf8Info(attr.name(0))); assertEquals("s", cp.getUtf8Info(attr.name(1))); + assertEquals("i", attr.parameterName(0)); + assertEquals("s", attr.parameterName(1)); attr = (MethodParametersAttribute)attr.copy(cp, null); assertEquals(2, attr.size()); assertEquals("i", cp.getUtf8Info(attr.name(0))); assertEquals("s", cp.getUtf8Info(attr.name(1))); + assertEquals("i", attr.parameterName(0)); + assertEquals("s", attr.parameterName(1)); } // JIRA JASSIST-220 diff --git a/src/test/javassist/bytecode/BytecodeTest.java b/src/test/javassist/bytecode/BytecodeTest.java index 5ddf5d5b..7aef1cce 100644 --- a/src/test/javassist/bytecode/BytecodeTest.java +++ b/src/test/javassist/bytecode/BytecodeTest.java @@ -354,6 +354,9 @@ public class BytecodeTest extends TestCase { assertEquals("I", ainfo2.descriptor(i)); } print("**** end ***"); + + assertEquals("this", ainfo2.variableNameByIndex(0)); + assertEquals("i", ainfo2.variableNameByIndex(1)); } public void testAnnotations() throws Exception { |