[interp] disable assemblyresolve_event6.exe
[mono.git] / mono / tests / cominterop.cs
index fbfdcbbb16b763ad02e9852402e36055c2c0e64a..4a5bd8fbc6fddfd4f0ac16635bca10ae077060ee 100644 (file)
@@ -251,6 +251,9 @@ public class Tests
        [DllImport ("libtest")]
        public static extern int mono_test_marshal_ccw_itest ([MarshalAs (UnmanagedType.Interface)]ITestPresSig itest);
 
+       [DllImport ("libtest")]
+       public static extern int mono_test_marshal_array_ccw_itest (int count, [MarshalAs (UnmanagedType.LPArray, SizeParamIndex=0)] ITest[] ppUnk);
+
        [DllImport("libtest")]
        public static extern int mono_test_marshal_safearray_out_1dim_vt_bstr_empty ([MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)]out Array array);
 
@@ -455,6 +458,8 @@ public class Tests
 
                        #region Runtime Callable Wrapper Tests
 
+#if !MOBILE
+
                        IntPtr pUnk;
                        if (mono_test_marshal_com_object_create (out pUnk) != 0)
                                return 145;
@@ -531,6 +536,9 @@ public class Tests
                        if (TestITestDelegate (itest) != 0)
                                return 174;
 
+                       if (TestIfaceNoIcall (itest as ITestPresSig) != 0)
+                               return 201;
+
                        itest = new TestClass ();
 
                        if (TestITest (itest) != 0)
@@ -541,6 +549,9 @@ public class Tests
                        if (TestITest (itest) != 0)
                                return 176;
 
+
+#endif
+
                        #endregion // Runtime Callable Wrapper Tests
 
                        #region COM Callable Wrapper Tests
@@ -556,6 +567,11 @@ public class Tests
 
                        mono_test_marshal_ccw_itest (test_pres_sig);
 
+                       // test for Xamarin-47560
+                       var tests = new[] { test.Test };
+                       if (mono_test_marshal_array_ccw_itest (1, tests) != 0)
+                               return 201;
+
                        #endregion // COM Callable Wrapper Tests
 
                        #region SAFEARRAY tests
@@ -771,6 +787,7 @@ public class Tests
                void ITestIn ([MarshalAs (UnmanagedType.Interface)]ITest val);
                [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
                void ITestOut ([MarshalAs (UnmanagedType.Interface)]out ITest val);
+               int Return22NoICall();
        }
 
        [ComImport ()]
@@ -822,6 +839,8 @@ public class Tests
                [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
                [PreserveSig ()]
                int ITestOut ([MarshalAs (UnmanagedType.Interface)]out ITestPresSig val);
+               [PreserveSig ()]
+               int Return22NoICall();
        }
 
        [System.Runtime.InteropServices.GuidAttribute ("00000000-0000-0000-0000-000000000002")]
@@ -861,6 +880,9 @@ public class Tests
                public virtual extern void ITestIn ([MarshalAs (UnmanagedType.Interface)]ITest val);
                [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
                public virtual extern void ITestOut ([MarshalAs (UnmanagedType.Interface)]out ITest val);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+               public virtual extern int Return22NoICall();
        }
 
        [System.Runtime.InteropServices.GuidAttribute ("00000000-0000-0000-0000-000000000002")]
@@ -1000,6 +1022,11 @@ public class Tests
                        val = new ManagedTestPresSig ();
                        return 0;
                }
+
+               public int Return22NoICall()
+               {
+                       return 88;
+               }
        }
 
        public class ManagedTest : ITest
@@ -1089,6 +1116,11 @@ public class Tests
                                return new ManagedTest ();
                        }
                }
+
+               public int Return22NoICall()
+               {
+                       return 99;
+               }
        }
 
        public static int mono_test_marshal_variant_in_callback (VarEnum vt, object obj)
@@ -1302,6 +1334,10 @@ public class Tests
                }
                return 0;
        }
+
+       public static int TestIfaceNoIcall (ITestPresSig itest) {
+               return itest.Return22NoICall () == 22 ? 0 : 1;
+       }
 }
 
 public class TestVisible