2007-09-25 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / tests / load-exceptions.cs
index b84c7b4eb7d2f7370d252837dbb6083f1c4f3ea7..c9480634171e67c0387b3e2bce289c0cb17ab406 100644 (file)
@@ -3,6 +3,7 @@
 //
 
 using System;
+using System.IO;
 
 class Miss1 : Missing.Foo1 {
 }
@@ -36,6 +37,15 @@ public class Tests : LoadMissing {
                return 1;
        }
 
+       internal static int check_file_not_found (TestDel d){
+               try {
+                       d ();
+               } catch (FileNotFoundException ex){
+                       return 0;
+               }
+               return 1;
+       }
+       
        internal static int check_missing_field (TestDel d) {
                try {
                        d ();
@@ -48,6 +58,7 @@ public class Tests : LoadMissing {
                return 1;
        }
 
+
        //
        // Base instructions
        //
@@ -85,6 +96,9 @@ public class Tests : LoadMissing {
                return check_type_load (new TestDel (missing_cpobj));
        }
 
+        public static int test_0_missing_type_on_parameter () {
+               return check_type_load (new TestDel (missing_external_type_reference_on_parameter));
+        } 
        public static int test_0_initobj () {
                return check_type_load (new TestDel (missing_initobj));
        }
@@ -187,6 +201,21 @@ public class Tests : LoadMissing {
                return check_type_load (new TestDel (missing_unbox_any));
        }
 
+#if false
+       // Bummer: we regressed!   I should have put this before
+       public static int test_0_missing_assembly_in_fieldref () {
+               return check_file_not_found (new TestDel (missing_assembly_in_fieldref));
+       }
+#endif
+
+       public static int test_0_missing_assembly_in_call () {
+               return check_missing_method (new TestDel (missing_assembly_in_call));
+       }
+
+       public static int test_0_missing_assembly_in_newobj () {
+               return check_missing_method (new TestDel (missing_assembly_in_newobj));
+       }
+       
        //
        // Missing classes referenced from metadata
        //