From b90b11e6346a98ec268bfc7619e4d8980b939429 Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 4 Apr 2009 18:41:40 +0000 Subject: [PATCH] 271169: test and fix: npe in weave call method with 4 longs --- tests/bugs165/pr271169/HypChecksums.java | 19 ++++++++++ .../org/aspectj/systemtest/AllTests16.java | 2 ++ .../systemtest/ajc165/Ajc165Tests.java | 35 +++++++++++++++++++ .../systemtest/ajc165/AllTestsAspectJ165.java | 25 +++++++++++++ .../org/aspectj/systemtest/ajc165/ajc165.xml | 9 +++++ 5 files changed, 90 insertions(+) create mode 100644 tests/bugs165/pr271169/HypChecksums.java create mode 100644 tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java create mode 100644 tests/src/org/aspectj/systemtest/ajc165/AllTestsAspectJ165.java create mode 100644 tests/src/org/aspectj/systemtest/ajc165/ajc165.xml 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 @@ + + + + + + + + + \ No newline at end of file -- 2.39.5