+2007-01-15 Miguel de Icaza <miguel@novell.com>
+
+ * load-missing.il: Add test for missing assembly reference in
+ field reference;
+
+ Add test for missing type in newobj call.
+
+ Add test for missing type reference in a parameter.
+
+ Add test for missing assembly in method call.
+
2007-01-11 Jonathan Chambers <joncham@gmail.com>
* libtest.c, cominterop.cs: Tests for unmanaged->managed
//
using System;
+using System.IO;
class Miss1 : Missing.Foo1 {
}
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 ();
return 1;
}
+
//
// Base instructions
//
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));
}
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
//
IL_0011: ret\r
}\r
\r
+ .method public hidebysig static void missing_assembly_in_fieldref () cil managed\r
+ {\r
+ .maxstack 8\r
+ ldc.i4.0\r
+ stsfld int32 [t]X::a\r
+ ret\r
+ }\r
+\r
+ .method public hidebysig static void missing_assembly_in_call () cil managed\r
+ {\r
+ .maxstack 8\r
+ call void class [t]Gtk.Application::Init()\r
+ ret\r
+ }\r
+\r
+ .method public hidebysig static void missing_assembly_in_newobj () cil managed\r
+ {\r
+ .maxstack 8\r
+ newobj instance void class [mscorlib]System.Dingus::.ctor()\r
+ pop\r
+ ret\r
+ }\r
+\r
+ .method public hidebysig static void missing_external_type_reference_on_parameter() cil managed\r
+ {\r
+ .maxstack 8\r
+ ldstr "Hello"\r
+ call void class [mscorlib]System.String::Trim([mscorlib]MissingType)\r
+ ret\r
+ }\r
+\r
.method public hidebysig static void missing_ldtoken_field() cil managed\r
{\r
\r