diff options
author | aclement <aclement> | 2009-04-04 18:41:40 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-04-04 18:41:40 +0000 |
commit | b90b11e6346a98ec268bfc7619e4d8980b939429 (patch) | |
tree | fe59eacb37d97ea2643c1df94c2ca495410ebe27 /tests | |
parent | df5127eb48ca10ae10014c5a05dfcce9bf5839ff (diff) | |
download | aspectj-b90b11e6346a98ec268bfc7619e4d8980b939429.tar.gz aspectj-b90b11e6346a98ec268bfc7619e4d8980b939429.zip |
271169: test and fix: npe in weave call method with 4 longs
Diffstat (limited to 'tests')
5 files changed, 90 insertions, 0 deletions
diff --git a/tests/bugs165/pr271169/HypChecksums.java b/tests/bugs165/pr271169/HypChecksums.java new file mode 100644 index 000000000..f76fa9272 --- /dev/null +++ b/tests/bugs165/pr271169/HypChecksums.java @@ -0,0 +1,19 @@ +public class HypChecksums { + + static class Adler { + long combine(long a, long b, long c, long d) { + return 3; + } + } + + public static void main(final String[] pArgs) { + Adler comb = new Adler(); + comb.combine(4, 2, 3, 3); + } +} + +aspect X { + Object around(): call(* combine(..)) && !within(X) { + return proceed(); + } +} diff --git a/tests/src/org/aspectj/systemtest/AllTests16.java b/tests/src/org/aspectj/systemtest/AllTests16.java index 57ec0a2a5..2c2572b90 100644 --- a/tests/src/org/aspectj/systemtest/AllTests16.java +++ b/tests/src/org/aspectj/systemtest/AllTests16.java @@ -11,6 +11,7 @@ import org.aspectj.systemtest.ajc161.AllTestsAspectJ161; import org.aspectj.systemtest.ajc162.AllTestsAspectJ162; import org.aspectj.systemtest.ajc163.AllTestsAspectJ163; import org.aspectj.systemtest.ajc164.AllTestsAspectJ164; +import org.aspectj.systemtest.ajc165.AllTestsAspectJ165; public class AllTests16 { @@ -23,6 +24,7 @@ public class AllTests16 { suite.addTest(AllTestsAspectJ162.suite()); suite.addTest(AllTestsAspectJ163.suite()); suite.addTest(AllTestsAspectJ164.suite()); + suite.addTest(AllTestsAspectJ165.suite()); suite.addTest(AllTests15.suite()); // $JUnit-END$ return suite; diff --git a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java new file mode 100644 index 000000000..d85a29889 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2008 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc165; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + public void testAroundCall_pr271169() { + runTest("around call npe"); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc165Tests.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc165/ajc165.xml"); + } + +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc165/AllTestsAspectJ165.java b/tests/src/org/aspectj/systemtest/ajc165/AllTestsAspectJ165.java new file mode 100644 index 000000000..f89671e22 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc165/AllTestsAspectJ165.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2008 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc165; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTestsAspectJ165 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.6.5 tests"); + // $JUnit-BEGIN$ + suite.addTest(Ajc165Tests.suite()); + // $JUnit-END$ + return suite; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml new file mode 100644 index 000000000..d0f866e19 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml @@ -0,0 +1,9 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<suite> + + <ajc-test dir="bugs165/pr271169" title="around call npe"> + <compile files="HypChecksums.java" options="-1.5"/> + </ajc-test> + +</suite>
\ No newline at end of file |