diff options
author | acolyer <acolyer> | 2004-08-04 12:04:41 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-08-04 12:04:41 +0000 |
commit | 0f211e17cac9b031ab8d9115f9030b3e65d3927a (patch) | |
tree | cabe16f0e367daaa4b28685e09f5b0bcd55bb43d /tests/pureJava | |
parent | 9a051d348a240095e56ead5485c2dba8cf6ad4a7 (diff) | |
download | aspectj-0f211e17cac9b031ab8d9115f9030b3e65d3927a.tar.gz aspectj-0f211e17cac9b031ab8d9115f9030b3e65d3927a.zip |
Spring cleaning in the test suite. Docs for AjcTestCase and XMLBasedAjcTestCase
added in docs dir.
Diffstat (limited to 'tests/pureJava')
-rw-r--r-- | tests/pureJava/test120/Driver.java | 53 | ||||
-rw-r--r-- | tests/pureJava/test120/Readme.txt | 9 | ||||
-rw-r--r-- | tests/pureJava/test126/Driver.java | 18 | ||||
-rw-r--r-- | tests/pureJava/test126/Readme.txt | 7 | ||||
-rw-r--r-- | tests/pureJava/test133/Driver.java | 24 |
5 files changed, 111 insertions, 0 deletions
diff --git a/tests/pureJava/test120/Driver.java b/tests/pureJava/test120/Driver.java new file mode 100644 index 000000000..14bf33201 --- /dev/null +++ b/tests/pureJava/test120/Driver.java @@ -0,0 +1,53 @@ +public \u0063l\u0061ss Driver { + + public static void main(String[] args) { test(); } + + public static void test() { + + // integer literals + int dec = 5; + long longDec = 5; + long longDecL = 5L; + + int hex = 0xAbcdE; + long longHex = 0xAbcdE; + long longHexL = 0xAbcdEL; + + int oct = 0762; + long longOct = 0762; + long longOctL = 0762L; + + // boolean literals + boolean btrue = true; + boolean bfalse = false; + + // float literals + float f1 = 1e1f, f2 = 2.f, f3 = .3f, f4 = 3.14f, f5 = 6.023e+23f; + + // character literals + char + // c1 = '\u2352', + c2 = '\u0063'; // 'c' + // c3 = '\u0007'; + + // string literals + String \u0063 = "c"; // String c = "c"; + String s1 = ""; + String s2 = "\u0063"; // the string "c"; + // String s3 = "\u3333"; // uncommenting this will break weaver + + // string literals with escapes + String bs = "\b"; + String ht = "\t"; + String lf = "\n"; + String cr = "\r"; + String dq = "\""; + String sq = "\'"; + String backslash = "\\"; + String oes = "\u0000"; // octal escape smallest + String oeb = "\u00ff"; // octal escape biggest + String ctrlg = ""; // this turns into "\u0007" by the time it is parsed. + String random = "\u3333"; + } +} + diff --git a/tests/pureJava/test120/Readme.txt b/tests/pureJava/test120/Readme.txt new file mode 100644 index 000000000..351d8d6e5 --- /dev/null +++ b/tests/pureJava/test120/Readme.txt @@ -0,0 +1,9 @@ +Mode: VM run +Title: unicodes and literals + +This test checks if the weaver correctly handles all forms of Java +literal expressions and unicodes. See bugs b076 and b077. + + + + diff --git a/tests/pureJava/test126/Driver.java b/tests/pureJava/test126/Driver.java new file mode 100644 index 000000000..e855c5781 --- /dev/null +++ b/tests/pureJava/test126/Driver.java @@ -0,0 +1,18 @@ +public class Driver { + public static void main(String[] args) { test(); } + + public static void test() { + + // local variable declaration in the init part of a for + for (int i = 0, j = 0; j < 10 ; i++, j++) { + j++; + } + int m, n, j = 0; + + // init part without local var declaration + for (m = 0, n = 0; j < 10 ; m++, n++) { + j++; + m++; + } + } +} diff --git a/tests/pureJava/test126/Readme.txt b/tests/pureJava/test126/Readme.txt new file mode 100644 index 000000000..b4b666098 --- /dev/null +++ b/tests/pureJava/test126/Readme.txt @@ -0,0 +1,7 @@ +Mode: VM run +Title: For Statement + +This tests the weaving of For statements. More variants of the for +statement can be added to the test. The current test only checks for +variation in the init part of the for loop. + diff --git a/tests/pureJava/test133/Driver.java b/tests/pureJava/test133/Driver.java new file mode 100644 index 000000000..1f1b1f7ab --- /dev/null +++ b/tests/pureJava/test133/Driver.java @@ -0,0 +1,24 @@ +// PUREJAVA: Corrrect supercall lookup for method().name() +import org.aspectj.testing.Tester; + +public class Driver { + private Foo foo = new Foo(); + + public static void main(String[] args) { test(); } + + public Foo getFoo() { return foo; } + + public String bar() { + return getFoo().bar(); + } + + public static void test() { + Tester.checkEqual(new Driver().bar(), "Foo", "getFoo().bar()"); + } +} + +class Foo { + public String bar() { + return "Foo"; + } +} |