2009-06-01 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / load-exceptions.cs
index d71922a72b4fe4a08cbc8f46c7875c1cd134d422..96205e5a759c973260e202d380d2204f4bbb3210 100644 (file)
@@ -4,6 +4,7 @@
 
 using System;
 using System.IO;
+using System.Reflection;
 
 class Miss1 : Missing.Foo1 {
 }
@@ -236,6 +237,17 @@ public class Tests : LoadMissing {
                return 0;
        }
 
+       #Regression test for #508532
+       public static int test_0_assembly_throws_on_loader_error ()
+       {
+               try {
+                       Assembly asm = Assembly.Load ("load-missing");
+                       asm.GetType ("BrokenClass", false);
+                       return 1;
+               } catch (TypeLoadException) {}
+               return 0;
+       }
+       
        // FIXME: These do not work yet
 #if FALSE
        public static void missing_parent () {