2003-09-16 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Tue, 16 Sep 2003 21:28:06 +0000 (21:28 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 16 Sep 2003 21:28:06 +0000 (21:28 -0000)
* gen-3.cs, gen-4.cs, gen-5.cs, gen-6.cs, gen-7.cs, gen-8.cs: New
generics tests.

svn path=/trunk/mcs/; revision=18137

mcs/tests/ChangeLog
mcs/tests/README.tests
mcs/tests/gen-3.cs [new file with mode: 0644]
mcs/tests/gen-4.cs [new file with mode: 0644]
mcs/tests/gen-5.cs [new file with mode: 0644]
mcs/tests/gen-6.cs [new file with mode: 0644]
mcs/tests/gen-7.cs [new file with mode: 0644]
mcs/tests/gen-8.cs [new file with mode: 0644]

index 5e98f8bb4b8e7c6b6cbc7e793a71dfb63d4cdcec..10ec6f4c5c47ff30b9bbc2bfa04100274d6d0dc7 100755 (executable)
@@ -1,3 +1,8 @@
+2003-09-16  Martin Baulig  <martin@ximian.com>
+
+       * gen-3.cs, gen-4.cs, gen-5.cs, gen-6.cs, gen-7.cs, gen-8.cs: New
+       generics tests.
+
 2003-09-02  Ravi Pratap  <ravi@ximian.com>
 
        * test-102.cs: Improve test.
index 1a6308749d57abca403ae98367ea1ea5b238e5de..ad99d1adc3c3579c637039c9f0017a8d2ee92bab 100644 (file)
@@ -407,3 +407,43 @@ unsafe-6.cs:
 Tests the correct computation of compound operators in the context of a pointer 
 dereference on the left side.
 
+gen-1.cs:
+---------
+
+Simple constructed type.
+
+gen-2.cs:
+---------
+
+Type parameter as field.
+
+gen-3.cs:
+---------
+
+Field of constructed type.
+
+gen-4.cs:
+---------
+
+Method argument of constructed type.
+
+gen-5.cs:
+---------
+
+Local variable of constructed type.
+
+gen-6.cs:
+---------
+
+More complex example.
+
+gen-7.cs:
+---------
+
+Constructed type deriving from a class type.
+
+gen-8.cs:
+---------
+
+`where' clauses.
+
diff --git a/mcs/tests/gen-3.cs b/mcs/tests/gen-3.cs
new file mode 100644 (file)
index 0000000..8a2e537
--- /dev/null
@@ -0,0 +1,13 @@
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+       Stack<Test> a;
+
+       static void Main()
+       {
+       }
+}
diff --git a/mcs/tests/gen-4.cs b/mcs/tests/gen-4.cs
new file mode 100644 (file)
index 0000000..238c461
--- /dev/null
@@ -0,0 +1,14 @@
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+       public void Foo (Stack<Test> a)
+       { }
+
+       static void Main()
+       {
+       }
+}
diff --git a/mcs/tests/gen-5.cs b/mcs/tests/gen-5.cs
new file mode 100644 (file)
index 0000000..b3ecdeb
--- /dev/null
@@ -0,0 +1,12 @@
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+       static void Main()
+       {
+               Stack<Test> a;
+       }
+}
diff --git a/mcs/tests/gen-6.cs b/mcs/tests/gen-6.cs
new file mode 100644 (file)
index 0000000..6c53bda
--- /dev/null
@@ -0,0 +1,32 @@
+class Stack<T>
+{
+       int size;
+       T[] data;
+
+       public Stack ()
+       {
+               data = new T [200];
+       }
+
+       public void Push (T item)
+       {
+               data [size++] = item;
+       }
+
+       public T Pop ()
+       {
+               return data [--size];
+       }
+
+       public void Hello (T t)
+       {
+               System.Console.WriteLine ("Hello: {0}", t);
+       }
+}
+
+class Test
+{
+       static void Main ()
+       {
+       }
+}
diff --git a/mcs/tests/gen-7.cs b/mcs/tests/gen-7.cs
new file mode 100644 (file)
index 0000000..d4f537d
--- /dev/null
@@ -0,0 +1,14 @@
+class Stack<T> : X
+{
+}
+
+class Test
+{
+}
+
+class X
+{
+       static void Main()
+       {
+       }
+}
diff --git a/mcs/tests/gen-8.cs b/mcs/tests/gen-8.cs
new file mode 100644 (file)
index 0000000..5665e12
--- /dev/null
@@ -0,0 +1,20 @@
+interface I
+{
+       void Hello ();
+}
+
+class Stack<T>
+       where T : I, new ()
+{
+}
+
+class Test
+{
+}
+
+class X
+{
+       static void Main()
+       {
+       }
+}