Selaa lähdekoodia

Add more tests, update test-53

svn path=/trunk/mcs/; revision=1545
Miguel de Icaza 24 vuotta sitten
vanhempi
sitoutus
96c5fedf11
4 muutettua tiedostoa jossa 126 lisäystä ja 3 poistoa
  1. 11 3
      mcs/tests/makefile
  2. 93 0
      mcs/tests/test-41.cs
  3. BIN
      mcs/tests/test-53.cs
  4. 22 0
      mcs/tests/test-54.cs

+ 11 - 3
mcs/tests/makefile

@@ -9,11 +9,19 @@ TEST_SOURCES = \
 	test-11 test-12 test-13 test-14 test-15 test-16 test-17 test-18 test-19 test-20 \
 	test-21 test-22 test-23 test-24 test-25 test-26 test-27 test-28 		\
 	test-31 test-32 test-33 test-34 test-35 test-36	test-37 	test-39 test-40 \
-		test-42 test-43 test-44 test-45 test-46 test-47 test-48 test-49 test-50 
-			test-53
+	test-41 test-42 test-43 test-44 test-45 test-46 test-47 test-48 test-49 test-50 \
+			test-53 
 
+
+# NOTE ON TEST-54.  Do not remove it, it compiles but does not pass peverify
 TEST_NOPASS = \
-	test-29 test-30 test-38 test-52
+	test-29 test-30 test-38 test-52 test-54
+#################  Details on why test-54 does not pass are on TODO file.
+
+
+
+
+
 
 test-compiler:
 	-rm *.exe

+ 93 - 0
mcs/tests/test-41.cs

@@ -0,0 +1,93 @@
+//
+// This tests the ref access to parameters
+//
+using System;
+
+class X {
+
+	static void A (ref int a, ref uint b, ref sbyte c, ref byte d, ref long e, ref ulong f,
+		       ref short g, ref ushort h, ref char i, ref X x, ref float j, ref double k)
+	{
+		if (a == 1)
+			a = 2;
+
+		if (b == 1)
+			b = 2;
+
+		if (c == 1)
+			c = 2;
+
+		if (d == 1)
+			d = 2;
+
+		if (e == 1)
+			e = 2;
+
+		if (f == 1)
+			f = 2;
+
+		if (g == 1)
+			g = 2;
+
+		if (h == 1)
+			h = 2;
+
+		if (i == 'a')
+			i = 'b';
+
+		if (x == null)
+			x = new X ();
+
+		if (j == 1.0)
+			j = 2.0F;
+		if (k == 1.0)
+			k = 2.0;
+	}
+
+	static int Main ()
+	{
+		int a = 1;
+		uint b = 1;
+		sbyte c = 1;
+		byte d = 1;
+		long e = 1;
+		ulong f = 1;
+		short g = 1;
+		ushort h = 1;
+		char i = 'a';
+		float j = 1.0F;
+		double k = 1.0;
+		X x = null;
+
+		A (ref a, ref b, ref c, ref d, ref e, ref f, ref g, ref h, ref i, ref x, ref j, ref k);
+
+		if (a != 2)
+			return 1;
+		if (b != 2)
+			return 2;
+		if (c != 2)
+			return 3;
+		if (d != 2)
+			return 4;
+		if (e != 2)
+			return 5;
+		if (f != 2)
+			return 6;
+		if (g != 2)
+			return 7;
+		if (h != 2)
+			return 8;
+		if (i != 'b')
+			return 9;
+		if (j != 2.0)
+			return 10;
+		if (k != 2.0)
+			return 11;
+		if (x == null)
+			return 12;
+
+		Console.WriteLine ("Test passed");
+		return 0;
+	}
+}
+	

BIN
mcs/tests/test-53.cs


+ 22 - 0
mcs/tests/test-54.cs

@@ -0,0 +1,22 @@
+//
+// This test does not pass peverify because we dont return properly
+// from catch blocks
+//
+
+class X {
+
+	bool v ()
+	{
+		try {
+			throw new Exception ();
+		} catch {
+			return false;
+		}
+		return true;
+	}
+
+	static int Main ()
+	{
+		return 0;
+	}		
+}