summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-03-05 21:46:49 +0000
committerjhugunin <jhugunin>2003-03-05 21:46:49 +0000
commitcb775240056309c20aac308be5ab2abd9696be84 (patch)
tree8fd9d7849d91e868d52048f1cb862d57ba8f5e20 /tests
parent769afc68966b6ea101dfebca14c6d67bd426bfa0 (diff)
downloadaspectj-cb775240056309c20aac308be5ab2abd9696be84.tar.gz
aspectj-cb775240056309c20aac308be5ab2abd9696be84.zip
Bugzilla Bug 33635
Negation of if pointcut does not work
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/NotIf.java49
-rw-r--r--tests/jimTests.xml7
2 files changed, 56 insertions, 0 deletions
diff --git a/tests/bugs/NotIf.java b/tests/bugs/NotIf.java
new file mode 100644
index 000000000..3220104c7
--- /dev/null
+++ b/tests/bugs/NotIf.java
@@ -0,0 +1,49 @@
+// for Bug#: 33635
+import org.aspectj.testing.Tester;
+
+
+public class NotIf {
+ public static void main(String[] args) {
+ Tester.checkEqual(Aspect1.ranNone, 0, "shouldn't run");
+ Tester.checkEqual(Aspect1.ranTwo, 2, "should run");
+ Tester.checkEqual(Aspect2.ran, 1, "should run with values");
+ }
+}
+
+aspect Aspect1 {
+ static int ranNone = 0;
+ static int ranTwo = 0;
+
+ static boolean testTrue() { return true; }
+
+ static boolean testFalse() { return false; }
+
+ before(): execution(void main(..)) && !if(testTrue()) {
+ ranNone += 1;
+ }
+
+ before(): execution(void main(..)) && if(!testTrue()) {
+ ranNone += 1;
+ }
+ before(): execution(void main(..)) && !if(testFalse()) {
+ ranTwo += 1;
+ }
+
+ before(): execution(void main(..)) && if(!testFalse()) {
+ ranTwo += 1;
+ }
+}
+
+aspect Aspect2 {
+ static int ran = 0;
+
+ static boolean testValues(int i, String s, Object o) {
+ return false;
+ }
+
+ before(String[] a): execution(void main(String[])) &&
+ !if(testValues(a.length, a.toString(), a)) && args(a)
+ {
+ ran += 1;
+ }
+}
diff --git a/tests/jimTests.xml b/tests/jimTests.xml
index e7e9b8b97..6306ec843 100644
--- a/tests/jimTests.xml
+++ b/tests/jimTests.xml
@@ -1,6 +1,13 @@
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
+ <ajc-test dir="bugs" pr="33635"
+ title="Negation of if pointcut does not work">
+ <compile files="NotIf.java"/>
+ <run class="NotIf"/>
+ </ajc-test>
+
+
<!--