From: wisberg Date: Wed, 14 May 2003 05:13:24 +0000 (+0000) Subject: test data upgrades for adding new command-line error tests X-Git-Tag: V1_1_0~114 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5bc48d3686ce24cc30ea836bf7b6977985440805;p=aspectj.git test data upgrades for adding new command-line error tests --- diff --git a/tests/harness/oneInjar.jar b/tests/harness/oneInjar.jar new file mode 100644 index 000000000..44eaf54bd Binary files /dev/null and b/tests/harness/oneInjar.jar differ diff --git a/tests/incremental/defaultPackage/src/lib/Lib.java b/tests/incremental/defaultPackage/src/lib/Lib.java index ec9ffe351..8ac8a0172 100644 --- a/tests/incremental/defaultPackage/src/lib/Lib.java +++ b/tests/incremental/defaultPackage/src/lib/Lib.java @@ -2,6 +2,8 @@ package lib; public class Lib { + public static void main(String[] args) { + } public static void f(){} } diff --git a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar index 020b5d00e..e286805cd 100644 Binary files a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar and b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar differ diff --git a/tests/new/binaryWarnings/injars/app-javac-1.4.jar b/tests/new/binaryWarnings/injars/app-javac-1.4.jar index fd9832350..84441d41a 100644 Binary files a/tests/new/binaryWarnings/injars/app-javac-1.4.jar and b/tests/new/binaryWarnings/injars/app-javac-1.4.jar differ diff --git a/tests/new/binaryWarnings/readme.txt b/tests/new/binaryWarnings/readme.txt index a6f0a69a4..709326d57 100644 --- a/tests/new/binaryWarnings/readme.txt +++ b/tests/new/binaryWarnings/readme.txt @@ -15,10 +15,6 @@ Bugs: 37020, 37021, 37023 - the message text in MainWarnings.java correspond with warning text values in the test specifications - -- all the warnings in MainWarnings.java - should resolve to unique lines - (until we verify based on more than line) - all test specifications should have exactly the same warnings as each other as as specified in MainWarnings.java @@ -36,7 +32,7 @@ Using javac: rm -rf classes Using ajc: - ajc -classpath ../../../lib/test/aspectjrt.jar \ + ajc -classpath ../../../../lib/test/aspectjrt.jar \ -outjar ../injars/app-ajc-1.1.jar app/Main.java Using ajc in eclipse, from a module directory: diff --git a/tests/new/binaryWarnings/src/app/Main.java b/tests/new/binaryWarnings/src/app/Main.java index a118555d4..293e506ce 100644 --- a/tests/new/binaryWarnings/src/app/Main.java +++ b/tests/new/binaryWarnings/src/app/Main.java @@ -5,7 +5,7 @@ public class Main { static String staticString = "hello"; - String s = "me"; + String s = "me"; // bug 8 initializer picked out as execution public static void main(String[] args) { @@ -20,7 +20,7 @@ public class Main { } } - Main() { // 23 + Main() { s += "pick me, not initializer"; // 23 } void go(String s) { String t = "..".substring(0); // 26 @@ -29,7 +29,7 @@ public class Main { String temp = this.s; // 29 this.s = temp + ", " + s; // 31 - + D.go(); // 32 } catch (RuntimeException e) { String u = "..".substring(0); // 33 stop(); // 35 @@ -39,7 +39,7 @@ public class Main { void stop() { // 40 - new Main(); // 42 + D.go(); // 42 } } @@ -53,3 +53,10 @@ class C { } +class D { + + static void go() { + + } + +} diff --git a/tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java b/tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java new file mode 100644 index 000000000..fa55066d4 --- /dev/null +++ b/tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java @@ -0,0 +1,12 @@ + +package aspects; + +import app.Main; + +// WARNING: do not change message text without changing test specification +public privileged aspect ConstructorExecutionWarning { + + declare warning : execution(Main.new()) // 23 (bug: 8) + : "execution(Main.new())"; + +} \ No newline at end of file diff --git a/tests/new/binaryWarnings/src/aspects/MainWarnings.java b/tests/new/binaryWarnings/src/aspects/MainWarnings.java index 4debf1f3b..218968f94 100644 --- a/tests/new/binaryWarnings/src/aspects/MainWarnings.java +++ b/tests/new/binaryWarnings/src/aspects/MainWarnings.java @@ -7,14 +7,11 @@ import app.Main; public privileged aspect MainWarnings { declare warning : staticinitialization(Main) - : "staticinitializtion(Main)"; + : "staticinitialization(Main)"; - declare warning : initialization(Main.new()) + declare warning : initialization(Main.new()) // 23 : "initialization(Main.new())"; - declare warning : execution(Main.new()) - : "execution(Main.new())"; - declare warning : execution(void Main.go(String)) : "execution(void Main.go(String))"; @@ -24,13 +21,17 @@ public privileged aspect MainWarnings { declare warning : call(void Main.go(String)) : "call(void Main.go(String))"; - declare warning : call(Main.new()) + declare warning : call(void app.D.go()) // 42 (bug missing) && withincode(void Main.stop()) - : "call(Main.new()) && withincode(void Main.stop())"; + : "withincode(void Main.stop())"; + + declare warning : call(void app.D.go()) // 32 + && withincode(void Main.go(String)) + : "D.go withincode(void Main.go(String))"; - declare warning : call(void Main.stop()) + declare warning : call(void Main.stop()) // 35 && withincode(void Main.go(String)) - : "call(void Main.stop()) && withincode(void Main.go(String))"; + : "Main.stop withincode(void Main.go(String))"; declare warning : get(String Main.s) : "get(String Main.s)";