summaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authoraclement <aclement>2011-08-05 16:06:26 +0000
committeraclement <aclement>2011-08-05 16:06:26 +0000
commit0c801473689968a031b976eb553f2771c9623967 (patch)
treeb2f26cfb3c131e31ca60920504da6977ed7bed3b /tests/src
parent529dc748a63e8ff0358bacf04ee23f6e2f3a43f4 (diff)
downloadaspectj-0c801473689968a031b976eb553f2771c9623967.tar.gz
aspectj-0c801473689968a031b976eb553f2771c9623967.zip
353936
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java23
-rw-r--r--tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml4
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
index 223c2f2c0..c0907c43b 100644
--- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
@@ -14,6 +14,8 @@ import java.io.File;
import junit.framework.Test;
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
@@ -25,6 +27,27 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// runTest("anno copying");
// }
+ public void testRangeForLocalVariables_353936() throws ClassNotFoundException {
+ runTest("local variable tables");
+ JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X");
+ Method[] meths = jc.getMethods();
+ boolean checked = false;
+ for (int i = 0; i < meths.length; i++) {
+ Method method = meths[i];
+ if (method.getName().equals("ajc$before$X$2$3444dde4")) {
+ System.out.println(method.getName());
+ System.out.println(stringify(method.getLocalVariableTable()));
+ System.out.println(method.getCode().getLength());
+ checked = true;
+ assertEquals("LX; this(0) start=0 len=48", stringify(method.getLocalVariableTable(), 0));
+ assertEquals("Lorg/aspectj/lang/JoinPoint; thisJoinPoint(1) start=0 len=48",
+ stringify(method.getLocalVariableTable(), 1));
+ assertEquals("I i(2) start=8 len=22", stringify(method.getLocalVariableTable(), 2));
+ }
+ }
+ assertTrue(checked);
+ }
+
public void testEmptyPattern_pr352363() {
runTest("empty pattern");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
index 87412fe06..c06b0218a 100644
--- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
+++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml
@@ -2,6 +2,10 @@
<suite>
+<ajc-test dir="bugs1612/pr353936" title="local variable tables">
+<compile files="Code.java" options="-1.5"/>
+</ajc-test>
+
<ajc-test dir="bugs1612/pr352363" title="empty pattern">
<compile files="Code.java" options="-1.5">
<message line="12" kind="warning" text="name is empty1"/>